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

com.uber.cadence.WorkflowService Maven / Gradle / Ivy

/**
 * Autogenerated by Thrift Compiler (0.9.3)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.uber.cadence;

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 = "2019-04-30")
public class WorkflowService {

  /**
   * WorkflowService API is exposed to provide support for long running applications.  Application is expected to call
   * StartWorkflowExecution to create an instance for each instance of long running workflow.  Such applications are expected
   * to have a worker which regularly polls for DecisionTask and ActivityTask from the WorkflowService.  For each
   * DecisionTask, application is expected to process the history of events for that session and respond back with next
   * decisions.  For each ActivityTask, application is expected to execute the actual logic for that task and respond back
   * with completion or failure.  Worker is expected to regularly heartbeat while activity task is running.
   * 
   */
  public interface Iface {

    /**
     * RegisterDomain creates a new domain which can be used as a container for all resources.  Domain is a top level
     * entity within Cadence, used as a container for all resources like workflow executions, tasklists, etc.  Domain
     * acts as a sandbox and provides isolation for all resources within the domain.  All resources belongs to exactly one
     * domain.
     * 
     * 
     * @param registerRequest
     */
    public void RegisterDomain(com.uber.cadence.RegisterDomainRequest registerRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.DomainAlreadyExistsError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException;

    /**
     * DescribeDomain returns the information and configuration for a registered domain.
     * 
     * 
     * @param describeRequest
     */
    public com.uber.cadence.DescribeDomainResponse DescribeDomain(com.uber.cadence.DescribeDomainRequest describeRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException;

    /**
     * ListDomains returns the information and configuration for all domains.
     * 
     * 
     * @param listRequest
     */
    public com.uber.cadence.ListDomainsResponse ListDomains(com.uber.cadence.ListDomainsRequest listRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException;

    /**
     * UpdateDomain is used to update the information and configuration for a registered domain.
     * 
     * 
     * @param updateRequest
     */
    public com.uber.cadence.UpdateDomainResponse UpdateDomain(com.uber.cadence.UpdateDomainRequest updateRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, org.apache.thrift.TException;

    /**
     * DeprecateDomain us used to update status of a registered domain to DEPRECATED.  Once the domain is deprecated
     * it cannot be used to start new workflow executions.  Existing workflow executions will continue to run on
     * deprecated domains.
     * 
     * 
     * @param deprecateRequest
     */
    public void DeprecateDomain(com.uber.cadence.DeprecateDomainRequest deprecateRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, org.apache.thrift.TException;

    /**
     * StartWorkflowExecution starts a new long running workflow instance.  It will create the instance with
     * 'WorkflowExecutionStarted' event in history and also schedule the first DecisionTask for the worker to make the
     * first decision for this instance.  It will return 'WorkflowExecutionAlreadyStartedError', if an instance already
     * exists with same workflowId.
     * 
     * 
     * @param startRequest
     */
    public com.uber.cadence.StartWorkflowExecutionResponse StartWorkflowExecution(com.uber.cadence.StartWorkflowExecutionRequest startRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.WorkflowExecutionAlreadyStartedError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.EntityNotExistsError, org.apache.thrift.TException;

    /**
     * Returns the history of specified workflow execution.  It fails with 'EntityNotExistError' if speficied workflow
     * execution in unknown to the service.
     * 
     * 
     * @param getRequest
     */
    public com.uber.cadence.GetWorkflowExecutionHistoryResponse GetWorkflowExecutionHistory(com.uber.cadence.GetWorkflowExecutionHistoryRequest getRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException;

    /**
     * PollForDecisionTask is called by application worker to process DecisionTask from a specific taskList.  A
     * DecisionTask is dispatched to callers for active workflow executions, with pending decisions.
     * Application is then expected to call 'RespondDecisionTaskCompleted' API when it is done processing the DecisionTask.
     * It will also create a 'DecisionTaskStarted' event in the history for that session before handing off DecisionTask to
     * application worker.
     * 
     * 
     * @param pollRequest
     */
    public com.uber.cadence.PollForDecisionTaskResponse PollForDecisionTask(com.uber.cadence.PollForDecisionTaskRequest pollRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.ServiceBusyError, com.uber.cadence.LimitExceededError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, org.apache.thrift.TException;

    /**
     * RespondDecisionTaskCompleted is called by application worker to complete a DecisionTask handed as a result of
     * 'PollForDecisionTask' API call.  Completing a DecisionTask will result in new events for the workflow execution and
     * potentially new ActivityTask being created for corresponding decisions.  It will also create a DecisionTaskCompleted
     * event in the history for that session.  Use the 'taskToken' provided as response of PollForDecisionTask API call
     * for completing the DecisionTask.
     * The response could contain a new decision task if there is one or if the request asking for one.
     * 
     * 
     * @param completeRequest
     */
    public com.uber.cadence.RespondDecisionTaskCompletedResponse RespondDecisionTaskCompleted(com.uber.cadence.RespondDecisionTaskCompletedRequest completeRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException;

    /**
     * RespondDecisionTaskFailed is called by application worker to indicate failure.  This results in
     * DecisionTaskFailedEvent written to the history and a new DecisionTask created.  This API can be used by client to
     * either clear sticky tasklist or report any panics during DecisionTask processing.  Cadence will only append first
     * DecisionTaskFailed event to the history of workflow execution for consecutive failures.
     * 
     * 
     * @param failedRequest
     */
    public void RespondDecisionTaskFailed(com.uber.cadence.RespondDecisionTaskFailedRequest failedRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException;

    /**
     * PollForActivityTask is called by application worker to process ActivityTask from a specific taskList.  ActivityTask
     * is dispatched to callers whenever a ScheduleTask decision is made for a workflow execution.
     * Application is expected to call 'RespondActivityTaskCompleted' or 'RespondActivityTaskFailed' once it is done
     * processing the task.
     * Application also needs to call 'RecordActivityTaskHeartbeat' API within 'heartbeatTimeoutSeconds' interval to
     * prevent the task from getting timed out.  An event 'ActivityTaskStarted' event is also written to workflow execution
     * history before the ActivityTask is dispatched to application worker.
     * 
     * 
     * @param pollRequest
     */
    public com.uber.cadence.PollForActivityTaskResponse PollForActivityTask(com.uber.cadence.PollForActivityTaskRequest pollRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.ServiceBusyError, com.uber.cadence.LimitExceededError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, org.apache.thrift.TException;

    /**
     * RecordActivityTaskHeartbeat is called by application worker while it is processing an ActivityTask.  If worker fails
     * to heartbeat within 'heartbeatTimeoutSeconds' interval for the ActivityTask, then it will be marked as timedout and
     * 'ActivityTaskTimedOut' event will be written to the workflow history.  Calling 'RecordActivityTaskHeartbeat' will
     * fail with 'EntityNotExistsError' in such situations.  Use the 'taskToken' provided as response of
     * PollForActivityTask API call for heartbeating.
     * 
     * 
     * @param heartbeatRequest
     */
    public com.uber.cadence.RecordActivityTaskHeartbeatResponse RecordActivityTaskHeartbeat(com.uber.cadence.RecordActivityTaskHeartbeatRequest heartbeatRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException;

    /**
     * RecordActivityTaskHeartbeatByID is called by application worker while it is processing an ActivityTask.  If worker fails
     * to heartbeat within 'heartbeatTimeoutSeconds' interval for the ActivityTask, then it will be marked as timedout and
     * 'ActivityTaskTimedOut' event will be written to the workflow history.  Calling 'RecordActivityTaskHeartbeatByID' will
     * fail with 'EntityNotExistsError' in such situations.  Instead of using 'taskToken' like in RecordActivityTaskHeartbeat,
     * use Domain, WorkflowID and ActivityID
     * 
     * 
     * @param heartbeatRequest
     */
    public com.uber.cadence.RecordActivityTaskHeartbeatResponse RecordActivityTaskHeartbeatByID(com.uber.cadence.RecordActivityTaskHeartbeatByIDRequest heartbeatRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException;

    /**
     * RespondActivityTaskCompleted is called by application worker when it is done processing an ActivityTask.  It will
     * result in a new 'ActivityTaskCompleted' event being written to the workflow history and a new DecisionTask
     * created for the workflow so new decisions could be made.  Use the 'taskToken' provided as response of
     * PollForActivityTask API call for completion. It fails with 'EntityNotExistsError' if the taskToken is not valid
     * anymore due to activity timeout.
     * 
     * 
     * @param completeRequest
     */
    public void RespondActivityTaskCompleted(com.uber.cadence.RespondActivityTaskCompletedRequest completeRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException;

    /**
     * RespondActivityTaskCompletedByID is called by application worker when it is done processing an ActivityTask.
     * It will result in a new 'ActivityTaskCompleted' event being written to the workflow history and a new DecisionTask
     * created for the workflow so new decisions could be made.  Similar to RespondActivityTaskCompleted but use Domain,
     * WorkflowID and ActivityID instead of 'taskToken' for completion. It fails with 'EntityNotExistsError'
     * if the these IDs are not valid anymore due to activity timeout.
     * 
     * 
     * @param completeRequest
     */
    public void RespondActivityTaskCompletedByID(com.uber.cadence.RespondActivityTaskCompletedByIDRequest completeRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException;

    /**
     * RespondActivityTaskFailed is called by application worker when it is done processing an ActivityTask.  It will
     * result in a new 'ActivityTaskFailed' event being written to the workflow history and a new DecisionTask
     * created for the workflow instance so new decisions could be made.  Use the 'taskToken' provided as response of
     * PollForActivityTask API call for completion. It fails with 'EntityNotExistsError' if the taskToken is not valid
     * anymore due to activity timeout.
     * 
     * 
     * @param failRequest
     */
    public void RespondActivityTaskFailed(com.uber.cadence.RespondActivityTaskFailedRequest failRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException;

    /**
     * RespondActivityTaskFailedByID is called by application worker when it is done processing an ActivityTask.
     * It will result in a new 'ActivityTaskFailed' event being written to the workflow history and a new DecisionTask
     * created for the workflow instance so new decisions could be made.  Similar to RespondActivityTaskFailed but use
     * Domain, WorkflowID and ActivityID instead of 'taskToken' for completion. It fails with 'EntityNotExistsError'
     * if the these IDs are not valid anymore due to activity timeout.
     * 
     * 
     * @param failRequest
     */
    public void RespondActivityTaskFailedByID(com.uber.cadence.RespondActivityTaskFailedByIDRequest failRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException;

    /**
     * RespondActivityTaskCanceled is called by application worker when it is successfully canceled an ActivityTask.  It will
     * result in a new 'ActivityTaskCanceled' event being written to the workflow history and a new DecisionTask
     * created for the workflow instance so new decisions could be made.  Use the 'taskToken' provided as response of
     * PollForActivityTask API call for completion. It fails with 'EntityNotExistsError' if the taskToken is not valid
     * anymore due to activity timeout.
     * 
     * 
     * @param canceledRequest
     */
    public void RespondActivityTaskCanceled(com.uber.cadence.RespondActivityTaskCanceledRequest canceledRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException;

    /**
     * RespondActivityTaskCanceledByID is called by application worker when it is successfully canceled an ActivityTask.
     * It will result in a new 'ActivityTaskCanceled' event being written to the workflow history and a new DecisionTask
     * created for the workflow instance so new decisions could be made.  Similar to RespondActivityTaskCanceled but use
     * Domain, WorkflowID and ActivityID instead of 'taskToken' for completion. It fails with 'EntityNotExistsError'
     * if the these IDs are not valid anymore due to activity timeout.
     * 
     * 
     * @param canceledRequest
     */
    public void RespondActivityTaskCanceledByID(com.uber.cadence.RespondActivityTaskCanceledByIDRequest canceledRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException;

    /**
     * RequestCancelWorkflowExecution is called by application worker when it wants to request cancellation of a workflow instance.
     * It will result in a new 'WorkflowExecutionCancelRequested' event being written to the workflow history and a new DecisionTask
     * created for the workflow instance so new decisions could be made. It fails with 'EntityNotExistsError' if the workflow is not valid
     * anymore due to completion or doesn't exist.
     * 
     * 
     * @param cancelRequest
     */
    public void RequestCancelWorkflowExecution(com.uber.cadence.RequestCancelWorkflowExecutionRequest cancelRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.CancellationAlreadyRequestedError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, org.apache.thrift.TException;

    /**
     * SignalWorkflowExecution is used to send a signal event to running workflow execution.  This results in
     * WorkflowExecutionSignaled event recorded in the history and a decision task being created for the execution.
     * 
     * 
     * @param signalRequest
     */
    public void SignalWorkflowExecution(com.uber.cadence.SignalWorkflowExecutionRequest signalRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, org.apache.thrift.TException;

    /**
     * SignalWithStartWorkflowExecution is used to ensure sending signal to a workflow.
     * If the workflow is running, this results in WorkflowExecutionSignaled event being recorded in the history
     * and a decision task being created for the execution.
     * If the workflow is not running or not found, this results in WorkflowExecutionStarted and WorkflowExecutionSignaled
     * events being recorded in history, and a decision task being created for the execution
     * 
     * 
     * @param signalWithStartRequest
     */
    public com.uber.cadence.StartWorkflowExecutionResponse SignalWithStartWorkflowExecution(com.uber.cadence.SignalWithStartWorkflowExecutionRequest signalWithStartRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.WorkflowExecutionAlreadyStartedError, org.apache.thrift.TException;

    /**
     * TerminateWorkflowExecution terminates an existing workflow execution by recording WorkflowExecutionTerminated event
     * in the history and immediately terminating the execution instance.
     * 
     * 
     * @param terminateRequest
     */
    public void TerminateWorkflowExecution(com.uber.cadence.TerminateWorkflowExecutionRequest terminateRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, org.apache.thrift.TException;

    /**
     * ListOpenWorkflowExecutions is a visibility API to list the open executions in a specific domain.
     * 
     * 
     * @param listRequest
     */
    public com.uber.cadence.ListOpenWorkflowExecutionsResponse ListOpenWorkflowExecutions(com.uber.cadence.ListOpenWorkflowExecutionsRequest listRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.LimitExceededError, org.apache.thrift.TException;

    /**
     * ListClosedWorkflowExecutions is a visibility API to list the closed executions in a specific domain.
     * 
     * 
     * @param listRequest
     */
    public com.uber.cadence.ListClosedWorkflowExecutionsResponse ListClosedWorkflowExecutions(com.uber.cadence.ListClosedWorkflowExecutionsRequest listRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException;

    /**
     * RespondQueryTaskCompleted is called by application worker to complete a QueryTask (which is a DecisionTask for query)
     * as a result of 'PollForDecisionTask' API call. Completing a QueryTask will unblock the client call to 'QueryWorkflow'
     * API and return the query result to client as a response to 'QueryWorkflow' API call.
     * 
     * 
     * @param completeRequest
     */
    public void RespondQueryTaskCompleted(com.uber.cadence.RespondQueryTaskCompletedRequest completeRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, org.apache.thrift.TException;

    /**
     * Reset the sticky tasklist related information in mutable state of a given workflow.
     * Things cleared are:
     * 1. StickyTaskList
     * 2. StickyScheduleToStartTimeout
     * 3. ClientLibraryVersion
     * 4. ClientFeatureVersion
     * 5. ClientImpl
     * 
     * 
     * @param resetRequest
     */
    public com.uber.cadence.ResetStickyTaskListResponse ResetStickyTaskList(com.uber.cadence.ResetStickyTaskListRequest resetRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, org.apache.thrift.TException;

    /**
     * QueryWorkflow returns query result for a specified workflow execution
     * 
     * 
     * @param queryRequest
     */
    public com.uber.cadence.QueryWorkflowResponse QueryWorkflow(com.uber.cadence.QueryWorkflowRequest queryRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.QueryFailedError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException;

    /**
     * DescribeWorkflowExecution returns information about the specified workflow execution.
     * 
     * 
     * @param describeRequest
     */
    public com.uber.cadence.DescribeWorkflowExecutionResponse DescribeWorkflowExecution(com.uber.cadence.DescribeWorkflowExecutionRequest describeRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException;

    /**
     * DescribeTaskList returns information about the target tasklist, right now this API returns the
     * pollers which polled this tasklist in last few minutes.
     * 
     * 
     * @param request
     */
    public com.uber.cadence.DescribeTaskListResponse DescribeTaskList(com.uber.cadence.DescribeTaskListRequest request) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException;

  }

  public interface AsyncIface {

    public void RegisterDomain(com.uber.cadence.RegisterDomainRequest registerRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void DescribeDomain(com.uber.cadence.DescribeDomainRequest describeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void ListDomains(com.uber.cadence.ListDomainsRequest listRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void UpdateDomain(com.uber.cadence.UpdateDomainRequest updateRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void DeprecateDomain(com.uber.cadence.DeprecateDomainRequest deprecateRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void StartWorkflowExecution(com.uber.cadence.StartWorkflowExecutionRequest startRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void GetWorkflowExecutionHistory(com.uber.cadence.GetWorkflowExecutionHistoryRequest getRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void PollForDecisionTask(com.uber.cadence.PollForDecisionTaskRequest pollRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void RespondDecisionTaskCompleted(com.uber.cadence.RespondDecisionTaskCompletedRequest completeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void RespondDecisionTaskFailed(com.uber.cadence.RespondDecisionTaskFailedRequest failedRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void PollForActivityTask(com.uber.cadence.PollForActivityTaskRequest pollRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void RecordActivityTaskHeartbeat(com.uber.cadence.RecordActivityTaskHeartbeatRequest heartbeatRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void RecordActivityTaskHeartbeatByID(com.uber.cadence.RecordActivityTaskHeartbeatByIDRequest heartbeatRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void RespondActivityTaskCompleted(com.uber.cadence.RespondActivityTaskCompletedRequest completeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void RespondActivityTaskCompletedByID(com.uber.cadence.RespondActivityTaskCompletedByIDRequest completeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void RespondActivityTaskFailed(com.uber.cadence.RespondActivityTaskFailedRequest failRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void RespondActivityTaskFailedByID(com.uber.cadence.RespondActivityTaskFailedByIDRequest failRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void RespondActivityTaskCanceled(com.uber.cadence.RespondActivityTaskCanceledRequest canceledRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void RespondActivityTaskCanceledByID(com.uber.cadence.RespondActivityTaskCanceledByIDRequest canceledRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void RequestCancelWorkflowExecution(com.uber.cadence.RequestCancelWorkflowExecutionRequest cancelRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void SignalWorkflowExecution(com.uber.cadence.SignalWorkflowExecutionRequest signalRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void SignalWithStartWorkflowExecution(com.uber.cadence.SignalWithStartWorkflowExecutionRequest signalWithStartRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void TerminateWorkflowExecution(com.uber.cadence.TerminateWorkflowExecutionRequest terminateRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void ListOpenWorkflowExecutions(com.uber.cadence.ListOpenWorkflowExecutionsRequest listRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void ListClosedWorkflowExecutions(com.uber.cadence.ListClosedWorkflowExecutionsRequest listRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void RespondQueryTaskCompleted(com.uber.cadence.RespondQueryTaskCompletedRequest completeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void ResetStickyTaskList(com.uber.cadence.ResetStickyTaskListRequest resetRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void QueryWorkflow(com.uber.cadence.QueryWorkflowRequest queryRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void DescribeWorkflowExecution(com.uber.cadence.DescribeWorkflowExecutionRequest describeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void DescribeTaskList(com.uber.cadence.DescribeTaskListRequest 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 void RegisterDomain(com.uber.cadence.RegisterDomainRequest registerRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.DomainAlreadyExistsError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      send_RegisterDomain(registerRequest);
      recv_RegisterDomain();
    }

    public void send_RegisterDomain(com.uber.cadence.RegisterDomainRequest registerRequest) throws org.apache.thrift.TException
    {
      RegisterDomain_args args = new RegisterDomain_args();
      args.setRegisterRequest(registerRequest);
      sendBase("RegisterDomain", args);
    }

    public void recv_RegisterDomain() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.DomainAlreadyExistsError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      RegisterDomain_result result = new RegisterDomain_result();
      receiveBase(result, "RegisterDomain");
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.domainExistsError != null) {
        throw result.domainExistsError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      return;
    }

    public com.uber.cadence.DescribeDomainResponse DescribeDomain(com.uber.cadence.DescribeDomainRequest describeRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      send_DescribeDomain(describeRequest);
      return recv_DescribeDomain();
    }

    public void send_DescribeDomain(com.uber.cadence.DescribeDomainRequest describeRequest) throws org.apache.thrift.TException
    {
      DescribeDomain_args args = new DescribeDomain_args();
      args.setDescribeRequest(describeRequest);
      sendBase("DescribeDomain", args);
    }

    public com.uber.cadence.DescribeDomainResponse recv_DescribeDomain() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      DescribeDomain_result result = new DescribeDomain_result();
      receiveBase(result, "DescribeDomain");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "DescribeDomain failed: unknown result");
    }

    public com.uber.cadence.ListDomainsResponse ListDomains(com.uber.cadence.ListDomainsRequest listRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      send_ListDomains(listRequest);
      return recv_ListDomains();
    }

    public void send_ListDomains(com.uber.cadence.ListDomainsRequest listRequest) throws org.apache.thrift.TException
    {
      ListDomains_args args = new ListDomains_args();
      args.setListRequest(listRequest);
      sendBase("ListDomains", args);
    }

    public com.uber.cadence.ListDomainsResponse recv_ListDomains() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      ListDomains_result result = new ListDomains_result();
      receiveBase(result, "ListDomains");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "ListDomains failed: unknown result");
    }

    public com.uber.cadence.UpdateDomainResponse UpdateDomain(com.uber.cadence.UpdateDomainRequest updateRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, org.apache.thrift.TException
    {
      send_UpdateDomain(updateRequest);
      return recv_UpdateDomain();
    }

    public void send_UpdateDomain(com.uber.cadence.UpdateDomainRequest updateRequest) throws org.apache.thrift.TException
    {
      UpdateDomain_args args = new UpdateDomain_args();
      args.setUpdateRequest(updateRequest);
      sendBase("UpdateDomain", args);
    }

    public com.uber.cadence.UpdateDomainResponse recv_UpdateDomain() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, org.apache.thrift.TException
    {
      UpdateDomain_result result = new UpdateDomain_result();
      receiveBase(result, "UpdateDomain");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "UpdateDomain failed: unknown result");
    }

    public void DeprecateDomain(com.uber.cadence.DeprecateDomainRequest deprecateRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, org.apache.thrift.TException
    {
      send_DeprecateDomain(deprecateRequest);
      recv_DeprecateDomain();
    }

    public void send_DeprecateDomain(com.uber.cadence.DeprecateDomainRequest deprecateRequest) throws org.apache.thrift.TException
    {
      DeprecateDomain_args args = new DeprecateDomain_args();
      args.setDeprecateRequest(deprecateRequest);
      sendBase("DeprecateDomain", args);
    }

    public void recv_DeprecateDomain() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, org.apache.thrift.TException
    {
      DeprecateDomain_result result = new DeprecateDomain_result();
      receiveBase(result, "DeprecateDomain");
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      return;
    }

    public com.uber.cadence.StartWorkflowExecutionResponse StartWorkflowExecution(com.uber.cadence.StartWorkflowExecutionRequest startRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.WorkflowExecutionAlreadyStartedError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.EntityNotExistsError, org.apache.thrift.TException
    {
      send_StartWorkflowExecution(startRequest);
      return recv_StartWorkflowExecution();
    }

    public void send_StartWorkflowExecution(com.uber.cadence.StartWorkflowExecutionRequest startRequest) throws org.apache.thrift.TException
    {
      StartWorkflowExecution_args args = new StartWorkflowExecution_args();
      args.setStartRequest(startRequest);
      sendBase("StartWorkflowExecution", args);
    }

    public com.uber.cadence.StartWorkflowExecutionResponse recv_StartWorkflowExecution() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.WorkflowExecutionAlreadyStartedError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.EntityNotExistsError, org.apache.thrift.TException
    {
      StartWorkflowExecution_result result = new StartWorkflowExecution_result();
      receiveBase(result, "StartWorkflowExecution");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.sessionAlreadyExistError != null) {
        throw result.sessionAlreadyExistError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "StartWorkflowExecution failed: unknown result");
    }

    public com.uber.cadence.GetWorkflowExecutionHistoryResponse GetWorkflowExecutionHistory(com.uber.cadence.GetWorkflowExecutionHistoryRequest getRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      send_GetWorkflowExecutionHistory(getRequest);
      return recv_GetWorkflowExecutionHistory();
    }

    public void send_GetWorkflowExecutionHistory(com.uber.cadence.GetWorkflowExecutionHistoryRequest getRequest) throws org.apache.thrift.TException
    {
      GetWorkflowExecutionHistory_args args = new GetWorkflowExecutionHistory_args();
      args.setGetRequest(getRequest);
      sendBase("GetWorkflowExecutionHistory", args);
    }

    public com.uber.cadence.GetWorkflowExecutionHistoryResponse recv_GetWorkflowExecutionHistory() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      GetWorkflowExecutionHistory_result result = new GetWorkflowExecutionHistory_result();
      receiveBase(result, "GetWorkflowExecutionHistory");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetWorkflowExecutionHistory failed: unknown result");
    }

    public com.uber.cadence.PollForDecisionTaskResponse PollForDecisionTask(com.uber.cadence.PollForDecisionTaskRequest pollRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.ServiceBusyError, com.uber.cadence.LimitExceededError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, org.apache.thrift.TException
    {
      send_PollForDecisionTask(pollRequest);
      return recv_PollForDecisionTask();
    }

    public void send_PollForDecisionTask(com.uber.cadence.PollForDecisionTaskRequest pollRequest) throws org.apache.thrift.TException
    {
      PollForDecisionTask_args args = new PollForDecisionTask_args();
      args.setPollRequest(pollRequest);
      sendBase("PollForDecisionTask", args);
    }

    public com.uber.cadence.PollForDecisionTaskResponse recv_PollForDecisionTask() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.ServiceBusyError, com.uber.cadence.LimitExceededError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, org.apache.thrift.TException
    {
      PollForDecisionTask_result result = new PollForDecisionTask_result();
      receiveBase(result, "PollForDecisionTask");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "PollForDecisionTask failed: unknown result");
    }

    public com.uber.cadence.RespondDecisionTaskCompletedResponse RespondDecisionTaskCompleted(com.uber.cadence.RespondDecisionTaskCompletedRequest completeRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      send_RespondDecisionTaskCompleted(completeRequest);
      return recv_RespondDecisionTaskCompleted();
    }

    public void send_RespondDecisionTaskCompleted(com.uber.cadence.RespondDecisionTaskCompletedRequest completeRequest) throws org.apache.thrift.TException
    {
      RespondDecisionTaskCompleted_args args = new RespondDecisionTaskCompleted_args();
      args.setCompleteRequest(completeRequest);
      sendBase("RespondDecisionTaskCompleted", args);
    }

    public com.uber.cadence.RespondDecisionTaskCompletedResponse recv_RespondDecisionTaskCompleted() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      RespondDecisionTaskCompleted_result result = new RespondDecisionTaskCompleted_result();
      receiveBase(result, "RespondDecisionTaskCompleted");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "RespondDecisionTaskCompleted failed: unknown result");
    }

    public void RespondDecisionTaskFailed(com.uber.cadence.RespondDecisionTaskFailedRequest failedRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      send_RespondDecisionTaskFailed(failedRequest);
      recv_RespondDecisionTaskFailed();
    }

    public void send_RespondDecisionTaskFailed(com.uber.cadence.RespondDecisionTaskFailedRequest failedRequest) throws org.apache.thrift.TException
    {
      RespondDecisionTaskFailed_args args = new RespondDecisionTaskFailed_args();
      args.setFailedRequest(failedRequest);
      sendBase("RespondDecisionTaskFailed", args);
    }

    public void recv_RespondDecisionTaskFailed() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      RespondDecisionTaskFailed_result result = new RespondDecisionTaskFailed_result();
      receiveBase(result, "RespondDecisionTaskFailed");
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      return;
    }

    public com.uber.cadence.PollForActivityTaskResponse PollForActivityTask(com.uber.cadence.PollForActivityTaskRequest pollRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.ServiceBusyError, com.uber.cadence.LimitExceededError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, org.apache.thrift.TException
    {
      send_PollForActivityTask(pollRequest);
      return recv_PollForActivityTask();
    }

    public void send_PollForActivityTask(com.uber.cadence.PollForActivityTaskRequest pollRequest) throws org.apache.thrift.TException
    {
      PollForActivityTask_args args = new PollForActivityTask_args();
      args.setPollRequest(pollRequest);
      sendBase("PollForActivityTask", args);
    }

    public com.uber.cadence.PollForActivityTaskResponse recv_PollForActivityTask() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.ServiceBusyError, com.uber.cadence.LimitExceededError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, org.apache.thrift.TException
    {
      PollForActivityTask_result result = new PollForActivityTask_result();
      receiveBase(result, "PollForActivityTask");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "PollForActivityTask failed: unknown result");
    }

    public com.uber.cadence.RecordActivityTaskHeartbeatResponse RecordActivityTaskHeartbeat(com.uber.cadence.RecordActivityTaskHeartbeatRequest heartbeatRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      send_RecordActivityTaskHeartbeat(heartbeatRequest);
      return recv_RecordActivityTaskHeartbeat();
    }

    public void send_RecordActivityTaskHeartbeat(com.uber.cadence.RecordActivityTaskHeartbeatRequest heartbeatRequest) throws org.apache.thrift.TException
    {
      RecordActivityTaskHeartbeat_args args = new RecordActivityTaskHeartbeat_args();
      args.setHeartbeatRequest(heartbeatRequest);
      sendBase("RecordActivityTaskHeartbeat", args);
    }

    public com.uber.cadence.RecordActivityTaskHeartbeatResponse recv_RecordActivityTaskHeartbeat() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      RecordActivityTaskHeartbeat_result result = new RecordActivityTaskHeartbeat_result();
      receiveBase(result, "RecordActivityTaskHeartbeat");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "RecordActivityTaskHeartbeat failed: unknown result");
    }

    public com.uber.cadence.RecordActivityTaskHeartbeatResponse RecordActivityTaskHeartbeatByID(com.uber.cadence.RecordActivityTaskHeartbeatByIDRequest heartbeatRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      send_RecordActivityTaskHeartbeatByID(heartbeatRequest);
      return recv_RecordActivityTaskHeartbeatByID();
    }

    public void send_RecordActivityTaskHeartbeatByID(com.uber.cadence.RecordActivityTaskHeartbeatByIDRequest heartbeatRequest) throws org.apache.thrift.TException
    {
      RecordActivityTaskHeartbeatByID_args args = new RecordActivityTaskHeartbeatByID_args();
      args.setHeartbeatRequest(heartbeatRequest);
      sendBase("RecordActivityTaskHeartbeatByID", args);
    }

    public com.uber.cadence.RecordActivityTaskHeartbeatResponse recv_RecordActivityTaskHeartbeatByID() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      RecordActivityTaskHeartbeatByID_result result = new RecordActivityTaskHeartbeatByID_result();
      receiveBase(result, "RecordActivityTaskHeartbeatByID");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "RecordActivityTaskHeartbeatByID failed: unknown result");
    }

    public void RespondActivityTaskCompleted(com.uber.cadence.RespondActivityTaskCompletedRequest completeRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      send_RespondActivityTaskCompleted(completeRequest);
      recv_RespondActivityTaskCompleted();
    }

    public void send_RespondActivityTaskCompleted(com.uber.cadence.RespondActivityTaskCompletedRequest completeRequest) throws org.apache.thrift.TException
    {
      RespondActivityTaskCompleted_args args = new RespondActivityTaskCompleted_args();
      args.setCompleteRequest(completeRequest);
      sendBase("RespondActivityTaskCompleted", args);
    }

    public void recv_RespondActivityTaskCompleted() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      RespondActivityTaskCompleted_result result = new RespondActivityTaskCompleted_result();
      receiveBase(result, "RespondActivityTaskCompleted");
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      return;
    }

    public void RespondActivityTaskCompletedByID(com.uber.cadence.RespondActivityTaskCompletedByIDRequest completeRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      send_RespondActivityTaskCompletedByID(completeRequest);
      recv_RespondActivityTaskCompletedByID();
    }

    public void send_RespondActivityTaskCompletedByID(com.uber.cadence.RespondActivityTaskCompletedByIDRequest completeRequest) throws org.apache.thrift.TException
    {
      RespondActivityTaskCompletedByID_args args = new RespondActivityTaskCompletedByID_args();
      args.setCompleteRequest(completeRequest);
      sendBase("RespondActivityTaskCompletedByID", args);
    }

    public void recv_RespondActivityTaskCompletedByID() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      RespondActivityTaskCompletedByID_result result = new RespondActivityTaskCompletedByID_result();
      receiveBase(result, "RespondActivityTaskCompletedByID");
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      return;
    }

    public void RespondActivityTaskFailed(com.uber.cadence.RespondActivityTaskFailedRequest failRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      send_RespondActivityTaskFailed(failRequest);
      recv_RespondActivityTaskFailed();
    }

    public void send_RespondActivityTaskFailed(com.uber.cadence.RespondActivityTaskFailedRequest failRequest) throws org.apache.thrift.TException
    {
      RespondActivityTaskFailed_args args = new RespondActivityTaskFailed_args();
      args.setFailRequest(failRequest);
      sendBase("RespondActivityTaskFailed", args);
    }

    public void recv_RespondActivityTaskFailed() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      RespondActivityTaskFailed_result result = new RespondActivityTaskFailed_result();
      receiveBase(result, "RespondActivityTaskFailed");
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      return;
    }

    public void RespondActivityTaskFailedByID(com.uber.cadence.RespondActivityTaskFailedByIDRequest failRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      send_RespondActivityTaskFailedByID(failRequest);
      recv_RespondActivityTaskFailedByID();
    }

    public void send_RespondActivityTaskFailedByID(com.uber.cadence.RespondActivityTaskFailedByIDRequest failRequest) throws org.apache.thrift.TException
    {
      RespondActivityTaskFailedByID_args args = new RespondActivityTaskFailedByID_args();
      args.setFailRequest(failRequest);
      sendBase("RespondActivityTaskFailedByID", args);
    }

    public void recv_RespondActivityTaskFailedByID() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      RespondActivityTaskFailedByID_result result = new RespondActivityTaskFailedByID_result();
      receiveBase(result, "RespondActivityTaskFailedByID");
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      return;
    }

    public void RespondActivityTaskCanceled(com.uber.cadence.RespondActivityTaskCanceledRequest canceledRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      send_RespondActivityTaskCanceled(canceledRequest);
      recv_RespondActivityTaskCanceled();
    }

    public void send_RespondActivityTaskCanceled(com.uber.cadence.RespondActivityTaskCanceledRequest canceledRequest) throws org.apache.thrift.TException
    {
      RespondActivityTaskCanceled_args args = new RespondActivityTaskCanceled_args();
      args.setCanceledRequest(canceledRequest);
      sendBase("RespondActivityTaskCanceled", args);
    }

    public void recv_RespondActivityTaskCanceled() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      RespondActivityTaskCanceled_result result = new RespondActivityTaskCanceled_result();
      receiveBase(result, "RespondActivityTaskCanceled");
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      return;
    }

    public void RespondActivityTaskCanceledByID(com.uber.cadence.RespondActivityTaskCanceledByIDRequest canceledRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      send_RespondActivityTaskCanceledByID(canceledRequest);
      recv_RespondActivityTaskCanceledByID();
    }

    public void send_RespondActivityTaskCanceledByID(com.uber.cadence.RespondActivityTaskCanceledByIDRequest canceledRequest) throws org.apache.thrift.TException
    {
      RespondActivityTaskCanceledByID_args args = new RespondActivityTaskCanceledByID_args();
      args.setCanceledRequest(canceledRequest);
      sendBase("RespondActivityTaskCanceledByID", args);
    }

    public void recv_RespondActivityTaskCanceledByID() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      RespondActivityTaskCanceledByID_result result = new RespondActivityTaskCanceledByID_result();
      receiveBase(result, "RespondActivityTaskCanceledByID");
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      return;
    }

    public void RequestCancelWorkflowExecution(com.uber.cadence.RequestCancelWorkflowExecutionRequest cancelRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.CancellationAlreadyRequestedError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, org.apache.thrift.TException
    {
      send_RequestCancelWorkflowExecution(cancelRequest);
      recv_RequestCancelWorkflowExecution();
    }

    public void send_RequestCancelWorkflowExecution(com.uber.cadence.RequestCancelWorkflowExecutionRequest cancelRequest) throws org.apache.thrift.TException
    {
      RequestCancelWorkflowExecution_args args = new RequestCancelWorkflowExecution_args();
      args.setCancelRequest(cancelRequest);
      sendBase("RequestCancelWorkflowExecution", args);
    }

    public void recv_RequestCancelWorkflowExecution() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.CancellationAlreadyRequestedError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, org.apache.thrift.TException
    {
      RequestCancelWorkflowExecution_result result = new RequestCancelWorkflowExecution_result();
      receiveBase(result, "RequestCancelWorkflowExecution");
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.cancellationAlreadyRequestedError != null) {
        throw result.cancellationAlreadyRequestedError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      return;
    }

    public void SignalWorkflowExecution(com.uber.cadence.SignalWorkflowExecutionRequest signalRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, org.apache.thrift.TException
    {
      send_SignalWorkflowExecution(signalRequest);
      recv_SignalWorkflowExecution();
    }

    public void send_SignalWorkflowExecution(com.uber.cadence.SignalWorkflowExecutionRequest signalRequest) throws org.apache.thrift.TException
    {
      SignalWorkflowExecution_args args = new SignalWorkflowExecution_args();
      args.setSignalRequest(signalRequest);
      sendBase("SignalWorkflowExecution", args);
    }

    public void recv_SignalWorkflowExecution() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, org.apache.thrift.TException
    {
      SignalWorkflowExecution_result result = new SignalWorkflowExecution_result();
      receiveBase(result, "SignalWorkflowExecution");
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      return;
    }

    public com.uber.cadence.StartWorkflowExecutionResponse SignalWithStartWorkflowExecution(com.uber.cadence.SignalWithStartWorkflowExecutionRequest signalWithStartRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.WorkflowExecutionAlreadyStartedError, org.apache.thrift.TException
    {
      send_SignalWithStartWorkflowExecution(signalWithStartRequest);
      return recv_SignalWithStartWorkflowExecution();
    }

    public void send_SignalWithStartWorkflowExecution(com.uber.cadence.SignalWithStartWorkflowExecutionRequest signalWithStartRequest) throws org.apache.thrift.TException
    {
      SignalWithStartWorkflowExecution_args args = new SignalWithStartWorkflowExecution_args();
      args.setSignalWithStartRequest(signalWithStartRequest);
      sendBase("SignalWithStartWorkflowExecution", args);
    }

    public com.uber.cadence.StartWorkflowExecutionResponse recv_SignalWithStartWorkflowExecution() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.WorkflowExecutionAlreadyStartedError, org.apache.thrift.TException
    {
      SignalWithStartWorkflowExecution_result result = new SignalWithStartWorkflowExecution_result();
      receiveBase(result, "SignalWithStartWorkflowExecution");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      if (result.workflowAlreadyStartedError != null) {
        throw result.workflowAlreadyStartedError;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "SignalWithStartWorkflowExecution failed: unknown result");
    }

    public void TerminateWorkflowExecution(com.uber.cadence.TerminateWorkflowExecutionRequest terminateRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, org.apache.thrift.TException
    {
      send_TerminateWorkflowExecution(terminateRequest);
      recv_TerminateWorkflowExecution();
    }

    public void send_TerminateWorkflowExecution(com.uber.cadence.TerminateWorkflowExecutionRequest terminateRequest) throws org.apache.thrift.TException
    {
      TerminateWorkflowExecution_args args = new TerminateWorkflowExecution_args();
      args.setTerminateRequest(terminateRequest);
      sendBase("TerminateWorkflowExecution", args);
    }

    public void recv_TerminateWorkflowExecution() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, org.apache.thrift.TException
    {
      TerminateWorkflowExecution_result result = new TerminateWorkflowExecution_result();
      receiveBase(result, "TerminateWorkflowExecution");
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      return;
    }

    public com.uber.cadence.ListOpenWorkflowExecutionsResponse ListOpenWorkflowExecutions(com.uber.cadence.ListOpenWorkflowExecutionsRequest listRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.LimitExceededError, org.apache.thrift.TException
    {
      send_ListOpenWorkflowExecutions(listRequest);
      return recv_ListOpenWorkflowExecutions();
    }

    public void send_ListOpenWorkflowExecutions(com.uber.cadence.ListOpenWorkflowExecutionsRequest listRequest) throws org.apache.thrift.TException
    {
      ListOpenWorkflowExecutions_args args = new ListOpenWorkflowExecutions_args();
      args.setListRequest(listRequest);
      sendBase("ListOpenWorkflowExecutions", args);
    }

    public com.uber.cadence.ListOpenWorkflowExecutionsResponse recv_ListOpenWorkflowExecutions() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.LimitExceededError, org.apache.thrift.TException
    {
      ListOpenWorkflowExecutions_result result = new ListOpenWorkflowExecutions_result();
      receiveBase(result, "ListOpenWorkflowExecutions");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "ListOpenWorkflowExecutions failed: unknown result");
    }

    public com.uber.cadence.ListClosedWorkflowExecutionsResponse ListClosedWorkflowExecutions(com.uber.cadence.ListClosedWorkflowExecutionsRequest listRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      send_ListClosedWorkflowExecutions(listRequest);
      return recv_ListClosedWorkflowExecutions();
    }

    public void send_ListClosedWorkflowExecutions(com.uber.cadence.ListClosedWorkflowExecutionsRequest listRequest) throws org.apache.thrift.TException
    {
      ListClosedWorkflowExecutions_args args = new ListClosedWorkflowExecutions_args();
      args.setListRequest(listRequest);
      sendBase("ListClosedWorkflowExecutions", args);
    }

    public com.uber.cadence.ListClosedWorkflowExecutionsResponse recv_ListClosedWorkflowExecutions() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      ListClosedWorkflowExecutions_result result = new ListClosedWorkflowExecutions_result();
      receiveBase(result, "ListClosedWorkflowExecutions");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "ListClosedWorkflowExecutions failed: unknown result");
    }

    public void RespondQueryTaskCompleted(com.uber.cadence.RespondQueryTaskCompletedRequest completeRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, org.apache.thrift.TException
    {
      send_RespondQueryTaskCompleted(completeRequest);
      recv_RespondQueryTaskCompleted();
    }

    public void send_RespondQueryTaskCompleted(com.uber.cadence.RespondQueryTaskCompletedRequest completeRequest) throws org.apache.thrift.TException
    {
      RespondQueryTaskCompleted_args args = new RespondQueryTaskCompleted_args();
      args.setCompleteRequest(completeRequest);
      sendBase("RespondQueryTaskCompleted", args);
    }

    public void recv_RespondQueryTaskCompleted() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, org.apache.thrift.TException
    {
      RespondQueryTaskCompleted_result result = new RespondQueryTaskCompleted_result();
      receiveBase(result, "RespondQueryTaskCompleted");
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      return;
    }

    public com.uber.cadence.ResetStickyTaskListResponse ResetStickyTaskList(com.uber.cadence.ResetStickyTaskListRequest resetRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, org.apache.thrift.TException
    {
      send_ResetStickyTaskList(resetRequest);
      return recv_ResetStickyTaskList();
    }

    public void send_ResetStickyTaskList(com.uber.cadence.ResetStickyTaskListRequest resetRequest) throws org.apache.thrift.TException
    {
      ResetStickyTaskList_args args = new ResetStickyTaskList_args();
      args.setResetRequest(resetRequest);
      sendBase("ResetStickyTaskList", args);
    }

    public com.uber.cadence.ResetStickyTaskListResponse recv_ResetStickyTaskList() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, org.apache.thrift.TException
    {
      ResetStickyTaskList_result result = new ResetStickyTaskList_result();
      receiveBase(result, "ResetStickyTaskList");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      if (result.domainNotActiveError != null) {
        throw result.domainNotActiveError;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "ResetStickyTaskList failed: unknown result");
    }

    public com.uber.cadence.QueryWorkflowResponse QueryWorkflow(com.uber.cadence.QueryWorkflowRequest queryRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.QueryFailedError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      send_QueryWorkflow(queryRequest);
      return recv_QueryWorkflow();
    }

    public void send_QueryWorkflow(com.uber.cadence.QueryWorkflowRequest queryRequest) throws org.apache.thrift.TException
    {
      QueryWorkflow_args args = new QueryWorkflow_args();
      args.setQueryRequest(queryRequest);
      sendBase("QueryWorkflow", args);
    }

    public com.uber.cadence.QueryWorkflowResponse recv_QueryWorkflow() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.QueryFailedError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      QueryWorkflow_result result = new QueryWorkflow_result();
      receiveBase(result, "QueryWorkflow");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.queryFailedError != null) {
        throw result.queryFailedError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "QueryWorkflow failed: unknown result");
    }

    public com.uber.cadence.DescribeWorkflowExecutionResponse DescribeWorkflowExecution(com.uber.cadence.DescribeWorkflowExecutionRequest describeRequest) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      send_DescribeWorkflowExecution(describeRequest);
      return recv_DescribeWorkflowExecution();
    }

    public void send_DescribeWorkflowExecution(com.uber.cadence.DescribeWorkflowExecutionRequest describeRequest) throws org.apache.thrift.TException
    {
      DescribeWorkflowExecution_args args = new DescribeWorkflowExecution_args();
      args.setDescribeRequest(describeRequest);
      sendBase("DescribeWorkflowExecution", args);
    }

    public com.uber.cadence.DescribeWorkflowExecutionResponse recv_DescribeWorkflowExecution() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      DescribeWorkflowExecution_result result = new DescribeWorkflowExecution_result();
      receiveBase(result, "DescribeWorkflowExecution");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "DescribeWorkflowExecution failed: unknown result");
    }

    public com.uber.cadence.DescribeTaskListResponse DescribeTaskList(com.uber.cadence.DescribeTaskListRequest request) throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      send_DescribeTaskList(request);
      return recv_DescribeTaskList();
    }

    public void send_DescribeTaskList(com.uber.cadence.DescribeTaskListRequest request) throws org.apache.thrift.TException
    {
      DescribeTaskList_args args = new DescribeTaskList_args();
      args.setRequest(request);
      sendBase("DescribeTaskList", args);
    }

    public com.uber.cadence.DescribeTaskListResponse recv_DescribeTaskList() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, org.apache.thrift.TException
    {
      DescribeTaskList_result result = new DescribeTaskList_result();
      receiveBase(result, "DescribeTaskList");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.badRequestError != null) {
        throw result.badRequestError;
      }
      if (result.internalServiceError != null) {
        throw result.internalServiceError;
      }
      if (result.entityNotExistError != null) {
        throw result.entityNotExistError;
      }
      if (result.limitExceededError != null) {
        throw result.limitExceededError;
      }
      if (result.serviceBusyError != null) {
        throw result.serviceBusyError;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "DescribeTaskList 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 RegisterDomain(com.uber.cadence.RegisterDomainRequest registerRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      RegisterDomain_call method_call = new RegisterDomain_call(registerRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class RegisterDomain_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.RegisterDomainRequest registerRequest;
      public RegisterDomain_call(com.uber.cadence.RegisterDomainRequest registerRequest, 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.registerRequest = registerRequest;
      }

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

      public void getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.DomainAlreadyExistsError, com.uber.cadence.ServiceBusyError, 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);
        (new Client(prot)).recv_RegisterDomain();
      }
    }

    public void DescribeDomain(com.uber.cadence.DescribeDomainRequest describeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      DescribeDomain_call method_call = new DescribeDomain_call(describeRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class DescribeDomain_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.DescribeDomainRequest describeRequest;
      public DescribeDomain_call(com.uber.cadence.DescribeDomainRequest describeRequest, 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.describeRequest = describeRequest;
      }

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

      public com.uber.cadence.DescribeDomainResponse getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, 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_DescribeDomain();
      }
    }

    public void ListDomains(com.uber.cadence.ListDomainsRequest listRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      ListDomains_call method_call = new ListDomains_call(listRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class ListDomains_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.ListDomainsRequest listRequest;
      public ListDomains_call(com.uber.cadence.ListDomainsRequest listRequest, 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.listRequest = listRequest;
      }

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

      public com.uber.cadence.ListDomainsResponse getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, 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_ListDomains();
      }
    }

    public void UpdateDomain(com.uber.cadence.UpdateDomainRequest updateRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      UpdateDomain_call method_call = new UpdateDomain_call(updateRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class UpdateDomain_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.UpdateDomainRequest updateRequest;
      public UpdateDomain_call(com.uber.cadence.UpdateDomainRequest updateRequest, 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.updateRequest = updateRequest;
      }

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

      public com.uber.cadence.UpdateDomainResponse getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, 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_UpdateDomain();
      }
    }

    public void DeprecateDomain(com.uber.cadence.DeprecateDomainRequest deprecateRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      DeprecateDomain_call method_call = new DeprecateDomain_call(deprecateRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class DeprecateDomain_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.DeprecateDomainRequest deprecateRequest;
      public DeprecateDomain_call(com.uber.cadence.DeprecateDomainRequest deprecateRequest, 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.deprecateRequest = deprecateRequest;
      }

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

      public void getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, 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);
        (new Client(prot)).recv_DeprecateDomain();
      }
    }

    public void StartWorkflowExecution(com.uber.cadence.StartWorkflowExecutionRequest startRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      StartWorkflowExecution_call method_call = new StartWorkflowExecution_call(startRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class StartWorkflowExecution_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.StartWorkflowExecutionRequest startRequest;
      public StartWorkflowExecution_call(com.uber.cadence.StartWorkflowExecutionRequest startRequest, 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.startRequest = startRequest;
      }

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

      public com.uber.cadence.StartWorkflowExecutionResponse getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.WorkflowExecutionAlreadyStartedError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.EntityNotExistsError, 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_StartWorkflowExecution();
      }
    }

    public void GetWorkflowExecutionHistory(com.uber.cadence.GetWorkflowExecutionHistoryRequest getRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      GetWorkflowExecutionHistory_call method_call = new GetWorkflowExecutionHistory_call(getRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class GetWorkflowExecutionHistory_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.GetWorkflowExecutionHistoryRequest getRequest;
      public GetWorkflowExecutionHistory_call(com.uber.cadence.GetWorkflowExecutionHistoryRequest getRequest, 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.getRequest = getRequest;
      }

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

      public com.uber.cadence.GetWorkflowExecutionHistoryResponse getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, 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_GetWorkflowExecutionHistory();
      }
    }

    public void PollForDecisionTask(com.uber.cadence.PollForDecisionTaskRequest pollRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      PollForDecisionTask_call method_call = new PollForDecisionTask_call(pollRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class PollForDecisionTask_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.PollForDecisionTaskRequest pollRequest;
      public PollForDecisionTask_call(com.uber.cadence.PollForDecisionTaskRequest pollRequest, 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.pollRequest = pollRequest;
      }

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

      public com.uber.cadence.PollForDecisionTaskResponse getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.ServiceBusyError, com.uber.cadence.LimitExceededError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, 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_PollForDecisionTask();
      }
    }

    public void RespondDecisionTaskCompleted(com.uber.cadence.RespondDecisionTaskCompletedRequest completeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      RespondDecisionTaskCompleted_call method_call = new RespondDecisionTaskCompleted_call(completeRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class RespondDecisionTaskCompleted_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.RespondDecisionTaskCompletedRequest completeRequest;
      public RespondDecisionTaskCompleted_call(com.uber.cadence.RespondDecisionTaskCompletedRequest completeRequest, 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.completeRequest = completeRequest;
      }

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

      public com.uber.cadence.RespondDecisionTaskCompletedResponse getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, 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_RespondDecisionTaskCompleted();
      }
    }

    public void RespondDecisionTaskFailed(com.uber.cadence.RespondDecisionTaskFailedRequest failedRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      RespondDecisionTaskFailed_call method_call = new RespondDecisionTaskFailed_call(failedRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class RespondDecisionTaskFailed_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.RespondDecisionTaskFailedRequest failedRequest;
      public RespondDecisionTaskFailed_call(com.uber.cadence.RespondDecisionTaskFailedRequest failedRequest, 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.failedRequest = failedRequest;
      }

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

      public void getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, 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);
        (new Client(prot)).recv_RespondDecisionTaskFailed();
      }
    }

    public void PollForActivityTask(com.uber.cadence.PollForActivityTaskRequest pollRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      PollForActivityTask_call method_call = new PollForActivityTask_call(pollRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class PollForActivityTask_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.PollForActivityTaskRequest pollRequest;
      public PollForActivityTask_call(com.uber.cadence.PollForActivityTaskRequest pollRequest, 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.pollRequest = pollRequest;
      }

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

      public com.uber.cadence.PollForActivityTaskResponse getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.ServiceBusyError, com.uber.cadence.LimitExceededError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, 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_PollForActivityTask();
      }
    }

    public void RecordActivityTaskHeartbeat(com.uber.cadence.RecordActivityTaskHeartbeatRequest heartbeatRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      RecordActivityTaskHeartbeat_call method_call = new RecordActivityTaskHeartbeat_call(heartbeatRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class RecordActivityTaskHeartbeat_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.RecordActivityTaskHeartbeatRequest heartbeatRequest;
      public RecordActivityTaskHeartbeat_call(com.uber.cadence.RecordActivityTaskHeartbeatRequest heartbeatRequest, 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.heartbeatRequest = heartbeatRequest;
      }

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

      public com.uber.cadence.RecordActivityTaskHeartbeatResponse getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, 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_RecordActivityTaskHeartbeat();
      }
    }

    public void RecordActivityTaskHeartbeatByID(com.uber.cadence.RecordActivityTaskHeartbeatByIDRequest heartbeatRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      RecordActivityTaskHeartbeatByID_call method_call = new RecordActivityTaskHeartbeatByID_call(heartbeatRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class RecordActivityTaskHeartbeatByID_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.RecordActivityTaskHeartbeatByIDRequest heartbeatRequest;
      public RecordActivityTaskHeartbeatByID_call(com.uber.cadence.RecordActivityTaskHeartbeatByIDRequest heartbeatRequest, 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.heartbeatRequest = heartbeatRequest;
      }

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

      public com.uber.cadence.RecordActivityTaskHeartbeatResponse getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, 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_RecordActivityTaskHeartbeatByID();
      }
    }

    public void RespondActivityTaskCompleted(com.uber.cadence.RespondActivityTaskCompletedRequest completeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      RespondActivityTaskCompleted_call method_call = new RespondActivityTaskCompleted_call(completeRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class RespondActivityTaskCompleted_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.RespondActivityTaskCompletedRequest completeRequest;
      public RespondActivityTaskCompleted_call(com.uber.cadence.RespondActivityTaskCompletedRequest completeRequest, 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.completeRequest = completeRequest;
      }

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

      public void getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, 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);
        (new Client(prot)).recv_RespondActivityTaskCompleted();
      }
    }

    public void RespondActivityTaskCompletedByID(com.uber.cadence.RespondActivityTaskCompletedByIDRequest completeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      RespondActivityTaskCompletedByID_call method_call = new RespondActivityTaskCompletedByID_call(completeRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class RespondActivityTaskCompletedByID_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.RespondActivityTaskCompletedByIDRequest completeRequest;
      public RespondActivityTaskCompletedByID_call(com.uber.cadence.RespondActivityTaskCompletedByIDRequest completeRequest, 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.completeRequest = completeRequest;
      }

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

      public void getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, 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);
        (new Client(prot)).recv_RespondActivityTaskCompletedByID();
      }
    }

    public void RespondActivityTaskFailed(com.uber.cadence.RespondActivityTaskFailedRequest failRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      RespondActivityTaskFailed_call method_call = new RespondActivityTaskFailed_call(failRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class RespondActivityTaskFailed_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.RespondActivityTaskFailedRequest failRequest;
      public RespondActivityTaskFailed_call(com.uber.cadence.RespondActivityTaskFailedRequest failRequest, 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.failRequest = failRequest;
      }

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

      public void getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, 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);
        (new Client(prot)).recv_RespondActivityTaskFailed();
      }
    }

    public void RespondActivityTaskFailedByID(com.uber.cadence.RespondActivityTaskFailedByIDRequest failRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      RespondActivityTaskFailedByID_call method_call = new RespondActivityTaskFailedByID_call(failRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class RespondActivityTaskFailedByID_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.RespondActivityTaskFailedByIDRequest failRequest;
      public RespondActivityTaskFailedByID_call(com.uber.cadence.RespondActivityTaskFailedByIDRequest failRequest, 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.failRequest = failRequest;
      }

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

      public void getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, 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);
        (new Client(prot)).recv_RespondActivityTaskFailedByID();
      }
    }

    public void RespondActivityTaskCanceled(com.uber.cadence.RespondActivityTaskCanceledRequest canceledRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      RespondActivityTaskCanceled_call method_call = new RespondActivityTaskCanceled_call(canceledRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class RespondActivityTaskCanceled_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.RespondActivityTaskCanceledRequest canceledRequest;
      public RespondActivityTaskCanceled_call(com.uber.cadence.RespondActivityTaskCanceledRequest canceledRequest, 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.canceledRequest = canceledRequest;
      }

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

      public void getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, 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);
        (new Client(prot)).recv_RespondActivityTaskCanceled();
      }
    }

    public void RespondActivityTaskCanceledByID(com.uber.cadence.RespondActivityTaskCanceledByIDRequest canceledRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      RespondActivityTaskCanceledByID_call method_call = new RespondActivityTaskCanceledByID_call(canceledRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class RespondActivityTaskCanceledByID_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.RespondActivityTaskCanceledByIDRequest canceledRequest;
      public RespondActivityTaskCanceledByID_call(com.uber.cadence.RespondActivityTaskCanceledByIDRequest canceledRequest, 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.canceledRequest = canceledRequest;
      }

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

      public void getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, 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);
        (new Client(prot)).recv_RespondActivityTaskCanceledByID();
      }
    }

    public void RequestCancelWorkflowExecution(com.uber.cadence.RequestCancelWorkflowExecutionRequest cancelRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      RequestCancelWorkflowExecution_call method_call = new RequestCancelWorkflowExecution_call(cancelRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class RequestCancelWorkflowExecution_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.RequestCancelWorkflowExecutionRequest cancelRequest;
      public RequestCancelWorkflowExecution_call(com.uber.cadence.RequestCancelWorkflowExecutionRequest cancelRequest, 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.cancelRequest = cancelRequest;
      }

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

      public void getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.CancellationAlreadyRequestedError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, 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);
        (new Client(prot)).recv_RequestCancelWorkflowExecution();
      }
    }

    public void SignalWorkflowExecution(com.uber.cadence.SignalWorkflowExecutionRequest signalRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      SignalWorkflowExecution_call method_call = new SignalWorkflowExecution_call(signalRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class SignalWorkflowExecution_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.SignalWorkflowExecutionRequest signalRequest;
      public SignalWorkflowExecution_call(com.uber.cadence.SignalWorkflowExecutionRequest signalRequest, 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.signalRequest = signalRequest;
      }

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

      public void getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, 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);
        (new Client(prot)).recv_SignalWorkflowExecution();
      }
    }

    public void SignalWithStartWorkflowExecution(com.uber.cadence.SignalWithStartWorkflowExecutionRequest signalWithStartRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      SignalWithStartWorkflowExecution_call method_call = new SignalWithStartWorkflowExecution_call(signalWithStartRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class SignalWithStartWorkflowExecution_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.SignalWithStartWorkflowExecutionRequest signalWithStartRequest;
      public SignalWithStartWorkflowExecution_call(com.uber.cadence.SignalWithStartWorkflowExecutionRequest signalWithStartRequest, 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.signalWithStartRequest = signalWithStartRequest;
      }

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

      public com.uber.cadence.StartWorkflowExecutionResponse getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, com.uber.cadence.WorkflowExecutionAlreadyStartedError, 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_SignalWithStartWorkflowExecution();
      }
    }

    public void TerminateWorkflowExecution(com.uber.cadence.TerminateWorkflowExecutionRequest terminateRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      TerminateWorkflowExecution_call method_call = new TerminateWorkflowExecution_call(terminateRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class TerminateWorkflowExecution_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.TerminateWorkflowExecutionRequest terminateRequest;
      public TerminateWorkflowExecution_call(com.uber.cadence.TerminateWorkflowExecutionRequest terminateRequest, 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.terminateRequest = terminateRequest;
      }

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

      public void getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, com.uber.cadence.LimitExceededError, 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);
        (new Client(prot)).recv_TerminateWorkflowExecution();
      }
    }

    public void ListOpenWorkflowExecutions(com.uber.cadence.ListOpenWorkflowExecutionsRequest listRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      ListOpenWorkflowExecutions_call method_call = new ListOpenWorkflowExecutions_call(listRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class ListOpenWorkflowExecutions_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.ListOpenWorkflowExecutionsRequest listRequest;
      public ListOpenWorkflowExecutions_call(com.uber.cadence.ListOpenWorkflowExecutionsRequest listRequest, 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.listRequest = listRequest;
      }

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

      public com.uber.cadence.ListOpenWorkflowExecutionsResponse getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, com.uber.cadence.LimitExceededError, 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_ListOpenWorkflowExecutions();
      }
    }

    public void ListClosedWorkflowExecutions(com.uber.cadence.ListClosedWorkflowExecutionsRequest listRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      ListClosedWorkflowExecutions_call method_call = new ListClosedWorkflowExecutions_call(listRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class ListClosedWorkflowExecutions_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.ListClosedWorkflowExecutionsRequest listRequest;
      public ListClosedWorkflowExecutions_call(com.uber.cadence.ListClosedWorkflowExecutionsRequest listRequest, 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.listRequest = listRequest;
      }

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

      public com.uber.cadence.ListClosedWorkflowExecutionsResponse getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.ServiceBusyError, 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_ListClosedWorkflowExecutions();
      }
    }

    public void RespondQueryTaskCompleted(com.uber.cadence.RespondQueryTaskCompletedRequest completeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      RespondQueryTaskCompleted_call method_call = new RespondQueryTaskCompleted_call(completeRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class RespondQueryTaskCompleted_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.RespondQueryTaskCompletedRequest completeRequest;
      public RespondQueryTaskCompleted_call(com.uber.cadence.RespondQueryTaskCompletedRequest completeRequest, 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.completeRequest = completeRequest;
      }

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

      public void getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, 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);
        (new Client(prot)).recv_RespondQueryTaskCompleted();
      }
    }

    public void ResetStickyTaskList(com.uber.cadence.ResetStickyTaskListRequest resetRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      ResetStickyTaskList_call method_call = new ResetStickyTaskList_call(resetRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class ResetStickyTaskList_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.ResetStickyTaskListRequest resetRequest;
      public ResetStickyTaskList_call(com.uber.cadence.ResetStickyTaskListRequest resetRequest, 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.resetRequest = resetRequest;
      }

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

      public com.uber.cadence.ResetStickyTaskListResponse getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, com.uber.cadence.DomainNotActiveError, 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_ResetStickyTaskList();
      }
    }

    public void QueryWorkflow(com.uber.cadence.QueryWorkflowRequest queryRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      QueryWorkflow_call method_call = new QueryWorkflow_call(queryRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class QueryWorkflow_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.QueryWorkflowRequest queryRequest;
      public QueryWorkflow_call(com.uber.cadence.QueryWorkflowRequest queryRequest, 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.queryRequest = queryRequest;
      }

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

      public com.uber.cadence.QueryWorkflowResponse getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.QueryFailedError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, 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_QueryWorkflow();
      }
    }

    public void DescribeWorkflowExecution(com.uber.cadence.DescribeWorkflowExecutionRequest describeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      DescribeWorkflowExecution_call method_call = new DescribeWorkflowExecution_call(describeRequest, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class DescribeWorkflowExecution_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.DescribeWorkflowExecutionRequest describeRequest;
      public DescribeWorkflowExecution_call(com.uber.cadence.DescribeWorkflowExecutionRequest describeRequest, 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.describeRequest = describeRequest;
      }

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

      public com.uber.cadence.DescribeWorkflowExecutionResponse getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, 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_DescribeWorkflowExecution();
      }
    }

    public void DescribeTaskList(com.uber.cadence.DescribeTaskListRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      DescribeTaskList_call method_call = new DescribeTaskList_call(request, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class DescribeTaskList_call extends org.apache.thrift.async.TAsyncMethodCall {
      private com.uber.cadence.DescribeTaskListRequest request;
      public DescribeTaskList_call(com.uber.cadence.DescribeTaskListRequest 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("DescribeTaskList", org.apache.thrift.protocol.TMessageType.CALL, 0));
        DescribeTaskList_args args = new DescribeTaskList_args();
        args.setRequest(request);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public com.uber.cadence.DescribeTaskListResponse getResult() throws com.uber.cadence.BadRequestError, com.uber.cadence.InternalServiceError, com.uber.cadence.EntityNotExistsError, com.uber.cadence.LimitExceededError, com.uber.cadence.ServiceBusyError, 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_DescribeTaskList();
      }
    }

  }

  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("RegisterDomain", new RegisterDomain());
      processMap.put("DescribeDomain", new DescribeDomain());
      processMap.put("ListDomains", new ListDomains());
      processMap.put("UpdateDomain", new UpdateDomain());
      processMap.put("DeprecateDomain", new DeprecateDomain());
      processMap.put("StartWorkflowExecution", new StartWorkflowExecution());
      processMap.put("GetWorkflowExecutionHistory", new GetWorkflowExecutionHistory());
      processMap.put("PollForDecisionTask", new PollForDecisionTask());
      processMap.put("RespondDecisionTaskCompleted", new RespondDecisionTaskCompleted());
      processMap.put("RespondDecisionTaskFailed", new RespondDecisionTaskFailed());
      processMap.put("PollForActivityTask", new PollForActivityTask());
      processMap.put("RecordActivityTaskHeartbeat", new RecordActivityTaskHeartbeat());
      processMap.put("RecordActivityTaskHeartbeatByID", new RecordActivityTaskHeartbeatByID());
      processMap.put("RespondActivityTaskCompleted", new RespondActivityTaskCompleted());
      processMap.put("RespondActivityTaskCompletedByID", new RespondActivityTaskCompletedByID());
      processMap.put("RespondActivityTaskFailed", new RespondActivityTaskFailed());
      processMap.put("RespondActivityTaskFailedByID", new RespondActivityTaskFailedByID());
      processMap.put("RespondActivityTaskCanceled", new RespondActivityTaskCanceled());
      processMap.put("RespondActivityTaskCanceledByID", new RespondActivityTaskCanceledByID());
      processMap.put("RequestCancelWorkflowExecution", new RequestCancelWorkflowExecution());
      processMap.put("SignalWorkflowExecution", new SignalWorkflowExecution());
      processMap.put("SignalWithStartWorkflowExecution", new SignalWithStartWorkflowExecution());
      processMap.put("TerminateWorkflowExecution", new TerminateWorkflowExecution());
      processMap.put("ListOpenWorkflowExecutions", new ListOpenWorkflowExecutions());
      processMap.put("ListClosedWorkflowExecutions", new ListClosedWorkflowExecutions());
      processMap.put("RespondQueryTaskCompleted", new RespondQueryTaskCompleted());
      processMap.put("ResetStickyTaskList", new ResetStickyTaskList());
      processMap.put("QueryWorkflow", new QueryWorkflow());
      processMap.put("DescribeWorkflowExecution", new DescribeWorkflowExecution());
      processMap.put("DescribeTaskList", new DescribeTaskList());
      return processMap;
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public RegisterDomain_result getResult(I iface, RegisterDomain_args args) throws org.apache.thrift.TException {
        RegisterDomain_result result = new RegisterDomain_result();
        try {
          iface.RegisterDomain(args.registerRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.DomainAlreadyExistsError domainExistsError) {
          result.domainExistsError = domainExistsError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public DescribeDomain_result getResult(I iface, DescribeDomain_args args) throws org.apache.thrift.TException {
        DescribeDomain_result result = new DescribeDomain_result();
        try {
          result.success = iface.DescribeDomain(args.describeRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public ListDomains_result getResult(I iface, ListDomains_args args) throws org.apache.thrift.TException {
        ListDomains_result result = new ListDomains_result();
        try {
          result.success = iface.ListDomains(args.listRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public UpdateDomain_result getResult(I iface, UpdateDomain_args args) throws org.apache.thrift.TException {
        UpdateDomain_result result = new UpdateDomain_result();
        try {
          result.success = iface.UpdateDomain(args.updateRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public DeprecateDomain_result getResult(I iface, DeprecateDomain_args args) throws org.apache.thrift.TException {
        DeprecateDomain_result result = new DeprecateDomain_result();
        try {
          iface.DeprecateDomain(args.deprecateRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public StartWorkflowExecution_result getResult(I iface, StartWorkflowExecution_args args) throws org.apache.thrift.TException {
        StartWorkflowExecution_result result = new StartWorkflowExecution_result();
        try {
          result.success = iface.StartWorkflowExecution(args.startRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.WorkflowExecutionAlreadyStartedError sessionAlreadyExistError) {
          result.sessionAlreadyExistError = sessionAlreadyExistError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public GetWorkflowExecutionHistory_result getResult(I iface, GetWorkflowExecutionHistory_args args) throws org.apache.thrift.TException {
        GetWorkflowExecutionHistory_result result = new GetWorkflowExecutionHistory_result();
        try {
          result.success = iface.GetWorkflowExecutionHistory(args.getRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public PollForDecisionTask_result getResult(I iface, PollForDecisionTask_args args) throws org.apache.thrift.TException {
        PollForDecisionTask_result result = new PollForDecisionTask_result();
        try {
          result.success = iface.PollForDecisionTask(args.pollRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public RespondDecisionTaskCompleted_result getResult(I iface, RespondDecisionTaskCompleted_args args) throws org.apache.thrift.TException {
        RespondDecisionTaskCompleted_result result = new RespondDecisionTaskCompleted_result();
        try {
          result.success = iface.RespondDecisionTaskCompleted(args.completeRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public RespondDecisionTaskFailed_result getResult(I iface, RespondDecisionTaskFailed_args args) throws org.apache.thrift.TException {
        RespondDecisionTaskFailed_result result = new RespondDecisionTaskFailed_result();
        try {
          iface.RespondDecisionTaskFailed(args.failedRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public PollForActivityTask_result getResult(I iface, PollForActivityTask_args args) throws org.apache.thrift.TException {
        PollForActivityTask_result result = new PollForActivityTask_result();
        try {
          result.success = iface.PollForActivityTask(args.pollRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public RecordActivityTaskHeartbeat_result getResult(I iface, RecordActivityTaskHeartbeat_args args) throws org.apache.thrift.TException {
        RecordActivityTaskHeartbeat_result result = new RecordActivityTaskHeartbeat_result();
        try {
          result.success = iface.RecordActivityTaskHeartbeat(args.heartbeatRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public RecordActivityTaskHeartbeatByID_result getResult(I iface, RecordActivityTaskHeartbeatByID_args args) throws org.apache.thrift.TException {
        RecordActivityTaskHeartbeatByID_result result = new RecordActivityTaskHeartbeatByID_result();
        try {
          result.success = iface.RecordActivityTaskHeartbeatByID(args.heartbeatRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public RespondActivityTaskCompleted_result getResult(I iface, RespondActivityTaskCompleted_args args) throws org.apache.thrift.TException {
        RespondActivityTaskCompleted_result result = new RespondActivityTaskCompleted_result();
        try {
          iface.RespondActivityTaskCompleted(args.completeRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public RespondActivityTaskCompletedByID_result getResult(I iface, RespondActivityTaskCompletedByID_args args) throws org.apache.thrift.TException {
        RespondActivityTaskCompletedByID_result result = new RespondActivityTaskCompletedByID_result();
        try {
          iface.RespondActivityTaskCompletedByID(args.completeRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public RespondActivityTaskFailed_result getResult(I iface, RespondActivityTaskFailed_args args) throws org.apache.thrift.TException {
        RespondActivityTaskFailed_result result = new RespondActivityTaskFailed_result();
        try {
          iface.RespondActivityTaskFailed(args.failRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public RespondActivityTaskFailedByID_result getResult(I iface, RespondActivityTaskFailedByID_args args) throws org.apache.thrift.TException {
        RespondActivityTaskFailedByID_result result = new RespondActivityTaskFailedByID_result();
        try {
          iface.RespondActivityTaskFailedByID(args.failRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public RespondActivityTaskCanceled_result getResult(I iface, RespondActivityTaskCanceled_args args) throws org.apache.thrift.TException {
        RespondActivityTaskCanceled_result result = new RespondActivityTaskCanceled_result();
        try {
          iface.RespondActivityTaskCanceled(args.canceledRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public RespondActivityTaskCanceledByID_result getResult(I iface, RespondActivityTaskCanceledByID_args args) throws org.apache.thrift.TException {
        RespondActivityTaskCanceledByID_result result = new RespondActivityTaskCanceledByID_result();
        try {
          iface.RespondActivityTaskCanceledByID(args.canceledRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public RequestCancelWorkflowExecution_result getResult(I iface, RequestCancelWorkflowExecution_args args) throws org.apache.thrift.TException {
        RequestCancelWorkflowExecution_result result = new RequestCancelWorkflowExecution_result();
        try {
          iface.RequestCancelWorkflowExecution(args.cancelRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.CancellationAlreadyRequestedError cancellationAlreadyRequestedError) {
          result.cancellationAlreadyRequestedError = cancellationAlreadyRequestedError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public SignalWorkflowExecution_result getResult(I iface, SignalWorkflowExecution_args args) throws org.apache.thrift.TException {
        SignalWorkflowExecution_result result = new SignalWorkflowExecution_result();
        try {
          iface.SignalWorkflowExecution(args.signalRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public SignalWithStartWorkflowExecution_result getResult(I iface, SignalWithStartWorkflowExecution_args args) throws org.apache.thrift.TException {
        SignalWithStartWorkflowExecution_result result = new SignalWithStartWorkflowExecution_result();
        try {
          result.success = iface.SignalWithStartWorkflowExecution(args.signalWithStartRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        } catch (com.uber.cadence.WorkflowExecutionAlreadyStartedError workflowAlreadyStartedError) {
          result.workflowAlreadyStartedError = workflowAlreadyStartedError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public TerminateWorkflowExecution_result getResult(I iface, TerminateWorkflowExecution_args args) throws org.apache.thrift.TException {
        TerminateWorkflowExecution_result result = new TerminateWorkflowExecution_result();
        try {
          iface.TerminateWorkflowExecution(args.terminateRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public ListOpenWorkflowExecutions_result getResult(I iface, ListOpenWorkflowExecutions_args args) throws org.apache.thrift.TException {
        ListOpenWorkflowExecutions_result result = new ListOpenWorkflowExecutions_result();
        try {
          result.success = iface.ListOpenWorkflowExecutions(args.listRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public ListClosedWorkflowExecutions_result getResult(I iface, ListClosedWorkflowExecutions_args args) throws org.apache.thrift.TException {
        ListClosedWorkflowExecutions_result result = new ListClosedWorkflowExecutions_result();
        try {
          result.success = iface.ListClosedWorkflowExecutions(args.listRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public RespondQueryTaskCompleted_result getResult(I iface, RespondQueryTaskCompleted_args args) throws org.apache.thrift.TException {
        RespondQueryTaskCompleted_result result = new RespondQueryTaskCompleted_result();
        try {
          iface.RespondQueryTaskCompleted(args.completeRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public ResetStickyTaskList_result getResult(I iface, ResetStickyTaskList_args args) throws org.apache.thrift.TException {
        ResetStickyTaskList_result result = new ResetStickyTaskList_result();
        try {
          result.success = iface.ResetStickyTaskList(args.resetRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        } catch (com.uber.cadence.DomainNotActiveError domainNotActiveError) {
          result.domainNotActiveError = domainNotActiveError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public QueryWorkflow_result getResult(I iface, QueryWorkflow_args args) throws org.apache.thrift.TException {
        QueryWorkflow_result result = new QueryWorkflow_result();
        try {
          result.success = iface.QueryWorkflow(args.queryRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.QueryFailedError queryFailedError) {
          result.queryFailedError = queryFailedError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public DescribeWorkflowExecution_result getResult(I iface, DescribeWorkflowExecution_args args) throws org.apache.thrift.TException {
        DescribeWorkflowExecution_result result = new DescribeWorkflowExecution_result();
        try {
          result.success = iface.DescribeWorkflowExecution(args.describeRequest);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public DescribeTaskList_result getResult(I iface, DescribeTaskList_args args) throws org.apache.thrift.TException {
        DescribeTaskList_result result = new DescribeTaskList_result();
        try {
          result.success = iface.DescribeTaskList(args.request);
        } catch (com.uber.cadence.BadRequestError badRequestError) {
          result.badRequestError = badRequestError;
        } catch (com.uber.cadence.InternalServiceError internalServiceError) {
          result.internalServiceError = internalServiceError;
        } catch (com.uber.cadence.EntityNotExistsError entityNotExistError) {
          result.entityNotExistError = entityNotExistError;
        } catch (com.uber.cadence.LimitExceededError limitExceededError) {
          result.limitExceededError = limitExceededError;
        } catch (com.uber.cadence.ServiceBusyError serviceBusyError) {
          result.serviceBusyError = serviceBusyError;
        }
        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("RegisterDomain", new RegisterDomain());
      processMap.put("DescribeDomain", new DescribeDomain());
      processMap.put("ListDomains", new ListDomains());
      processMap.put("UpdateDomain", new UpdateDomain());
      processMap.put("DeprecateDomain", new DeprecateDomain());
      processMap.put("StartWorkflowExecution", new StartWorkflowExecution());
      processMap.put("GetWorkflowExecutionHistory", new GetWorkflowExecutionHistory());
      processMap.put("PollForDecisionTask", new PollForDecisionTask());
      processMap.put("RespondDecisionTaskCompleted", new RespondDecisionTaskCompleted());
      processMap.put("RespondDecisionTaskFailed", new RespondDecisionTaskFailed());
      processMap.put("PollForActivityTask", new PollForActivityTask());
      processMap.put("RecordActivityTaskHeartbeat", new RecordActivityTaskHeartbeat());
      processMap.put("RecordActivityTaskHeartbeatByID", new RecordActivityTaskHeartbeatByID());
      processMap.put("RespondActivityTaskCompleted", new RespondActivityTaskCompleted());
      processMap.put("RespondActivityTaskCompletedByID", new RespondActivityTaskCompletedByID());
      processMap.put("RespondActivityTaskFailed", new RespondActivityTaskFailed());
      processMap.put("RespondActivityTaskFailedByID", new RespondActivityTaskFailedByID());
      processMap.put("RespondActivityTaskCanceled", new RespondActivityTaskCanceled());
      processMap.put("RespondActivityTaskCanceledByID", new RespondActivityTaskCanceledByID());
      processMap.put("RequestCancelWorkflowExecution", new RequestCancelWorkflowExecution());
      processMap.put("SignalWorkflowExecution", new SignalWorkflowExecution());
      processMap.put("SignalWithStartWorkflowExecution", new SignalWithStartWorkflowExecution());
      processMap.put("TerminateWorkflowExecution", new TerminateWorkflowExecution());
      processMap.put("ListOpenWorkflowExecutions", new ListOpenWorkflowExecutions());
      processMap.put("ListClosedWorkflowExecutions", new ListClosedWorkflowExecutions());
      processMap.put("RespondQueryTaskCompleted", new RespondQueryTaskCompleted());
      processMap.put("ResetStickyTaskList", new ResetStickyTaskList());
      processMap.put("QueryWorkflow", new QueryWorkflow());
      processMap.put("DescribeWorkflowExecution", new DescribeWorkflowExecution());
      processMap.put("DescribeTaskList", new DescribeTaskList());
      return processMap;
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(Void o) {
            RegisterDomain_result result = new RegisterDomain_result();
            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;
            RegisterDomain_result result = new RegisterDomain_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainAlreadyExistsError) {
                        result.domainExistsError = (com.uber.cadence.DomainAlreadyExistsError) e;
                        result.setDomainExistsErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(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, RegisterDomain_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.RegisterDomain(args.registerRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(com.uber.cadence.DescribeDomainResponse o) {
            DescribeDomain_result result = new DescribeDomain_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;
            DescribeDomain_result result = new DescribeDomain_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(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, DescribeDomain_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.DescribeDomain(args.describeRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(com.uber.cadence.ListDomainsResponse o) {
            ListDomains_result result = new ListDomains_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;
            ListDomains_result result = new ListDomains_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(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, ListDomains_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.ListDomains(args.listRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(com.uber.cadence.UpdateDomainResponse o) {
            UpdateDomain_result result = new UpdateDomain_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;
            UpdateDomain_result result = new UpdateDomain_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(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, UpdateDomain_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.UpdateDomain(args.updateRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(Void o) {
            DeprecateDomain_result result = new DeprecateDomain_result();
            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;
            DeprecateDomain_result result = new DeprecateDomain_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(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, DeprecateDomain_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.DeprecateDomain(args.deprecateRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(com.uber.cadence.StartWorkflowExecutionResponse o) {
            StartWorkflowExecution_result result = new StartWorkflowExecution_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;
            StartWorkflowExecution_result result = new StartWorkflowExecution_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.WorkflowExecutionAlreadyStartedError) {
                        result.sessionAlreadyExistError = (com.uber.cadence.WorkflowExecutionAlreadyStartedError) e;
                        result.setSessionAlreadyExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(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, StartWorkflowExecution_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.StartWorkflowExecution(args.startRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(com.uber.cadence.GetWorkflowExecutionHistoryResponse o) {
            GetWorkflowExecutionHistory_result result = new GetWorkflowExecutionHistory_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;
            GetWorkflowExecutionHistory_result result = new GetWorkflowExecutionHistory_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(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, GetWorkflowExecutionHistory_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.GetWorkflowExecutionHistory(args.getRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(com.uber.cadence.PollForDecisionTaskResponse o) {
            PollForDecisionTask_result result = new PollForDecisionTask_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;
            PollForDecisionTask_result result = new PollForDecisionTask_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(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, PollForDecisionTask_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.PollForDecisionTask(args.pollRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(com.uber.cadence.RespondDecisionTaskCompletedResponse o) {
            RespondDecisionTaskCompleted_result result = new RespondDecisionTaskCompleted_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;
            RespondDecisionTaskCompleted_result result = new RespondDecisionTaskCompleted_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(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, RespondDecisionTaskCompleted_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.RespondDecisionTaskCompleted(args.completeRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(Void o) {
            RespondDecisionTaskFailed_result result = new RespondDecisionTaskFailed_result();
            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;
            RespondDecisionTaskFailed_result result = new RespondDecisionTaskFailed_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(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, RespondDecisionTaskFailed_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.RespondDecisionTaskFailed(args.failedRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(com.uber.cadence.PollForActivityTaskResponse o) {
            PollForActivityTask_result result = new PollForActivityTask_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;
            PollForActivityTask_result result = new PollForActivityTask_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(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, PollForActivityTask_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.PollForActivityTask(args.pollRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(com.uber.cadence.RecordActivityTaskHeartbeatResponse o) {
            RecordActivityTaskHeartbeat_result result = new RecordActivityTaskHeartbeat_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;
            RecordActivityTaskHeartbeat_result result = new RecordActivityTaskHeartbeat_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(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, RecordActivityTaskHeartbeat_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.RecordActivityTaskHeartbeat(args.heartbeatRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(com.uber.cadence.RecordActivityTaskHeartbeatResponse o) {
            RecordActivityTaskHeartbeatByID_result result = new RecordActivityTaskHeartbeatByID_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;
            RecordActivityTaskHeartbeatByID_result result = new RecordActivityTaskHeartbeatByID_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(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, RecordActivityTaskHeartbeatByID_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.RecordActivityTaskHeartbeatByID(args.heartbeatRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(Void o) {
            RespondActivityTaskCompleted_result result = new RespondActivityTaskCompleted_result();
            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;
            RespondActivityTaskCompleted_result result = new RespondActivityTaskCompleted_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(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, RespondActivityTaskCompleted_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.RespondActivityTaskCompleted(args.completeRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(Void o) {
            RespondActivityTaskCompletedByID_result result = new RespondActivityTaskCompletedByID_result();
            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;
            RespondActivityTaskCompletedByID_result result = new RespondActivityTaskCompletedByID_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(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, RespondActivityTaskCompletedByID_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.RespondActivityTaskCompletedByID(args.completeRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(Void o) {
            RespondActivityTaskFailed_result result = new RespondActivityTaskFailed_result();
            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;
            RespondActivityTaskFailed_result result = new RespondActivityTaskFailed_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(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, RespondActivityTaskFailed_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.RespondActivityTaskFailed(args.failRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(Void o) {
            RespondActivityTaskFailedByID_result result = new RespondActivityTaskFailedByID_result();
            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;
            RespondActivityTaskFailedByID_result result = new RespondActivityTaskFailedByID_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(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, RespondActivityTaskFailedByID_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.RespondActivityTaskFailedByID(args.failRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(Void o) {
            RespondActivityTaskCanceled_result result = new RespondActivityTaskCanceled_result();
            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;
            RespondActivityTaskCanceled_result result = new RespondActivityTaskCanceled_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(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, RespondActivityTaskCanceled_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.RespondActivityTaskCanceled(args.canceledRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(Void o) {
            RespondActivityTaskCanceledByID_result result = new RespondActivityTaskCanceledByID_result();
            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;
            RespondActivityTaskCanceledByID_result result = new RespondActivityTaskCanceledByID_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(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, RespondActivityTaskCanceledByID_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.RespondActivityTaskCanceledByID(args.canceledRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(Void o) {
            RequestCancelWorkflowExecution_result result = new RequestCancelWorkflowExecution_result();
            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;
            RequestCancelWorkflowExecution_result result = new RequestCancelWorkflowExecution_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.CancellationAlreadyRequestedError) {
                        result.cancellationAlreadyRequestedError = (com.uber.cadence.CancellationAlreadyRequestedError) e;
                        result.setCancellationAlreadyRequestedErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(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, RequestCancelWorkflowExecution_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.RequestCancelWorkflowExecution(args.cancelRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(Void o) {
            SignalWorkflowExecution_result result = new SignalWorkflowExecution_result();
            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;
            SignalWorkflowExecution_result result = new SignalWorkflowExecution_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(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, SignalWorkflowExecution_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.SignalWorkflowExecution(args.signalRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(com.uber.cadence.StartWorkflowExecutionResponse o) {
            SignalWithStartWorkflowExecution_result result = new SignalWithStartWorkflowExecution_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;
            SignalWithStartWorkflowExecution_result result = new SignalWithStartWorkflowExecution_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.WorkflowExecutionAlreadyStartedError) {
                        result.workflowAlreadyStartedError = (com.uber.cadence.WorkflowExecutionAlreadyStartedError) e;
                        result.setWorkflowAlreadyStartedErrorIsSet(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, SignalWithStartWorkflowExecution_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.SignalWithStartWorkflowExecution(args.signalWithStartRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(Void o) {
            TerminateWorkflowExecution_result result = new TerminateWorkflowExecution_result();
            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;
            TerminateWorkflowExecution_result result = new TerminateWorkflowExecution_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(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, TerminateWorkflowExecution_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.TerminateWorkflowExecution(args.terminateRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(com.uber.cadence.ListOpenWorkflowExecutionsResponse o) {
            ListOpenWorkflowExecutions_result result = new ListOpenWorkflowExecutions_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;
            ListOpenWorkflowExecutions_result result = new ListOpenWorkflowExecutions_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(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, ListOpenWorkflowExecutions_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.ListOpenWorkflowExecutions(args.listRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(com.uber.cadence.ListClosedWorkflowExecutionsResponse o) {
            ListClosedWorkflowExecutions_result result = new ListClosedWorkflowExecutions_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;
            ListClosedWorkflowExecutions_result result = new ListClosedWorkflowExecutions_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(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, ListClosedWorkflowExecutions_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.ListClosedWorkflowExecutions(args.listRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(Void o) {
            RespondQueryTaskCompleted_result result = new RespondQueryTaskCompleted_result();
            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;
            RespondQueryTaskCompleted_result result = new RespondQueryTaskCompleted_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(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, RespondQueryTaskCompleted_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.RespondQueryTaskCompleted(args.completeRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(com.uber.cadence.ResetStickyTaskListResponse o) {
            ResetStickyTaskList_result result = new ResetStickyTaskList_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;
            ResetStickyTaskList_result result = new ResetStickyTaskList_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.DomainNotActiveError) {
                        result.domainNotActiveError = (com.uber.cadence.DomainNotActiveError) e;
                        result.setDomainNotActiveErrorIsSet(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, ResetStickyTaskList_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.ResetStickyTaskList(args.resetRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(com.uber.cadence.QueryWorkflowResponse o) {
            QueryWorkflow_result result = new QueryWorkflow_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;
            QueryWorkflow_result result = new QueryWorkflow_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.QueryFailedError) {
                        result.queryFailedError = (com.uber.cadence.QueryFailedError) e;
                        result.setQueryFailedErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(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, QueryWorkflow_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.QueryWorkflow(args.queryRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(com.uber.cadence.DescribeWorkflowExecutionResponse o) {
            DescribeWorkflowExecution_result result = new DescribeWorkflowExecution_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;
            DescribeWorkflowExecution_result result = new DescribeWorkflowExecution_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(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, DescribeWorkflowExecution_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.DescribeWorkflowExecution(args.describeRequest,resultHandler);
      }
    }

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

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

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(com.uber.cadence.DescribeTaskListResponse o) {
            DescribeTaskList_result result = new DescribeTaskList_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;
            DescribeTaskList_result result = new DescribeTaskList_result();
            if (e instanceof com.uber.cadence.BadRequestError) {
                        result.badRequestError = (com.uber.cadence.BadRequestError) e;
                        result.setBadRequestErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.InternalServiceError) {
                        result.internalServiceError = (com.uber.cadence.InternalServiceError) e;
                        result.setInternalServiceErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.EntityNotExistsError) {
                        result.entityNotExistError = (com.uber.cadence.EntityNotExistsError) e;
                        result.setEntityNotExistErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.LimitExceededError) {
                        result.limitExceededError = (com.uber.cadence.LimitExceededError) e;
                        result.setLimitExceededErrorIsSet(true);
                        msg = result;
            }
            else             if (e instanceof com.uber.cadence.ServiceBusyError) {
                        result.serviceBusyError = (com.uber.cadence.ServiceBusyError) e;
                        result.setServiceBusyErrorIsSet(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, DescribeTaskList_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.DescribeTaskList(args.request,resultHandler);
      }
    }

  }

  public static class RegisterDomain_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("RegisterDomain_args");

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

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

    public com.uber.cadence.RegisterDomainRequest registerRequest; // 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 {
      REGISTER_REQUEST((short)1, "registerRequest");

      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: // REGISTER_REQUEST
            return REGISTER_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.REGISTER_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("registerRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.RegisterDomainRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RegisterDomain_args.class, metaDataMap);
    }

    public RegisterDomain_args() {
    }

    public RegisterDomain_args(
      com.uber.cadence.RegisterDomainRequest registerRequest)
    {
      this();
      this.registerRequest = registerRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public RegisterDomain_args(RegisterDomain_args other) {
      if (other.isSetRegisterRequest()) {
        this.registerRequest = new com.uber.cadence.RegisterDomainRequest(other.registerRequest);
      }
    }

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

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

    public com.uber.cadence.RegisterDomainRequest getRegisterRequest() {
      return this.registerRequest;
    }

    public RegisterDomain_args setRegisterRequest(com.uber.cadence.RegisterDomainRequest registerRequest) {
      this.registerRequest = registerRequest;
      return this;
    }

    public void unsetRegisterRequest() {
      this.registerRequest = null;
    }

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

    public void setRegisterRequestIsSet(boolean value) {
      if (!value) {
        this.registerRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case REGISTER_REQUEST:
        if (value == null) {
          unsetRegisterRequest();
        } else {
          setRegisterRequest((com.uber.cadence.RegisterDomainRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case REGISTER_REQUEST:
        return getRegisterRequest();

      }
      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 REGISTER_REQUEST:
        return isSetRegisterRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_registerRequest = true && this.isSetRegisterRequest();
      boolean that_present_registerRequest = true && that.isSetRegisterRequest();
      if (this_present_registerRequest || that_present_registerRequest) {
        if (!(this_present_registerRequest && that_present_registerRequest))
          return false;
        if (!this.registerRequest.equals(that.registerRequest))
          return false;
      }

      return true;
    }

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

      boolean present_registerRequest = true && (isSetRegisterRequest());
      list.add(present_registerRequest);
      if (present_registerRequest)
        list.add(registerRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetRegisterRequest()).compareTo(other.isSetRegisterRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetRegisterRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.registerRequest, other.registerRequest);
        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("RegisterDomain_args(");
      boolean first = true;

      sb.append("registerRequest:");
      if (this.registerRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.registerRequest);
      }
      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 (registerRequest != null) {
        registerRequest.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 RegisterDomain_argsStandardSchemeFactory implements SchemeFactory {
      public RegisterDomain_argsStandardScheme getScheme() {
        return new RegisterDomain_argsStandardScheme();
      }
    }

    private static class RegisterDomain_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RegisterDomain_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: // REGISTER_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.registerRequest = new com.uber.cadence.RegisterDomainRequest();
                struct.registerRequest.read(iprot);
                struct.setRegisterRequestIsSet(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, RegisterDomain_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class RegisterDomain_argsTupleSchemeFactory implements SchemeFactory {
      public RegisterDomain_argsTupleScheme getScheme() {
        return new RegisterDomain_argsTupleScheme();
      }
    }

    private static class RegisterDomain_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RegisterDomain_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.registerRequest = new com.uber.cadence.RegisterDomainRequest();
          struct.registerRequest.read(iprot);
          struct.setRegisterRequestIsSet(true);
        }
      }
    }

  }

  public static class RegisterDomain_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("RegisterDomain_result");

    private static final org.apache.thrift.protocol.TField BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField DOMAIN_EXISTS_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainExistsError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)4);

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

    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.DomainAlreadyExistsError domainExistsError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // 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 {
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      DOMAIN_EXISTS_ERROR((short)3, "domainExistsError"),
      SERVICE_BUSY_ERROR((short)4, "serviceBusyError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // DOMAIN_EXISTS_ERROR
            return DOMAIN_EXISTS_ERROR;
          case 4: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          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.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_EXISTS_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainExistsError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RegisterDomain_result.class, metaDataMap);
    }

    public RegisterDomain_result() {
    }

    public RegisterDomain_result(
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.DomainAlreadyExistsError domainExistsError,
      com.uber.cadence.ServiceBusyError serviceBusyError)
    {
      this();
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.domainExistsError = domainExistsError;
      this.serviceBusyError = serviceBusyError;
    }

    /**
     * Performs a deep copy on other.
     */
    public RegisterDomain_result(RegisterDomain_result other) {
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetDomainExistsError()) {
        this.domainExistsError = new com.uber.cadence.DomainAlreadyExistsError(other.domainExistsError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
    }

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

    @Override
    public void clear() {
      this.badRequestError = null;
      this.internalServiceError = null;
      this.domainExistsError = null;
      this.serviceBusyError = null;
    }

    public com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public RegisterDomain_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public RegisterDomain_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.DomainAlreadyExistsError getDomainExistsError() {
      return this.domainExistsError;
    }

    public RegisterDomain_result setDomainExistsError(com.uber.cadence.DomainAlreadyExistsError domainExistsError) {
      this.domainExistsError = domainExistsError;
      return this;
    }

    public void unsetDomainExistsError() {
      this.domainExistsError = null;
    }

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

    public void setDomainExistsErrorIsSet(boolean value) {
      if (!value) {
        this.domainExistsError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public RegisterDomain_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case DOMAIN_EXISTS_ERROR:
        if (value == null) {
          unsetDomainExistsError();
        } else {
          setDomainExistsError((com.uber.cadence.DomainAlreadyExistsError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case DOMAIN_EXISTS_ERROR:
        return getDomainExistsError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case DOMAIN_EXISTS_ERROR:
        return isSetDomainExistsError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_domainExistsError = true && this.isSetDomainExistsError();
      boolean that_present_domainExistsError = true && that.isSetDomainExistsError();
      if (this_present_domainExistsError || that_present_domainExistsError) {
        if (!(this_present_domainExistsError && that_present_domainExistsError))
          return false;
        if (!this.domainExistsError.equals(that.domainExistsError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      return true;
    }

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

      boolean present_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_domainExistsError = true && (isSetDomainExistsError());
      list.add(present_domainExistsError);
      if (present_domainExistsError)
        list.add(domainExistsError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainExistsError()).compareTo(other.isSetDomainExistsError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainExistsError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainExistsError, other.domainExistsError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        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("RegisterDomain_result(");
      boolean first = true;

      sb.append("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainExistsError:");
      if (this.domainExistsError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainExistsError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      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 {
        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 RegisterDomain_resultStandardSchemeFactory implements SchemeFactory {
      public RegisterDomain_resultStandardScheme getScheme() {
        return new RegisterDomain_resultStandardScheme();
      }
    }

    private static class RegisterDomain_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RegisterDomain_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 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // DOMAIN_EXISTS_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainExistsError = new com.uber.cadence.DomainAlreadyExistsError();
                struct.domainExistsError.read(iprot);
                struct.setDomainExistsErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(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, RegisterDomain_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainExistsError != null) {
          oprot.writeFieldBegin(DOMAIN_EXISTS_ERROR_FIELD_DESC);
          struct.domainExistsError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class RegisterDomain_resultTupleSchemeFactory implements SchemeFactory {
      public RegisterDomain_resultTupleScheme getScheme() {
        return new RegisterDomain_resultTupleScheme();
      }
    }

    private static class RegisterDomain_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, RegisterDomain_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetBadRequestError()) {
          optionals.set(0);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(1);
        }
        if (struct.isSetDomainExistsError()) {
          optionals.set(2);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(3);
        }
        oprot.writeBitSet(optionals, 4);
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetDomainExistsError()) {
          struct.domainExistsError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RegisterDomain_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(4);
        if (incoming.get(0)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(1)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.domainExistsError = new com.uber.cadence.DomainAlreadyExistsError();
          struct.domainExistsError.read(iprot);
          struct.setDomainExistsErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
      }
    }

  }

  public static class DescribeDomain_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("DescribeDomain_args");

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

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

    public com.uber.cadence.DescribeDomainRequest describeRequest; // 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 {
      DESCRIBE_REQUEST((short)1, "describeRequest");

      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: // DESCRIBE_REQUEST
            return DESCRIBE_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.DESCRIBE_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("describeRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.DescribeDomainRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DescribeDomain_args.class, metaDataMap);
    }

    public DescribeDomain_args() {
    }

    public DescribeDomain_args(
      com.uber.cadence.DescribeDomainRequest describeRequest)
    {
      this();
      this.describeRequest = describeRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public DescribeDomain_args(DescribeDomain_args other) {
      if (other.isSetDescribeRequest()) {
        this.describeRequest = new com.uber.cadence.DescribeDomainRequest(other.describeRequest);
      }
    }

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

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

    public com.uber.cadence.DescribeDomainRequest getDescribeRequest() {
      return this.describeRequest;
    }

    public DescribeDomain_args setDescribeRequest(com.uber.cadence.DescribeDomainRequest describeRequest) {
      this.describeRequest = describeRequest;
      return this;
    }

    public void unsetDescribeRequest() {
      this.describeRequest = null;
    }

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

    public void setDescribeRequestIsSet(boolean value) {
      if (!value) {
        this.describeRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case DESCRIBE_REQUEST:
        if (value == null) {
          unsetDescribeRequest();
        } else {
          setDescribeRequest((com.uber.cadence.DescribeDomainRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case DESCRIBE_REQUEST:
        return getDescribeRequest();

      }
      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 DESCRIBE_REQUEST:
        return isSetDescribeRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_describeRequest = true && this.isSetDescribeRequest();
      boolean that_present_describeRequest = true && that.isSetDescribeRequest();
      if (this_present_describeRequest || that_present_describeRequest) {
        if (!(this_present_describeRequest && that_present_describeRequest))
          return false;
        if (!this.describeRequest.equals(that.describeRequest))
          return false;
      }

      return true;
    }

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

      boolean present_describeRequest = true && (isSetDescribeRequest());
      list.add(present_describeRequest);
      if (present_describeRequest)
        list.add(describeRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetDescribeRequest()).compareTo(other.isSetDescribeRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDescribeRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.describeRequest, other.describeRequest);
        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("DescribeDomain_args(");
      boolean first = true;

      sb.append("describeRequest:");
      if (this.describeRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.describeRequest);
      }
      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 (describeRequest != null) {
        describeRequest.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 DescribeDomain_argsStandardSchemeFactory implements SchemeFactory {
      public DescribeDomain_argsStandardScheme getScheme() {
        return new DescribeDomain_argsStandardScheme();
      }
    }

    private static class DescribeDomain_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, DescribeDomain_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: // DESCRIBE_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.describeRequest = new com.uber.cadence.DescribeDomainRequest();
                struct.describeRequest.read(iprot);
                struct.setDescribeRequestIsSet(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, DescribeDomain_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class DescribeDomain_argsTupleSchemeFactory implements SchemeFactory {
      public DescribeDomain_argsTupleScheme getScheme() {
        return new DescribeDomain_argsTupleScheme();
      }
    }

    private static class DescribeDomain_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, DescribeDomain_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.describeRequest = new com.uber.cadence.DescribeDomainRequest();
          struct.describeRequest.read(iprot);
          struct.setDescribeRequestIsSet(true);
        }
      }
    }

  }

  public static class DescribeDomain_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("DescribeDomain_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 BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)4);

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

    public com.uber.cadence.DescribeDomainResponse success; // required
    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // 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"),
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      SERVICE_BUSY_ERROR((short)4, "serviceBusyError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          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, com.uber.cadence.DescribeDomainResponse.class)));
      tmpMap.put(_Fields.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DescribeDomain_result.class, metaDataMap);
    }

    public DescribeDomain_result() {
    }

    public DescribeDomain_result(
      com.uber.cadence.DescribeDomainResponse success,
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.ServiceBusyError serviceBusyError)
    {
      this();
      this.success = success;
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.serviceBusyError = serviceBusyError;
    }

    /**
     * Performs a deep copy on other.
     */
    public DescribeDomain_result(DescribeDomain_result other) {
      if (other.isSetSuccess()) {
        this.success = new com.uber.cadence.DescribeDomainResponse(other.success);
      }
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.serviceBusyError = null;
    }

    public com.uber.cadence.DescribeDomainResponse getSuccess() {
      return this.success;
    }

    public DescribeDomain_result setSuccess(com.uber.cadence.DescribeDomainResponse 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 com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public DescribeDomain_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public DescribeDomain_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public DescribeDomain_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public DescribeDomain_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

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

      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      }
    }

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

      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(DescribeDomain_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_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          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_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      return list.hashCode();
    }

    @Override
    public int compareTo(DescribeDomain_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(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        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("DescribeDomain_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("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      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 DescribeDomain_resultStandardSchemeFactory implements SchemeFactory {
      public DescribeDomain_resultStandardScheme getScheme() {
        return new DescribeDomain_resultStandardScheme();
      }
    }

    private static class DescribeDomain_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, DescribeDomain_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 com.uber.cadence.DescribeDomainResponse();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(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, DescribeDomain_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.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class DescribeDomain_resultTupleSchemeFactory implements SchemeFactory {
      public DescribeDomain_resultTupleScheme getScheme() {
        return new DescribeDomain_resultTupleScheme();
      }
    }

    private static class DescribeDomain_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, DescribeDomain_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetBadRequestError()) {
          optionals.set(1);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(2);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(3);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(4);
        }
        oprot.writeBitSet(optionals, 5);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, DescribeDomain_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(5);
        if (incoming.get(0)) {
          struct.success = new com.uber.cadence.DescribeDomainResponse();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
      }
    }

  }

  public static class ListDomains_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("ListDomains_args");

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

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

    public com.uber.cadence.ListDomainsRequest listRequest; // 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 {
      LIST_REQUEST((short)1, "listRequest");

      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: // LIST_REQUEST
            return LIST_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.LIST_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("listRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.ListDomainsRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ListDomains_args.class, metaDataMap);
    }

    public ListDomains_args() {
    }

    public ListDomains_args(
      com.uber.cadence.ListDomainsRequest listRequest)
    {
      this();
      this.listRequest = listRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public ListDomains_args(ListDomains_args other) {
      if (other.isSetListRequest()) {
        this.listRequest = new com.uber.cadence.ListDomainsRequest(other.listRequest);
      }
    }

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

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

    public com.uber.cadence.ListDomainsRequest getListRequest() {
      return this.listRequest;
    }

    public ListDomains_args setListRequest(com.uber.cadence.ListDomainsRequest listRequest) {
      this.listRequest = listRequest;
      return this;
    }

    public void unsetListRequest() {
      this.listRequest = null;
    }

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

    public void setListRequestIsSet(boolean value) {
      if (!value) {
        this.listRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case LIST_REQUEST:
        if (value == null) {
          unsetListRequest();
        } else {
          setListRequest((com.uber.cadence.ListDomainsRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case LIST_REQUEST:
        return getListRequest();

      }
      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 LIST_REQUEST:
        return isSetListRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_listRequest = true && this.isSetListRequest();
      boolean that_present_listRequest = true && that.isSetListRequest();
      if (this_present_listRequest || that_present_listRequest) {
        if (!(this_present_listRequest && that_present_listRequest))
          return false;
        if (!this.listRequest.equals(that.listRequest))
          return false;
      }

      return true;
    }

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

      boolean present_listRequest = true && (isSetListRequest());
      list.add(present_listRequest);
      if (present_listRequest)
        list.add(listRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetListRequest()).compareTo(other.isSetListRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetListRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.listRequest, other.listRequest);
        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("ListDomains_args(");
      boolean first = true;

      sb.append("listRequest:");
      if (this.listRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.listRequest);
      }
      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 (listRequest != null) {
        listRequest.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 ListDomains_argsStandardSchemeFactory implements SchemeFactory {
      public ListDomains_argsStandardScheme getScheme() {
        return new ListDomains_argsStandardScheme();
      }
    }

    private static class ListDomains_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, ListDomains_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: // LIST_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.listRequest = new com.uber.cadence.ListDomainsRequest();
                struct.listRequest.read(iprot);
                struct.setListRequestIsSet(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, ListDomains_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class ListDomains_argsTupleSchemeFactory implements SchemeFactory {
      public ListDomains_argsTupleScheme getScheme() {
        return new ListDomains_argsTupleScheme();
      }
    }

    private static class ListDomains_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, ListDomains_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.listRequest = new com.uber.cadence.ListDomainsRequest();
          struct.listRequest.read(iprot);
          struct.setListRequestIsSet(true);
        }
      }
    }

  }

  public static class ListDomains_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("ListDomains_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 BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)4);

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

    public com.uber.cadence.ListDomainsResponse success; // required
    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // 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"),
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      SERVICE_BUSY_ERROR((short)4, "serviceBusyError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          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, com.uber.cadence.ListDomainsResponse.class)));
      tmpMap.put(_Fields.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ListDomains_result.class, metaDataMap);
    }

    public ListDomains_result() {
    }

    public ListDomains_result(
      com.uber.cadence.ListDomainsResponse success,
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.ServiceBusyError serviceBusyError)
    {
      this();
      this.success = success;
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.serviceBusyError = serviceBusyError;
    }

    /**
     * Performs a deep copy on other.
     */
    public ListDomains_result(ListDomains_result other) {
      if (other.isSetSuccess()) {
        this.success = new com.uber.cadence.ListDomainsResponse(other.success);
      }
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.serviceBusyError = null;
    }

    public com.uber.cadence.ListDomainsResponse getSuccess() {
      return this.success;
    }

    public ListDomains_result setSuccess(com.uber.cadence.ListDomainsResponse 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 com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public ListDomains_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public ListDomains_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public ListDomains_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public ListDomains_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

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

      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      }
    }

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

      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(ListDomains_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_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          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_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      return list.hashCode();
    }

    @Override
    public int compareTo(ListDomains_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(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        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("ListDomains_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("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      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 ListDomains_resultStandardSchemeFactory implements SchemeFactory {
      public ListDomains_resultStandardScheme getScheme() {
        return new ListDomains_resultStandardScheme();
      }
    }

    private static class ListDomains_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, ListDomains_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 com.uber.cadence.ListDomainsResponse();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(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, ListDomains_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.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class ListDomains_resultTupleSchemeFactory implements SchemeFactory {
      public ListDomains_resultTupleScheme getScheme() {
        return new ListDomains_resultTupleScheme();
      }
    }

    private static class ListDomains_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, ListDomains_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetBadRequestError()) {
          optionals.set(1);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(2);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(3);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(4);
        }
        oprot.writeBitSet(optionals, 5);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, ListDomains_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(5);
        if (incoming.get(0)) {
          struct.success = new com.uber.cadence.ListDomainsResponse();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
      }
    }

  }

  public static class UpdateDomain_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("UpdateDomain_args");

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

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

    public com.uber.cadence.UpdateDomainRequest updateRequest; // 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 {
      UPDATE_REQUEST((short)1, "updateRequest");

      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: // UPDATE_REQUEST
            return UPDATE_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.UPDATE_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("updateRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.UpdateDomainRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UpdateDomain_args.class, metaDataMap);
    }

    public UpdateDomain_args() {
    }

    public UpdateDomain_args(
      com.uber.cadence.UpdateDomainRequest updateRequest)
    {
      this();
      this.updateRequest = updateRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public UpdateDomain_args(UpdateDomain_args other) {
      if (other.isSetUpdateRequest()) {
        this.updateRequest = new com.uber.cadence.UpdateDomainRequest(other.updateRequest);
      }
    }

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

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

    public com.uber.cadence.UpdateDomainRequest getUpdateRequest() {
      return this.updateRequest;
    }

    public UpdateDomain_args setUpdateRequest(com.uber.cadence.UpdateDomainRequest updateRequest) {
      this.updateRequest = updateRequest;
      return this;
    }

    public void unsetUpdateRequest() {
      this.updateRequest = null;
    }

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

    public void setUpdateRequestIsSet(boolean value) {
      if (!value) {
        this.updateRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case UPDATE_REQUEST:
        if (value == null) {
          unsetUpdateRequest();
        } else {
          setUpdateRequest((com.uber.cadence.UpdateDomainRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case UPDATE_REQUEST:
        return getUpdateRequest();

      }
      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 UPDATE_REQUEST:
        return isSetUpdateRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_updateRequest = true && this.isSetUpdateRequest();
      boolean that_present_updateRequest = true && that.isSetUpdateRequest();
      if (this_present_updateRequest || that_present_updateRequest) {
        if (!(this_present_updateRequest && that_present_updateRequest))
          return false;
        if (!this.updateRequest.equals(that.updateRequest))
          return false;
      }

      return true;
    }

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

      boolean present_updateRequest = true && (isSetUpdateRequest());
      list.add(present_updateRequest);
      if (present_updateRequest)
        list.add(updateRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetUpdateRequest()).compareTo(other.isSetUpdateRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetUpdateRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updateRequest, other.updateRequest);
        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("UpdateDomain_args(");
      boolean first = true;

      sb.append("updateRequest:");
      if (this.updateRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.updateRequest);
      }
      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 (updateRequest != null) {
        updateRequest.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 UpdateDomain_argsStandardSchemeFactory implements SchemeFactory {
      public UpdateDomain_argsStandardScheme getScheme() {
        return new UpdateDomain_argsStandardScheme();
      }
    }

    private static class UpdateDomain_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, UpdateDomain_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: // UPDATE_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.updateRequest = new com.uber.cadence.UpdateDomainRequest();
                struct.updateRequest.read(iprot);
                struct.setUpdateRequestIsSet(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, UpdateDomain_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class UpdateDomain_argsTupleSchemeFactory implements SchemeFactory {
      public UpdateDomain_argsTupleScheme getScheme() {
        return new UpdateDomain_argsTupleScheme();
      }
    }

    private static class UpdateDomain_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, UpdateDomain_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.updateRequest = new com.uber.cadence.UpdateDomainRequest();
          struct.updateRequest.read(iprot);
          struct.setUpdateRequestIsSet(true);
        }
      }
    }

  }

  public static class UpdateDomain_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("UpdateDomain_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 BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)5);

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

    public com.uber.cadence.UpdateDomainResponse success; // required
    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // 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"),
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      SERVICE_BUSY_ERROR((short)4, "serviceBusyError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)5, "domainNotActiveError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          case 5: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          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, com.uber.cadence.UpdateDomainResponse.class)));
      tmpMap.put(_Fields.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UpdateDomain_result.class, metaDataMap);
    }

    public UpdateDomain_result() {
    }

    public UpdateDomain_result(
      com.uber.cadence.UpdateDomainResponse success,
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.ServiceBusyError serviceBusyError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError)
    {
      this();
      this.success = success;
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.serviceBusyError = serviceBusyError;
      this.domainNotActiveError = domainNotActiveError;
    }

    /**
     * Performs a deep copy on other.
     */
    public UpdateDomain_result(UpdateDomain_result other) {
      if (other.isSetSuccess()) {
        this.success = new com.uber.cadence.UpdateDomainResponse(other.success);
      }
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.serviceBusyError = null;
      this.domainNotActiveError = null;
    }

    public com.uber.cadence.UpdateDomainResponse getSuccess() {
      return this.success;
    }

    public UpdateDomain_result setSuccess(com.uber.cadence.UpdateDomainResponse 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 com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public UpdateDomain_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public UpdateDomain_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public UpdateDomain_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public UpdateDomain_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public UpdateDomain_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

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

      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      }
    }

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

      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(UpdateDomain_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_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          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_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      return list.hashCode();
    }

    @Override
    public int compareTo(UpdateDomain_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(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        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("UpdateDomain_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("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      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 UpdateDomain_resultStandardSchemeFactory implements SchemeFactory {
      public UpdateDomain_resultStandardScheme getScheme() {
        return new UpdateDomain_resultStandardScheme();
      }
    }

    private static class UpdateDomain_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, UpdateDomain_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 com.uber.cadence.UpdateDomainResponse();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(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, UpdateDomain_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.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class UpdateDomain_resultTupleSchemeFactory implements SchemeFactory {
      public UpdateDomain_resultTupleScheme getScheme() {
        return new UpdateDomain_resultTupleScheme();
      }
    }

    private static class UpdateDomain_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, UpdateDomain_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetBadRequestError()) {
          optionals.set(1);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(2);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(3);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(4);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(5);
        }
        oprot.writeBitSet(optionals, 6);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, UpdateDomain_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(6);
        if (incoming.get(0)) {
          struct.success = new com.uber.cadence.UpdateDomainResponse();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
      }
    }

  }

  public static class DeprecateDomain_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("DeprecateDomain_args");

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

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

    public com.uber.cadence.DeprecateDomainRequest deprecateRequest; // 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 {
      DEPRECATE_REQUEST((short)1, "deprecateRequest");

      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: // DEPRECATE_REQUEST
            return DEPRECATE_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.DEPRECATE_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("deprecateRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.DeprecateDomainRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DeprecateDomain_args.class, metaDataMap);
    }

    public DeprecateDomain_args() {
    }

    public DeprecateDomain_args(
      com.uber.cadence.DeprecateDomainRequest deprecateRequest)
    {
      this();
      this.deprecateRequest = deprecateRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public DeprecateDomain_args(DeprecateDomain_args other) {
      if (other.isSetDeprecateRequest()) {
        this.deprecateRequest = new com.uber.cadence.DeprecateDomainRequest(other.deprecateRequest);
      }
    }

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

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

    public com.uber.cadence.DeprecateDomainRequest getDeprecateRequest() {
      return this.deprecateRequest;
    }

    public DeprecateDomain_args setDeprecateRequest(com.uber.cadence.DeprecateDomainRequest deprecateRequest) {
      this.deprecateRequest = deprecateRequest;
      return this;
    }

    public void unsetDeprecateRequest() {
      this.deprecateRequest = null;
    }

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

    public void setDeprecateRequestIsSet(boolean value) {
      if (!value) {
        this.deprecateRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case DEPRECATE_REQUEST:
        if (value == null) {
          unsetDeprecateRequest();
        } else {
          setDeprecateRequest((com.uber.cadence.DeprecateDomainRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case DEPRECATE_REQUEST:
        return getDeprecateRequest();

      }
      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 DEPRECATE_REQUEST:
        return isSetDeprecateRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_deprecateRequest = true && this.isSetDeprecateRequest();
      boolean that_present_deprecateRequest = true && that.isSetDeprecateRequest();
      if (this_present_deprecateRequest || that_present_deprecateRequest) {
        if (!(this_present_deprecateRequest && that_present_deprecateRequest))
          return false;
        if (!this.deprecateRequest.equals(that.deprecateRequest))
          return false;
      }

      return true;
    }

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

      boolean present_deprecateRequest = true && (isSetDeprecateRequest());
      list.add(present_deprecateRequest);
      if (present_deprecateRequest)
        list.add(deprecateRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetDeprecateRequest()).compareTo(other.isSetDeprecateRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDeprecateRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deprecateRequest, other.deprecateRequest);
        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("DeprecateDomain_args(");
      boolean first = true;

      sb.append("deprecateRequest:");
      if (this.deprecateRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.deprecateRequest);
      }
      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 (deprecateRequest != null) {
        deprecateRequest.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 DeprecateDomain_argsStandardSchemeFactory implements SchemeFactory {
      public DeprecateDomain_argsStandardScheme getScheme() {
        return new DeprecateDomain_argsStandardScheme();
      }
    }

    private static class DeprecateDomain_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, DeprecateDomain_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: // DEPRECATE_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.deprecateRequest = new com.uber.cadence.DeprecateDomainRequest();
                struct.deprecateRequest.read(iprot);
                struct.setDeprecateRequestIsSet(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, DeprecateDomain_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class DeprecateDomain_argsTupleSchemeFactory implements SchemeFactory {
      public DeprecateDomain_argsTupleScheme getScheme() {
        return new DeprecateDomain_argsTupleScheme();
      }
    }

    private static class DeprecateDomain_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, DeprecateDomain_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.deprecateRequest = new com.uber.cadence.DeprecateDomainRequest();
          struct.deprecateRequest.read(iprot);
          struct.setDeprecateRequestIsSet(true);
        }
      }
    }

  }

  public static class DeprecateDomain_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("DeprecateDomain_result");

    private static final org.apache.thrift.protocol.TField BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)5);

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

    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // 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 {
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      SERVICE_BUSY_ERROR((short)4, "serviceBusyError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)5, "domainNotActiveError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          case 5: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          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.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DeprecateDomain_result.class, metaDataMap);
    }

    public DeprecateDomain_result() {
    }

    public DeprecateDomain_result(
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.ServiceBusyError serviceBusyError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError)
    {
      this();
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.serviceBusyError = serviceBusyError;
      this.domainNotActiveError = domainNotActiveError;
    }

    /**
     * Performs a deep copy on other.
     */
    public DeprecateDomain_result(DeprecateDomain_result other) {
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
    }

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

    @Override
    public void clear() {
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.serviceBusyError = null;
      this.domainNotActiveError = null;
    }

    public com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public DeprecateDomain_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public DeprecateDomain_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public DeprecateDomain_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public DeprecateDomain_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public DeprecateDomain_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          return false;
      }

      return true;
    }

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

      boolean present_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        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("DeprecateDomain_result(");
      boolean first = true;

      sb.append("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      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 {
        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 DeprecateDomain_resultStandardSchemeFactory implements SchemeFactory {
      public DeprecateDomain_resultStandardScheme getScheme() {
        return new DeprecateDomain_resultStandardScheme();
      }
    }

    private static class DeprecateDomain_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, DeprecateDomain_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 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(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, DeprecateDomain_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class DeprecateDomain_resultTupleSchemeFactory implements SchemeFactory {
      public DeprecateDomain_resultTupleScheme getScheme() {
        return new DeprecateDomain_resultTupleScheme();
      }
    }

    private static class DeprecateDomain_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, DeprecateDomain_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetBadRequestError()) {
          optionals.set(0);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(1);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(2);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(3);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(4);
        }
        oprot.writeBitSet(optionals, 5);
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, DeprecateDomain_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(5);
        if (incoming.get(0)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(1)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
      }
    }

  }

  public static class StartWorkflowExecution_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("StartWorkflowExecution_args");

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

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

    public com.uber.cadence.StartWorkflowExecutionRequest startRequest; // 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 {
      START_REQUEST((short)1, "startRequest");

      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: // START_REQUEST
            return START_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.START_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("startRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.StartWorkflowExecutionRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StartWorkflowExecution_args.class, metaDataMap);
    }

    public StartWorkflowExecution_args() {
    }

    public StartWorkflowExecution_args(
      com.uber.cadence.StartWorkflowExecutionRequest startRequest)
    {
      this();
      this.startRequest = startRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public StartWorkflowExecution_args(StartWorkflowExecution_args other) {
      if (other.isSetStartRequest()) {
        this.startRequest = new com.uber.cadence.StartWorkflowExecutionRequest(other.startRequest);
      }
    }

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

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

    public com.uber.cadence.StartWorkflowExecutionRequest getStartRequest() {
      return this.startRequest;
    }

    public StartWorkflowExecution_args setStartRequest(com.uber.cadence.StartWorkflowExecutionRequest startRequest) {
      this.startRequest = startRequest;
      return this;
    }

    public void unsetStartRequest() {
      this.startRequest = null;
    }

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

    public void setStartRequestIsSet(boolean value) {
      if (!value) {
        this.startRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case START_REQUEST:
        if (value == null) {
          unsetStartRequest();
        } else {
          setStartRequest((com.uber.cadence.StartWorkflowExecutionRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case START_REQUEST:
        return getStartRequest();

      }
      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 START_REQUEST:
        return isSetStartRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_startRequest = true && this.isSetStartRequest();
      boolean that_present_startRequest = true && that.isSetStartRequest();
      if (this_present_startRequest || that_present_startRequest) {
        if (!(this_present_startRequest && that_present_startRequest))
          return false;
        if (!this.startRequest.equals(that.startRequest))
          return false;
      }

      return true;
    }

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

      boolean present_startRequest = true && (isSetStartRequest());
      list.add(present_startRequest);
      if (present_startRequest)
        list.add(startRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetStartRequest()).compareTo(other.isSetStartRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStartRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRequest, other.startRequest);
        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("StartWorkflowExecution_args(");
      boolean first = true;

      sb.append("startRequest:");
      if (this.startRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.startRequest);
      }
      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 (startRequest != null) {
        startRequest.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 StartWorkflowExecution_argsStandardSchemeFactory implements SchemeFactory {
      public StartWorkflowExecution_argsStandardScheme getScheme() {
        return new StartWorkflowExecution_argsStandardScheme();
      }
    }

    private static class StartWorkflowExecution_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, StartWorkflowExecution_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: // START_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.startRequest = new com.uber.cadence.StartWorkflowExecutionRequest();
                struct.startRequest.read(iprot);
                struct.setStartRequestIsSet(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, StartWorkflowExecution_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class StartWorkflowExecution_argsTupleSchemeFactory implements SchemeFactory {
      public StartWorkflowExecution_argsTupleScheme getScheme() {
        return new StartWorkflowExecution_argsTupleScheme();
      }
    }

    private static class StartWorkflowExecution_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, StartWorkflowExecution_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.startRequest = new com.uber.cadence.StartWorkflowExecutionRequest();
          struct.startRequest.read(iprot);
          struct.setStartRequestIsSet(true);
        }
      }
    }

  }

  public static class StartWorkflowExecution_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("StartWorkflowExecution_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 BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField SESSION_ALREADY_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionAlreadyExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)6);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)7);

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

    public com.uber.cadence.StartWorkflowExecutionResponse success; // required
    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.WorkflowExecutionAlreadyStartedError sessionAlreadyExistError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // 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"),
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      SESSION_ALREADY_EXIST_ERROR((short)3, "sessionAlreadyExistError"),
      SERVICE_BUSY_ERROR((short)4, "serviceBusyError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)5, "domainNotActiveError"),
      LIMIT_EXCEEDED_ERROR((short)6, "limitExceededError"),
      ENTITY_NOT_EXIST_ERROR((short)7, "entityNotExistError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // SESSION_ALREADY_EXIST_ERROR
            return SESSION_ALREADY_EXIST_ERROR;
          case 4: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          case 5: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          case 6: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          case 7: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          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, com.uber.cadence.StartWorkflowExecutionResponse.class)));
      tmpMap.put(_Fields.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SESSION_ALREADY_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("sessionAlreadyExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StartWorkflowExecution_result.class, metaDataMap);
    }

    public StartWorkflowExecution_result() {
    }

    public StartWorkflowExecution_result(
      com.uber.cadence.StartWorkflowExecutionResponse success,
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.WorkflowExecutionAlreadyStartedError sessionAlreadyExistError,
      com.uber.cadence.ServiceBusyError serviceBusyError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError,
      com.uber.cadence.LimitExceededError limitExceededError,
      com.uber.cadence.EntityNotExistsError entityNotExistError)
    {
      this();
      this.success = success;
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.sessionAlreadyExistError = sessionAlreadyExistError;
      this.serviceBusyError = serviceBusyError;
      this.domainNotActiveError = domainNotActiveError;
      this.limitExceededError = limitExceededError;
      this.entityNotExistError = entityNotExistError;
    }

    /**
     * Performs a deep copy on other.
     */
    public StartWorkflowExecution_result(StartWorkflowExecution_result other) {
      if (other.isSetSuccess()) {
        this.success = new com.uber.cadence.StartWorkflowExecutionResponse(other.success);
      }
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetSessionAlreadyExistError()) {
        this.sessionAlreadyExistError = new com.uber.cadence.WorkflowExecutionAlreadyStartedError(other.sessionAlreadyExistError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.badRequestError = null;
      this.internalServiceError = null;
      this.sessionAlreadyExistError = null;
      this.serviceBusyError = null;
      this.domainNotActiveError = null;
      this.limitExceededError = null;
      this.entityNotExistError = null;
    }

    public com.uber.cadence.StartWorkflowExecutionResponse getSuccess() {
      return this.success;
    }

    public StartWorkflowExecution_result setSuccess(com.uber.cadence.StartWorkflowExecutionResponse 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 com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public StartWorkflowExecution_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public StartWorkflowExecution_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.WorkflowExecutionAlreadyStartedError getSessionAlreadyExistError() {
      return this.sessionAlreadyExistError;
    }

    public StartWorkflowExecution_result setSessionAlreadyExistError(com.uber.cadence.WorkflowExecutionAlreadyStartedError sessionAlreadyExistError) {
      this.sessionAlreadyExistError = sessionAlreadyExistError;
      return this;
    }

    public void unsetSessionAlreadyExistError() {
      this.sessionAlreadyExistError = null;
    }

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

    public void setSessionAlreadyExistErrorIsSet(boolean value) {
      if (!value) {
        this.sessionAlreadyExistError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public StartWorkflowExecution_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public StartWorkflowExecution_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public StartWorkflowExecution_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public StartWorkflowExecution_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

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

      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case SESSION_ALREADY_EXIST_ERROR:
        if (value == null) {
          unsetSessionAlreadyExistError();
        } else {
          setSessionAlreadyExistError((com.uber.cadence.WorkflowExecutionAlreadyStartedError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      }
    }

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

      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case SESSION_ALREADY_EXIST_ERROR:
        return getSessionAlreadyExistError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case SESSION_ALREADY_EXIST_ERROR:
        return isSetSessionAlreadyExistError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(StartWorkflowExecution_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_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_sessionAlreadyExistError = true && this.isSetSessionAlreadyExistError();
      boolean that_present_sessionAlreadyExistError = true && that.isSetSessionAlreadyExistError();
      if (this_present_sessionAlreadyExistError || that_present_sessionAlreadyExistError) {
        if (!(this_present_sessionAlreadyExistError && that_present_sessionAlreadyExistError))
          return false;
        if (!this.sessionAlreadyExistError.equals(that.sessionAlreadyExistError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          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_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_sessionAlreadyExistError = true && (isSetSessionAlreadyExistError());
      list.add(present_sessionAlreadyExistError);
      if (present_sessionAlreadyExistError)
        list.add(sessionAlreadyExistError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      return list.hashCode();
    }

    @Override
    public int compareTo(StartWorkflowExecution_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(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetSessionAlreadyExistError()).compareTo(other.isSetSessionAlreadyExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSessionAlreadyExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionAlreadyExistError, other.sessionAlreadyExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        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("StartWorkflowExecution_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("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("sessionAlreadyExistError:");
      if (this.sessionAlreadyExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.sessionAlreadyExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      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 StartWorkflowExecution_resultStandardSchemeFactory implements SchemeFactory {
      public StartWorkflowExecution_resultStandardScheme getScheme() {
        return new StartWorkflowExecution_resultStandardScheme();
      }
    }

    private static class StartWorkflowExecution_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, StartWorkflowExecution_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 com.uber.cadence.StartWorkflowExecutionResponse();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // SESSION_ALREADY_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.sessionAlreadyExistError = new com.uber.cadence.WorkflowExecutionAlreadyStartedError();
                struct.sessionAlreadyExistError.read(iprot);
                struct.setSessionAlreadyExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 7: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(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, StartWorkflowExecution_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.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.sessionAlreadyExistError != null) {
          oprot.writeFieldBegin(SESSION_ALREADY_EXIST_ERROR_FIELD_DESC);
          struct.sessionAlreadyExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class StartWorkflowExecution_resultTupleSchemeFactory implements SchemeFactory {
      public StartWorkflowExecution_resultTupleScheme getScheme() {
        return new StartWorkflowExecution_resultTupleScheme();
      }
    }

    private static class StartWorkflowExecution_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, StartWorkflowExecution_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetBadRequestError()) {
          optionals.set(1);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(2);
        }
        if (struct.isSetSessionAlreadyExistError()) {
          optionals.set(3);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(4);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(5);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(6);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(7);
        }
        oprot.writeBitSet(optionals, 8);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetSessionAlreadyExistError()) {
          struct.sessionAlreadyExistError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, StartWorkflowExecution_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(8);
        if (incoming.get(0)) {
          struct.success = new com.uber.cadence.StartWorkflowExecutionResponse();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.sessionAlreadyExistError = new com.uber.cadence.WorkflowExecutionAlreadyStartedError();
          struct.sessionAlreadyExistError.read(iprot);
          struct.setSessionAlreadyExistErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
        if (incoming.get(6)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
        if (incoming.get(7)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
      }
    }

  }

  public static class GetWorkflowExecutionHistory_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("GetWorkflowExecutionHistory_args");

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

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

    public com.uber.cadence.GetWorkflowExecutionHistoryRequest getRequest; // 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 {
      GET_REQUEST((short)1, "getRequest");

      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: // GET_REQUEST
            return GET_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.GET_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("getRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.GetWorkflowExecutionHistoryRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetWorkflowExecutionHistory_args.class, metaDataMap);
    }

    public GetWorkflowExecutionHistory_args() {
    }

    public GetWorkflowExecutionHistory_args(
      com.uber.cadence.GetWorkflowExecutionHistoryRequest getRequest)
    {
      this();
      this.getRequest = getRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public GetWorkflowExecutionHistory_args(GetWorkflowExecutionHistory_args other) {
      if (other.isSetGetRequest()) {
        this.getRequest = new com.uber.cadence.GetWorkflowExecutionHistoryRequest(other.getRequest);
      }
    }

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

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

    public com.uber.cadence.GetWorkflowExecutionHistoryRequest getGetRequest() {
      return this.getRequest;
    }

    public GetWorkflowExecutionHistory_args setGetRequest(com.uber.cadence.GetWorkflowExecutionHistoryRequest getRequest) {
      this.getRequest = getRequest;
      return this;
    }

    public void unsetGetRequest() {
      this.getRequest = null;
    }

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

    public void setGetRequestIsSet(boolean value) {
      if (!value) {
        this.getRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case GET_REQUEST:
        if (value == null) {
          unsetGetRequest();
        } else {
          setGetRequest((com.uber.cadence.GetWorkflowExecutionHistoryRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case GET_REQUEST:
        return getGetRequest();

      }
      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 GET_REQUEST:
        return isSetGetRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_getRequest = true && this.isSetGetRequest();
      boolean that_present_getRequest = true && that.isSetGetRequest();
      if (this_present_getRequest || that_present_getRequest) {
        if (!(this_present_getRequest && that_present_getRequest))
          return false;
        if (!this.getRequest.equals(that.getRequest))
          return false;
      }

      return true;
    }

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

      boolean present_getRequest = true && (isSetGetRequest());
      list.add(present_getRequest);
      if (present_getRequest)
        list.add(getRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetGetRequest()).compareTo(other.isSetGetRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetGetRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.getRequest, other.getRequest);
        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("GetWorkflowExecutionHistory_args(");
      boolean first = true;

      sb.append("getRequest:");
      if (this.getRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.getRequest);
      }
      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 (getRequest != null) {
        getRequest.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 GetWorkflowExecutionHistory_argsStandardSchemeFactory implements SchemeFactory {
      public GetWorkflowExecutionHistory_argsStandardScheme getScheme() {
        return new GetWorkflowExecutionHistory_argsStandardScheme();
      }
    }

    private static class GetWorkflowExecutionHistory_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, GetWorkflowExecutionHistory_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: // GET_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.getRequest = new com.uber.cadence.GetWorkflowExecutionHistoryRequest();
                struct.getRequest.read(iprot);
                struct.setGetRequestIsSet(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, GetWorkflowExecutionHistory_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class GetWorkflowExecutionHistory_argsTupleSchemeFactory implements SchemeFactory {
      public GetWorkflowExecutionHistory_argsTupleScheme getScheme() {
        return new GetWorkflowExecutionHistory_argsTupleScheme();
      }
    }

    private static class GetWorkflowExecutionHistory_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, GetWorkflowExecutionHistory_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.getRequest = new com.uber.cadence.GetWorkflowExecutionHistoryRequest();
          struct.getRequest.read(iprot);
          struct.setGetRequestIsSet(true);
        }
      }
    }

  }

  public static class GetWorkflowExecutionHistory_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("GetWorkflowExecutionHistory_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 BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)4);

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

    public com.uber.cadence.GetWorkflowExecutionHistoryResponse success; // required
    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // 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"),
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      SERVICE_BUSY_ERROR((short)4, "serviceBusyError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          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, com.uber.cadence.GetWorkflowExecutionHistoryResponse.class)));
      tmpMap.put(_Fields.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetWorkflowExecutionHistory_result.class, metaDataMap);
    }

    public GetWorkflowExecutionHistory_result() {
    }

    public GetWorkflowExecutionHistory_result(
      com.uber.cadence.GetWorkflowExecutionHistoryResponse success,
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.ServiceBusyError serviceBusyError)
    {
      this();
      this.success = success;
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.serviceBusyError = serviceBusyError;
    }

    /**
     * Performs a deep copy on other.
     */
    public GetWorkflowExecutionHistory_result(GetWorkflowExecutionHistory_result other) {
      if (other.isSetSuccess()) {
        this.success = new com.uber.cadence.GetWorkflowExecutionHistoryResponse(other.success);
      }
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.serviceBusyError = null;
    }

    public com.uber.cadence.GetWorkflowExecutionHistoryResponse getSuccess() {
      return this.success;
    }

    public GetWorkflowExecutionHistory_result setSuccess(com.uber.cadence.GetWorkflowExecutionHistoryResponse 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 com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public GetWorkflowExecutionHistory_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public GetWorkflowExecutionHistory_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public GetWorkflowExecutionHistory_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public GetWorkflowExecutionHistory_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

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

      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      }
    }

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

      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(GetWorkflowExecutionHistory_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_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          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_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      return list.hashCode();
    }

    @Override
    public int compareTo(GetWorkflowExecutionHistory_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(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        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("GetWorkflowExecutionHistory_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("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      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 GetWorkflowExecutionHistory_resultStandardSchemeFactory implements SchemeFactory {
      public GetWorkflowExecutionHistory_resultStandardScheme getScheme() {
        return new GetWorkflowExecutionHistory_resultStandardScheme();
      }
    }

    private static class GetWorkflowExecutionHistory_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, GetWorkflowExecutionHistory_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 com.uber.cadence.GetWorkflowExecutionHistoryResponse();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(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, GetWorkflowExecutionHistory_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.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class GetWorkflowExecutionHistory_resultTupleSchemeFactory implements SchemeFactory {
      public GetWorkflowExecutionHistory_resultTupleScheme getScheme() {
        return new GetWorkflowExecutionHistory_resultTupleScheme();
      }
    }

    private static class GetWorkflowExecutionHistory_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, GetWorkflowExecutionHistory_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetBadRequestError()) {
          optionals.set(1);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(2);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(3);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(4);
        }
        oprot.writeBitSet(optionals, 5);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, GetWorkflowExecutionHistory_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(5);
        if (incoming.get(0)) {
          struct.success = new com.uber.cadence.GetWorkflowExecutionHistoryResponse();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
      }
    }

  }

  public static class PollForDecisionTask_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("PollForDecisionTask_args");

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

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

    public com.uber.cadence.PollForDecisionTaskRequest pollRequest; // 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 {
      POLL_REQUEST((short)1, "pollRequest");

      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: // POLL_REQUEST
            return POLL_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.POLL_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("pollRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.PollForDecisionTaskRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PollForDecisionTask_args.class, metaDataMap);
    }

    public PollForDecisionTask_args() {
    }

    public PollForDecisionTask_args(
      com.uber.cadence.PollForDecisionTaskRequest pollRequest)
    {
      this();
      this.pollRequest = pollRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public PollForDecisionTask_args(PollForDecisionTask_args other) {
      if (other.isSetPollRequest()) {
        this.pollRequest = new com.uber.cadence.PollForDecisionTaskRequest(other.pollRequest);
      }
    }

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

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

    public com.uber.cadence.PollForDecisionTaskRequest getPollRequest() {
      return this.pollRequest;
    }

    public PollForDecisionTask_args setPollRequest(com.uber.cadence.PollForDecisionTaskRequest pollRequest) {
      this.pollRequest = pollRequest;
      return this;
    }

    public void unsetPollRequest() {
      this.pollRequest = null;
    }

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

    public void setPollRequestIsSet(boolean value) {
      if (!value) {
        this.pollRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case POLL_REQUEST:
        if (value == null) {
          unsetPollRequest();
        } else {
          setPollRequest((com.uber.cadence.PollForDecisionTaskRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case POLL_REQUEST:
        return getPollRequest();

      }
      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 POLL_REQUEST:
        return isSetPollRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_pollRequest = true && this.isSetPollRequest();
      boolean that_present_pollRequest = true && that.isSetPollRequest();
      if (this_present_pollRequest || that_present_pollRequest) {
        if (!(this_present_pollRequest && that_present_pollRequest))
          return false;
        if (!this.pollRequest.equals(that.pollRequest))
          return false;
      }

      return true;
    }

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

      boolean present_pollRequest = true && (isSetPollRequest());
      list.add(present_pollRequest);
      if (present_pollRequest)
        list.add(pollRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetPollRequest()).compareTo(other.isSetPollRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPollRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pollRequest, other.pollRequest);
        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("PollForDecisionTask_args(");
      boolean first = true;

      sb.append("pollRequest:");
      if (this.pollRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.pollRequest);
      }
      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 (pollRequest != null) {
        pollRequest.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 PollForDecisionTask_argsStandardSchemeFactory implements SchemeFactory {
      public PollForDecisionTask_argsStandardScheme getScheme() {
        return new PollForDecisionTask_argsStandardScheme();
      }
    }

    private static class PollForDecisionTask_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, PollForDecisionTask_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: // POLL_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.pollRequest = new com.uber.cadence.PollForDecisionTaskRequest();
                struct.pollRequest.read(iprot);
                struct.setPollRequestIsSet(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, PollForDecisionTask_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class PollForDecisionTask_argsTupleSchemeFactory implements SchemeFactory {
      public PollForDecisionTask_argsTupleScheme getScheme() {
        return new PollForDecisionTask_argsTupleScheme();
      }
    }

    private static class PollForDecisionTask_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, PollForDecisionTask_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.pollRequest = new com.uber.cadence.PollForDecisionTaskRequest();
          struct.pollRequest.read(iprot);
          struct.setPollRequestIsSet(true);
        }
      }
    }

  }

  public static class PollForDecisionTask_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("PollForDecisionTask_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 BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

    public com.uber.cadence.PollForDecisionTaskResponse success; // required
    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // 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"),
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      SERVICE_BUSY_ERROR((short)3, "serviceBusyError"),
      LIMIT_EXCEEDED_ERROR((short)4, "limitExceededError"),
      ENTITY_NOT_EXIST_ERROR((short)5, "entityNotExistError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)6, "domainNotActiveError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          case 4: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          case 5: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 6: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          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, com.uber.cadence.PollForDecisionTaskResponse.class)));
      tmpMap.put(_Fields.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PollForDecisionTask_result.class, metaDataMap);
    }

    public PollForDecisionTask_result() {
    }

    public PollForDecisionTask_result(
      com.uber.cadence.PollForDecisionTaskResponse success,
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.ServiceBusyError serviceBusyError,
      com.uber.cadence.LimitExceededError limitExceededError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError)
    {
      this();
      this.success = success;
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.serviceBusyError = serviceBusyError;
      this.limitExceededError = limitExceededError;
      this.entityNotExistError = entityNotExistError;
      this.domainNotActiveError = domainNotActiveError;
    }

    /**
     * Performs a deep copy on other.
     */
    public PollForDecisionTask_result(PollForDecisionTask_result other) {
      if (other.isSetSuccess()) {
        this.success = new com.uber.cadence.PollForDecisionTaskResponse(other.success);
      }
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.badRequestError = null;
      this.internalServiceError = null;
      this.serviceBusyError = null;
      this.limitExceededError = null;
      this.entityNotExistError = null;
      this.domainNotActiveError = null;
    }

    public com.uber.cadence.PollForDecisionTaskResponse getSuccess() {
      return this.success;
    }

    public PollForDecisionTask_result setSuccess(com.uber.cadence.PollForDecisionTaskResponse 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 com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public PollForDecisionTask_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public PollForDecisionTask_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public PollForDecisionTask_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public PollForDecisionTask_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public PollForDecisionTask_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public PollForDecisionTask_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

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

      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      }
    }

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

      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(PollForDecisionTask_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_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          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_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      return list.hashCode();
    }

    @Override
    public int compareTo(PollForDecisionTask_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(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        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("PollForDecisionTask_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("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      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 PollForDecisionTask_resultStandardSchemeFactory implements SchemeFactory {
      public PollForDecisionTask_resultStandardScheme getScheme() {
        return new PollForDecisionTask_resultStandardScheme();
      }
    }

    private static class PollForDecisionTask_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, PollForDecisionTask_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 com.uber.cadence.PollForDecisionTaskResponse();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(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, PollForDecisionTask_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.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class PollForDecisionTask_resultTupleSchemeFactory implements SchemeFactory {
      public PollForDecisionTask_resultTupleScheme getScheme() {
        return new PollForDecisionTask_resultTupleScheme();
      }
    }

    private static class PollForDecisionTask_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, PollForDecisionTask_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetBadRequestError()) {
          optionals.set(1);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(2);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(3);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(4);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(5);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(6);
        }
        oprot.writeBitSet(optionals, 7);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, PollForDecisionTask_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(7);
        if (incoming.get(0)) {
          struct.success = new com.uber.cadence.PollForDecisionTaskResponse();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(6)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
      }
    }

  }

  public static class RespondDecisionTaskCompleted_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("RespondDecisionTaskCompleted_args");

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

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

    public com.uber.cadence.RespondDecisionTaskCompletedRequest completeRequest; // 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 {
      COMPLETE_REQUEST((short)1, "completeRequest");

      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: // COMPLETE_REQUEST
            return COMPLETE_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.COMPLETE_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("completeRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.RespondDecisionTaskCompletedRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RespondDecisionTaskCompleted_args.class, metaDataMap);
    }

    public RespondDecisionTaskCompleted_args() {
    }

    public RespondDecisionTaskCompleted_args(
      com.uber.cadence.RespondDecisionTaskCompletedRequest completeRequest)
    {
      this();
      this.completeRequest = completeRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public RespondDecisionTaskCompleted_args(RespondDecisionTaskCompleted_args other) {
      if (other.isSetCompleteRequest()) {
        this.completeRequest = new com.uber.cadence.RespondDecisionTaskCompletedRequest(other.completeRequest);
      }
    }

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

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

    public com.uber.cadence.RespondDecisionTaskCompletedRequest getCompleteRequest() {
      return this.completeRequest;
    }

    public RespondDecisionTaskCompleted_args setCompleteRequest(com.uber.cadence.RespondDecisionTaskCompletedRequest completeRequest) {
      this.completeRequest = completeRequest;
      return this;
    }

    public void unsetCompleteRequest() {
      this.completeRequest = null;
    }

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

    public void setCompleteRequestIsSet(boolean value) {
      if (!value) {
        this.completeRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case COMPLETE_REQUEST:
        if (value == null) {
          unsetCompleteRequest();
        } else {
          setCompleteRequest((com.uber.cadence.RespondDecisionTaskCompletedRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case COMPLETE_REQUEST:
        return getCompleteRequest();

      }
      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 COMPLETE_REQUEST:
        return isSetCompleteRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_completeRequest = true && this.isSetCompleteRequest();
      boolean that_present_completeRequest = true && that.isSetCompleteRequest();
      if (this_present_completeRequest || that_present_completeRequest) {
        if (!(this_present_completeRequest && that_present_completeRequest))
          return false;
        if (!this.completeRequest.equals(that.completeRequest))
          return false;
      }

      return true;
    }

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

      boolean present_completeRequest = true && (isSetCompleteRequest());
      list.add(present_completeRequest);
      if (present_completeRequest)
        list.add(completeRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCompleteRequest()).compareTo(other.isSetCompleteRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCompleteRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.completeRequest, other.completeRequest);
        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("RespondDecisionTaskCompleted_args(");
      boolean first = true;

      sb.append("completeRequest:");
      if (this.completeRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.completeRequest);
      }
      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 (completeRequest != null) {
        completeRequest.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 RespondDecisionTaskCompleted_argsStandardSchemeFactory implements SchemeFactory {
      public RespondDecisionTaskCompleted_argsStandardScheme getScheme() {
        return new RespondDecisionTaskCompleted_argsStandardScheme();
      }
    }

    private static class RespondDecisionTaskCompleted_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RespondDecisionTaskCompleted_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: // COMPLETE_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.completeRequest = new com.uber.cadence.RespondDecisionTaskCompletedRequest();
                struct.completeRequest.read(iprot);
                struct.setCompleteRequestIsSet(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, RespondDecisionTaskCompleted_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class RespondDecisionTaskCompleted_argsTupleSchemeFactory implements SchemeFactory {
      public RespondDecisionTaskCompleted_argsTupleScheme getScheme() {
        return new RespondDecisionTaskCompleted_argsTupleScheme();
      }
    }

    private static class RespondDecisionTaskCompleted_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RespondDecisionTaskCompleted_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.completeRequest = new com.uber.cadence.RespondDecisionTaskCompletedRequest();
          struct.completeRequest.read(iprot);
          struct.setCompleteRequestIsSet(true);
        }
      }
    }

  }

  public static class RespondDecisionTaskCompleted_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("RespondDecisionTaskCompleted_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 BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

    public com.uber.cadence.RespondDecisionTaskCompletedResponse success; // required
    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // 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"),
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)4, "domainNotActiveError"),
      LIMIT_EXCEEDED_ERROR((short)5, "limitExceededError"),
      SERVICE_BUSY_ERROR((short)6, "serviceBusyError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          case 5: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          case 6: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          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, com.uber.cadence.RespondDecisionTaskCompletedResponse.class)));
      tmpMap.put(_Fields.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RespondDecisionTaskCompleted_result.class, metaDataMap);
    }

    public RespondDecisionTaskCompleted_result() {
    }

    public RespondDecisionTaskCompleted_result(
      com.uber.cadence.RespondDecisionTaskCompletedResponse success,
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError,
      com.uber.cadence.LimitExceededError limitExceededError,
      com.uber.cadence.ServiceBusyError serviceBusyError)
    {
      this();
      this.success = success;
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.domainNotActiveError = domainNotActiveError;
      this.limitExceededError = limitExceededError;
      this.serviceBusyError = serviceBusyError;
    }

    /**
     * Performs a deep copy on other.
     */
    public RespondDecisionTaskCompleted_result(RespondDecisionTaskCompleted_result other) {
      if (other.isSetSuccess()) {
        this.success = new com.uber.cadence.RespondDecisionTaskCompletedResponse(other.success);
      }
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.domainNotActiveError = null;
      this.limitExceededError = null;
      this.serviceBusyError = null;
    }

    public com.uber.cadence.RespondDecisionTaskCompletedResponse getSuccess() {
      return this.success;
    }

    public RespondDecisionTaskCompleted_result setSuccess(com.uber.cadence.RespondDecisionTaskCompletedResponse 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 com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public RespondDecisionTaskCompleted_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public RespondDecisionTaskCompleted_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public RespondDecisionTaskCompleted_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public RespondDecisionTaskCompleted_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public RespondDecisionTaskCompleted_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public RespondDecisionTaskCompleted_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

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

      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      }
    }

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

      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(RespondDecisionTaskCompleted_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_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          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_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      return list.hashCode();
    }

    @Override
    public int compareTo(RespondDecisionTaskCompleted_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(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        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("RespondDecisionTaskCompleted_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("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      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 RespondDecisionTaskCompleted_resultStandardSchemeFactory implements SchemeFactory {
      public RespondDecisionTaskCompleted_resultStandardScheme getScheme() {
        return new RespondDecisionTaskCompleted_resultStandardScheme();
      }
    }

    private static class RespondDecisionTaskCompleted_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RespondDecisionTaskCompleted_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 com.uber.cadence.RespondDecisionTaskCompletedResponse();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(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, RespondDecisionTaskCompleted_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.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class RespondDecisionTaskCompleted_resultTupleSchemeFactory implements SchemeFactory {
      public RespondDecisionTaskCompleted_resultTupleScheme getScheme() {
        return new RespondDecisionTaskCompleted_resultTupleScheme();
      }
    }

    private static class RespondDecisionTaskCompleted_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, RespondDecisionTaskCompleted_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetBadRequestError()) {
          optionals.set(1);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(2);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(3);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(4);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(5);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(6);
        }
        oprot.writeBitSet(optionals, 7);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RespondDecisionTaskCompleted_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(7);
        if (incoming.get(0)) {
          struct.success = new com.uber.cadence.RespondDecisionTaskCompletedResponse();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
        if (incoming.get(6)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
      }
    }

  }

  public static class RespondDecisionTaskFailed_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("RespondDecisionTaskFailed_args");

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

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

    public com.uber.cadence.RespondDecisionTaskFailedRequest failedRequest; // 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 {
      FAILED_REQUEST((short)1, "failedRequest");

      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: // FAILED_REQUEST
            return FAILED_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.FAILED_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("failedRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.RespondDecisionTaskFailedRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RespondDecisionTaskFailed_args.class, metaDataMap);
    }

    public RespondDecisionTaskFailed_args() {
    }

    public RespondDecisionTaskFailed_args(
      com.uber.cadence.RespondDecisionTaskFailedRequest failedRequest)
    {
      this();
      this.failedRequest = failedRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public RespondDecisionTaskFailed_args(RespondDecisionTaskFailed_args other) {
      if (other.isSetFailedRequest()) {
        this.failedRequest = new com.uber.cadence.RespondDecisionTaskFailedRequest(other.failedRequest);
      }
    }

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

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

    public com.uber.cadence.RespondDecisionTaskFailedRequest getFailedRequest() {
      return this.failedRequest;
    }

    public RespondDecisionTaskFailed_args setFailedRequest(com.uber.cadence.RespondDecisionTaskFailedRequest failedRequest) {
      this.failedRequest = failedRequest;
      return this;
    }

    public void unsetFailedRequest() {
      this.failedRequest = null;
    }

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

    public void setFailedRequestIsSet(boolean value) {
      if (!value) {
        this.failedRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case FAILED_REQUEST:
        if (value == null) {
          unsetFailedRequest();
        } else {
          setFailedRequest((com.uber.cadence.RespondDecisionTaskFailedRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case FAILED_REQUEST:
        return getFailedRequest();

      }
      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 FAILED_REQUEST:
        return isSetFailedRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_failedRequest = true && this.isSetFailedRequest();
      boolean that_present_failedRequest = true && that.isSetFailedRequest();
      if (this_present_failedRequest || that_present_failedRequest) {
        if (!(this_present_failedRequest && that_present_failedRequest))
          return false;
        if (!this.failedRequest.equals(that.failedRequest))
          return false;
      }

      return true;
    }

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

      boolean present_failedRequest = true && (isSetFailedRequest());
      list.add(present_failedRequest);
      if (present_failedRequest)
        list.add(failedRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetFailedRequest()).compareTo(other.isSetFailedRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFailedRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failedRequest, other.failedRequest);
        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("RespondDecisionTaskFailed_args(");
      boolean first = true;

      sb.append("failedRequest:");
      if (this.failedRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.failedRequest);
      }
      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 (failedRequest != null) {
        failedRequest.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 RespondDecisionTaskFailed_argsStandardSchemeFactory implements SchemeFactory {
      public RespondDecisionTaskFailed_argsStandardScheme getScheme() {
        return new RespondDecisionTaskFailed_argsStandardScheme();
      }
    }

    private static class RespondDecisionTaskFailed_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RespondDecisionTaskFailed_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: // FAILED_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.failedRequest = new com.uber.cadence.RespondDecisionTaskFailedRequest();
                struct.failedRequest.read(iprot);
                struct.setFailedRequestIsSet(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, RespondDecisionTaskFailed_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class RespondDecisionTaskFailed_argsTupleSchemeFactory implements SchemeFactory {
      public RespondDecisionTaskFailed_argsTupleScheme getScheme() {
        return new RespondDecisionTaskFailed_argsTupleScheme();
      }
    }

    private static class RespondDecisionTaskFailed_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RespondDecisionTaskFailed_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.failedRequest = new com.uber.cadence.RespondDecisionTaskFailedRequest();
          struct.failedRequest.read(iprot);
          struct.setFailedRequestIsSet(true);
        }
      }
    }

  }

  public static class RespondDecisionTaskFailed_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("RespondDecisionTaskFailed_result");

    private static final org.apache.thrift.protocol.TField BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // 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 {
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)4, "domainNotActiveError"),
      LIMIT_EXCEEDED_ERROR((short)5, "limitExceededError"),
      SERVICE_BUSY_ERROR((short)6, "serviceBusyError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          case 5: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          case 6: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          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.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RespondDecisionTaskFailed_result.class, metaDataMap);
    }

    public RespondDecisionTaskFailed_result() {
    }

    public RespondDecisionTaskFailed_result(
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError,
      com.uber.cadence.LimitExceededError limitExceededError,
      com.uber.cadence.ServiceBusyError serviceBusyError)
    {
      this();
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.domainNotActiveError = domainNotActiveError;
      this.limitExceededError = limitExceededError;
      this.serviceBusyError = serviceBusyError;
    }

    /**
     * Performs a deep copy on other.
     */
    public RespondDecisionTaskFailed_result(RespondDecisionTaskFailed_result other) {
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
    }

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

    @Override
    public void clear() {
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.domainNotActiveError = null;
      this.limitExceededError = null;
      this.serviceBusyError = null;
    }

    public com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public RespondDecisionTaskFailed_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public RespondDecisionTaskFailed_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public RespondDecisionTaskFailed_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public RespondDecisionTaskFailed_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public RespondDecisionTaskFailed_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public RespondDecisionTaskFailed_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      return true;
    }

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

      boolean present_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        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("RespondDecisionTaskFailed_result(");
      boolean first = true;

      sb.append("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      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 {
        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 RespondDecisionTaskFailed_resultStandardSchemeFactory implements SchemeFactory {
      public RespondDecisionTaskFailed_resultStandardScheme getScheme() {
        return new RespondDecisionTaskFailed_resultStandardScheme();
      }
    }

    private static class RespondDecisionTaskFailed_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RespondDecisionTaskFailed_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 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(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, RespondDecisionTaskFailed_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class RespondDecisionTaskFailed_resultTupleSchemeFactory implements SchemeFactory {
      public RespondDecisionTaskFailed_resultTupleScheme getScheme() {
        return new RespondDecisionTaskFailed_resultTupleScheme();
      }
    }

    private static class RespondDecisionTaskFailed_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, RespondDecisionTaskFailed_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetBadRequestError()) {
          optionals.set(0);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(1);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(2);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(3);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(4);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(5);
        }
        oprot.writeBitSet(optionals, 6);
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RespondDecisionTaskFailed_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(6);
        if (incoming.get(0)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(1)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
      }
    }

  }

  public static class PollForActivityTask_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("PollForActivityTask_args");

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

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

    public com.uber.cadence.PollForActivityTaskRequest pollRequest; // 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 {
      POLL_REQUEST((short)1, "pollRequest");

      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: // POLL_REQUEST
            return POLL_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.POLL_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("pollRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.PollForActivityTaskRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PollForActivityTask_args.class, metaDataMap);
    }

    public PollForActivityTask_args() {
    }

    public PollForActivityTask_args(
      com.uber.cadence.PollForActivityTaskRequest pollRequest)
    {
      this();
      this.pollRequest = pollRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public PollForActivityTask_args(PollForActivityTask_args other) {
      if (other.isSetPollRequest()) {
        this.pollRequest = new com.uber.cadence.PollForActivityTaskRequest(other.pollRequest);
      }
    }

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

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

    public com.uber.cadence.PollForActivityTaskRequest getPollRequest() {
      return this.pollRequest;
    }

    public PollForActivityTask_args setPollRequest(com.uber.cadence.PollForActivityTaskRequest pollRequest) {
      this.pollRequest = pollRequest;
      return this;
    }

    public void unsetPollRequest() {
      this.pollRequest = null;
    }

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

    public void setPollRequestIsSet(boolean value) {
      if (!value) {
        this.pollRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case POLL_REQUEST:
        if (value == null) {
          unsetPollRequest();
        } else {
          setPollRequest((com.uber.cadence.PollForActivityTaskRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case POLL_REQUEST:
        return getPollRequest();

      }
      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 POLL_REQUEST:
        return isSetPollRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_pollRequest = true && this.isSetPollRequest();
      boolean that_present_pollRequest = true && that.isSetPollRequest();
      if (this_present_pollRequest || that_present_pollRequest) {
        if (!(this_present_pollRequest && that_present_pollRequest))
          return false;
        if (!this.pollRequest.equals(that.pollRequest))
          return false;
      }

      return true;
    }

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

      boolean present_pollRequest = true && (isSetPollRequest());
      list.add(present_pollRequest);
      if (present_pollRequest)
        list.add(pollRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetPollRequest()).compareTo(other.isSetPollRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPollRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pollRequest, other.pollRequest);
        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("PollForActivityTask_args(");
      boolean first = true;

      sb.append("pollRequest:");
      if (this.pollRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.pollRequest);
      }
      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 (pollRequest != null) {
        pollRequest.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 PollForActivityTask_argsStandardSchemeFactory implements SchemeFactory {
      public PollForActivityTask_argsStandardScheme getScheme() {
        return new PollForActivityTask_argsStandardScheme();
      }
    }

    private static class PollForActivityTask_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, PollForActivityTask_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: // POLL_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.pollRequest = new com.uber.cadence.PollForActivityTaskRequest();
                struct.pollRequest.read(iprot);
                struct.setPollRequestIsSet(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, PollForActivityTask_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class PollForActivityTask_argsTupleSchemeFactory implements SchemeFactory {
      public PollForActivityTask_argsTupleScheme getScheme() {
        return new PollForActivityTask_argsTupleScheme();
      }
    }

    private static class PollForActivityTask_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, PollForActivityTask_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.pollRequest = new com.uber.cadence.PollForActivityTaskRequest();
          struct.pollRequest.read(iprot);
          struct.setPollRequestIsSet(true);
        }
      }
    }

  }

  public static class PollForActivityTask_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("PollForActivityTask_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 BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

    public com.uber.cadence.PollForActivityTaskResponse success; // required
    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // 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"),
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      SERVICE_BUSY_ERROR((short)3, "serviceBusyError"),
      LIMIT_EXCEEDED_ERROR((short)4, "limitExceededError"),
      ENTITY_NOT_EXIST_ERROR((short)5, "entityNotExistError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)6, "domainNotActiveError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          case 4: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          case 5: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 6: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          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, com.uber.cadence.PollForActivityTaskResponse.class)));
      tmpMap.put(_Fields.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PollForActivityTask_result.class, metaDataMap);
    }

    public PollForActivityTask_result() {
    }

    public PollForActivityTask_result(
      com.uber.cadence.PollForActivityTaskResponse success,
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.ServiceBusyError serviceBusyError,
      com.uber.cadence.LimitExceededError limitExceededError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError)
    {
      this();
      this.success = success;
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.serviceBusyError = serviceBusyError;
      this.limitExceededError = limitExceededError;
      this.entityNotExistError = entityNotExistError;
      this.domainNotActiveError = domainNotActiveError;
    }

    /**
     * Performs a deep copy on other.
     */
    public PollForActivityTask_result(PollForActivityTask_result other) {
      if (other.isSetSuccess()) {
        this.success = new com.uber.cadence.PollForActivityTaskResponse(other.success);
      }
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.badRequestError = null;
      this.internalServiceError = null;
      this.serviceBusyError = null;
      this.limitExceededError = null;
      this.entityNotExistError = null;
      this.domainNotActiveError = null;
    }

    public com.uber.cadence.PollForActivityTaskResponse getSuccess() {
      return this.success;
    }

    public PollForActivityTask_result setSuccess(com.uber.cadence.PollForActivityTaskResponse 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 com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public PollForActivityTask_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public PollForActivityTask_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public PollForActivityTask_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public PollForActivityTask_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public PollForActivityTask_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public PollForActivityTask_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

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

      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      }
    }

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

      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(PollForActivityTask_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_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          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_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      return list.hashCode();
    }

    @Override
    public int compareTo(PollForActivityTask_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(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        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("PollForActivityTask_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("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      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 PollForActivityTask_resultStandardSchemeFactory implements SchemeFactory {
      public PollForActivityTask_resultStandardScheme getScheme() {
        return new PollForActivityTask_resultStandardScheme();
      }
    }

    private static class PollForActivityTask_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, PollForActivityTask_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 com.uber.cadence.PollForActivityTaskResponse();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(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, PollForActivityTask_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.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class PollForActivityTask_resultTupleSchemeFactory implements SchemeFactory {
      public PollForActivityTask_resultTupleScheme getScheme() {
        return new PollForActivityTask_resultTupleScheme();
      }
    }

    private static class PollForActivityTask_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, PollForActivityTask_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetBadRequestError()) {
          optionals.set(1);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(2);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(3);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(4);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(5);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(6);
        }
        oprot.writeBitSet(optionals, 7);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, PollForActivityTask_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(7);
        if (incoming.get(0)) {
          struct.success = new com.uber.cadence.PollForActivityTaskResponse();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(6)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
      }
    }

  }

  public static class RecordActivityTaskHeartbeat_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("RecordActivityTaskHeartbeat_args");

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

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

    public com.uber.cadence.RecordActivityTaskHeartbeatRequest heartbeatRequest; // 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 {
      HEARTBEAT_REQUEST((short)1, "heartbeatRequest");

      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: // HEARTBEAT_REQUEST
            return HEARTBEAT_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.HEARTBEAT_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("heartbeatRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.RecordActivityTaskHeartbeatRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RecordActivityTaskHeartbeat_args.class, metaDataMap);
    }

    public RecordActivityTaskHeartbeat_args() {
    }

    public RecordActivityTaskHeartbeat_args(
      com.uber.cadence.RecordActivityTaskHeartbeatRequest heartbeatRequest)
    {
      this();
      this.heartbeatRequest = heartbeatRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public RecordActivityTaskHeartbeat_args(RecordActivityTaskHeartbeat_args other) {
      if (other.isSetHeartbeatRequest()) {
        this.heartbeatRequest = new com.uber.cadence.RecordActivityTaskHeartbeatRequest(other.heartbeatRequest);
      }
    }

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

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

    public com.uber.cadence.RecordActivityTaskHeartbeatRequest getHeartbeatRequest() {
      return this.heartbeatRequest;
    }

    public RecordActivityTaskHeartbeat_args setHeartbeatRequest(com.uber.cadence.RecordActivityTaskHeartbeatRequest heartbeatRequest) {
      this.heartbeatRequest = heartbeatRequest;
      return this;
    }

    public void unsetHeartbeatRequest() {
      this.heartbeatRequest = null;
    }

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

    public void setHeartbeatRequestIsSet(boolean value) {
      if (!value) {
        this.heartbeatRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case HEARTBEAT_REQUEST:
        if (value == null) {
          unsetHeartbeatRequest();
        } else {
          setHeartbeatRequest((com.uber.cadence.RecordActivityTaskHeartbeatRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case HEARTBEAT_REQUEST:
        return getHeartbeatRequest();

      }
      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 HEARTBEAT_REQUEST:
        return isSetHeartbeatRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_heartbeatRequest = true && this.isSetHeartbeatRequest();
      boolean that_present_heartbeatRequest = true && that.isSetHeartbeatRequest();
      if (this_present_heartbeatRequest || that_present_heartbeatRequest) {
        if (!(this_present_heartbeatRequest && that_present_heartbeatRequest))
          return false;
        if (!this.heartbeatRequest.equals(that.heartbeatRequest))
          return false;
      }

      return true;
    }

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

      boolean present_heartbeatRequest = true && (isSetHeartbeatRequest());
      list.add(present_heartbeatRequest);
      if (present_heartbeatRequest)
        list.add(heartbeatRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetHeartbeatRequest()).compareTo(other.isSetHeartbeatRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetHeartbeatRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.heartbeatRequest, other.heartbeatRequest);
        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("RecordActivityTaskHeartbeat_args(");
      boolean first = true;

      sb.append("heartbeatRequest:");
      if (this.heartbeatRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.heartbeatRequest);
      }
      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 (heartbeatRequest != null) {
        heartbeatRequest.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 RecordActivityTaskHeartbeat_argsStandardSchemeFactory implements SchemeFactory {
      public RecordActivityTaskHeartbeat_argsStandardScheme getScheme() {
        return new RecordActivityTaskHeartbeat_argsStandardScheme();
      }
    }

    private static class RecordActivityTaskHeartbeat_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RecordActivityTaskHeartbeat_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: // HEARTBEAT_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.heartbeatRequest = new com.uber.cadence.RecordActivityTaskHeartbeatRequest();
                struct.heartbeatRequest.read(iprot);
                struct.setHeartbeatRequestIsSet(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, RecordActivityTaskHeartbeat_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class RecordActivityTaskHeartbeat_argsTupleSchemeFactory implements SchemeFactory {
      public RecordActivityTaskHeartbeat_argsTupleScheme getScheme() {
        return new RecordActivityTaskHeartbeat_argsTupleScheme();
      }
    }

    private static class RecordActivityTaskHeartbeat_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RecordActivityTaskHeartbeat_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.heartbeatRequest = new com.uber.cadence.RecordActivityTaskHeartbeatRequest();
          struct.heartbeatRequest.read(iprot);
          struct.setHeartbeatRequestIsSet(true);
        }
      }
    }

  }

  public static class RecordActivityTaskHeartbeat_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("RecordActivityTaskHeartbeat_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 BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

    public com.uber.cadence.RecordActivityTaskHeartbeatResponse success; // required
    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // 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"),
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)4, "domainNotActiveError"),
      LIMIT_EXCEEDED_ERROR((short)5, "limitExceededError"),
      SERVICE_BUSY_ERROR((short)6, "serviceBusyError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          case 5: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          case 6: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          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, com.uber.cadence.RecordActivityTaskHeartbeatResponse.class)));
      tmpMap.put(_Fields.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RecordActivityTaskHeartbeat_result.class, metaDataMap);
    }

    public RecordActivityTaskHeartbeat_result() {
    }

    public RecordActivityTaskHeartbeat_result(
      com.uber.cadence.RecordActivityTaskHeartbeatResponse success,
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError,
      com.uber.cadence.LimitExceededError limitExceededError,
      com.uber.cadence.ServiceBusyError serviceBusyError)
    {
      this();
      this.success = success;
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.domainNotActiveError = domainNotActiveError;
      this.limitExceededError = limitExceededError;
      this.serviceBusyError = serviceBusyError;
    }

    /**
     * Performs a deep copy on other.
     */
    public RecordActivityTaskHeartbeat_result(RecordActivityTaskHeartbeat_result other) {
      if (other.isSetSuccess()) {
        this.success = new com.uber.cadence.RecordActivityTaskHeartbeatResponse(other.success);
      }
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.domainNotActiveError = null;
      this.limitExceededError = null;
      this.serviceBusyError = null;
    }

    public com.uber.cadence.RecordActivityTaskHeartbeatResponse getSuccess() {
      return this.success;
    }

    public RecordActivityTaskHeartbeat_result setSuccess(com.uber.cadence.RecordActivityTaskHeartbeatResponse 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 com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public RecordActivityTaskHeartbeat_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public RecordActivityTaskHeartbeat_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public RecordActivityTaskHeartbeat_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public RecordActivityTaskHeartbeat_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public RecordActivityTaskHeartbeat_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public RecordActivityTaskHeartbeat_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

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

      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      }
    }

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

      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(RecordActivityTaskHeartbeat_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_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          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_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      return list.hashCode();
    }

    @Override
    public int compareTo(RecordActivityTaskHeartbeat_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(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        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("RecordActivityTaskHeartbeat_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("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      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 RecordActivityTaskHeartbeat_resultStandardSchemeFactory implements SchemeFactory {
      public RecordActivityTaskHeartbeat_resultStandardScheme getScheme() {
        return new RecordActivityTaskHeartbeat_resultStandardScheme();
      }
    }

    private static class RecordActivityTaskHeartbeat_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RecordActivityTaskHeartbeat_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 com.uber.cadence.RecordActivityTaskHeartbeatResponse();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(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, RecordActivityTaskHeartbeat_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.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class RecordActivityTaskHeartbeat_resultTupleSchemeFactory implements SchemeFactory {
      public RecordActivityTaskHeartbeat_resultTupleScheme getScheme() {
        return new RecordActivityTaskHeartbeat_resultTupleScheme();
      }
    }

    private static class RecordActivityTaskHeartbeat_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, RecordActivityTaskHeartbeat_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetBadRequestError()) {
          optionals.set(1);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(2);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(3);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(4);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(5);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(6);
        }
        oprot.writeBitSet(optionals, 7);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RecordActivityTaskHeartbeat_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(7);
        if (incoming.get(0)) {
          struct.success = new com.uber.cadence.RecordActivityTaskHeartbeatResponse();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
        if (incoming.get(6)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
      }
    }

  }

  public static class RecordActivityTaskHeartbeatByID_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("RecordActivityTaskHeartbeatByID_args");

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

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

    public com.uber.cadence.RecordActivityTaskHeartbeatByIDRequest heartbeatRequest; // 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 {
      HEARTBEAT_REQUEST((short)1, "heartbeatRequest");

      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: // HEARTBEAT_REQUEST
            return HEARTBEAT_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.HEARTBEAT_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("heartbeatRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.RecordActivityTaskHeartbeatByIDRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RecordActivityTaskHeartbeatByID_args.class, metaDataMap);
    }

    public RecordActivityTaskHeartbeatByID_args() {
    }

    public RecordActivityTaskHeartbeatByID_args(
      com.uber.cadence.RecordActivityTaskHeartbeatByIDRequest heartbeatRequest)
    {
      this();
      this.heartbeatRequest = heartbeatRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public RecordActivityTaskHeartbeatByID_args(RecordActivityTaskHeartbeatByID_args other) {
      if (other.isSetHeartbeatRequest()) {
        this.heartbeatRequest = new com.uber.cadence.RecordActivityTaskHeartbeatByIDRequest(other.heartbeatRequest);
      }
    }

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

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

    public com.uber.cadence.RecordActivityTaskHeartbeatByIDRequest getHeartbeatRequest() {
      return this.heartbeatRequest;
    }

    public RecordActivityTaskHeartbeatByID_args setHeartbeatRequest(com.uber.cadence.RecordActivityTaskHeartbeatByIDRequest heartbeatRequest) {
      this.heartbeatRequest = heartbeatRequest;
      return this;
    }

    public void unsetHeartbeatRequest() {
      this.heartbeatRequest = null;
    }

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

    public void setHeartbeatRequestIsSet(boolean value) {
      if (!value) {
        this.heartbeatRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case HEARTBEAT_REQUEST:
        if (value == null) {
          unsetHeartbeatRequest();
        } else {
          setHeartbeatRequest((com.uber.cadence.RecordActivityTaskHeartbeatByIDRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case HEARTBEAT_REQUEST:
        return getHeartbeatRequest();

      }
      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 HEARTBEAT_REQUEST:
        return isSetHeartbeatRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_heartbeatRequest = true && this.isSetHeartbeatRequest();
      boolean that_present_heartbeatRequest = true && that.isSetHeartbeatRequest();
      if (this_present_heartbeatRequest || that_present_heartbeatRequest) {
        if (!(this_present_heartbeatRequest && that_present_heartbeatRequest))
          return false;
        if (!this.heartbeatRequest.equals(that.heartbeatRequest))
          return false;
      }

      return true;
    }

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

      boolean present_heartbeatRequest = true && (isSetHeartbeatRequest());
      list.add(present_heartbeatRequest);
      if (present_heartbeatRequest)
        list.add(heartbeatRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetHeartbeatRequest()).compareTo(other.isSetHeartbeatRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetHeartbeatRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.heartbeatRequest, other.heartbeatRequest);
        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("RecordActivityTaskHeartbeatByID_args(");
      boolean first = true;

      sb.append("heartbeatRequest:");
      if (this.heartbeatRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.heartbeatRequest);
      }
      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 (heartbeatRequest != null) {
        heartbeatRequest.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 RecordActivityTaskHeartbeatByID_argsStandardSchemeFactory implements SchemeFactory {
      public RecordActivityTaskHeartbeatByID_argsStandardScheme getScheme() {
        return new RecordActivityTaskHeartbeatByID_argsStandardScheme();
      }
    }

    private static class RecordActivityTaskHeartbeatByID_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RecordActivityTaskHeartbeatByID_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: // HEARTBEAT_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.heartbeatRequest = new com.uber.cadence.RecordActivityTaskHeartbeatByIDRequest();
                struct.heartbeatRequest.read(iprot);
                struct.setHeartbeatRequestIsSet(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, RecordActivityTaskHeartbeatByID_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class RecordActivityTaskHeartbeatByID_argsTupleSchemeFactory implements SchemeFactory {
      public RecordActivityTaskHeartbeatByID_argsTupleScheme getScheme() {
        return new RecordActivityTaskHeartbeatByID_argsTupleScheme();
      }
    }

    private static class RecordActivityTaskHeartbeatByID_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RecordActivityTaskHeartbeatByID_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.heartbeatRequest = new com.uber.cadence.RecordActivityTaskHeartbeatByIDRequest();
          struct.heartbeatRequest.read(iprot);
          struct.setHeartbeatRequestIsSet(true);
        }
      }
    }

  }

  public static class RecordActivityTaskHeartbeatByID_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("RecordActivityTaskHeartbeatByID_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 BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

    public com.uber.cadence.RecordActivityTaskHeartbeatResponse success; // required
    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // 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"),
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)4, "domainNotActiveError"),
      LIMIT_EXCEEDED_ERROR((short)5, "limitExceededError"),
      SERVICE_BUSY_ERROR((short)6, "serviceBusyError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          case 5: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          case 6: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          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, com.uber.cadence.RecordActivityTaskHeartbeatResponse.class)));
      tmpMap.put(_Fields.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RecordActivityTaskHeartbeatByID_result.class, metaDataMap);
    }

    public RecordActivityTaskHeartbeatByID_result() {
    }

    public RecordActivityTaskHeartbeatByID_result(
      com.uber.cadence.RecordActivityTaskHeartbeatResponse success,
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError,
      com.uber.cadence.LimitExceededError limitExceededError,
      com.uber.cadence.ServiceBusyError serviceBusyError)
    {
      this();
      this.success = success;
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.domainNotActiveError = domainNotActiveError;
      this.limitExceededError = limitExceededError;
      this.serviceBusyError = serviceBusyError;
    }

    /**
     * Performs a deep copy on other.
     */
    public RecordActivityTaskHeartbeatByID_result(RecordActivityTaskHeartbeatByID_result other) {
      if (other.isSetSuccess()) {
        this.success = new com.uber.cadence.RecordActivityTaskHeartbeatResponse(other.success);
      }
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.domainNotActiveError = null;
      this.limitExceededError = null;
      this.serviceBusyError = null;
    }

    public com.uber.cadence.RecordActivityTaskHeartbeatResponse getSuccess() {
      return this.success;
    }

    public RecordActivityTaskHeartbeatByID_result setSuccess(com.uber.cadence.RecordActivityTaskHeartbeatResponse 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 com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public RecordActivityTaskHeartbeatByID_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public RecordActivityTaskHeartbeatByID_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public RecordActivityTaskHeartbeatByID_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public RecordActivityTaskHeartbeatByID_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public RecordActivityTaskHeartbeatByID_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public RecordActivityTaskHeartbeatByID_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

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

      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      }
    }

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

      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(RecordActivityTaskHeartbeatByID_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_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          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_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      return list.hashCode();
    }

    @Override
    public int compareTo(RecordActivityTaskHeartbeatByID_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(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        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("RecordActivityTaskHeartbeatByID_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("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      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 RecordActivityTaskHeartbeatByID_resultStandardSchemeFactory implements SchemeFactory {
      public RecordActivityTaskHeartbeatByID_resultStandardScheme getScheme() {
        return new RecordActivityTaskHeartbeatByID_resultStandardScheme();
      }
    }

    private static class RecordActivityTaskHeartbeatByID_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RecordActivityTaskHeartbeatByID_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 com.uber.cadence.RecordActivityTaskHeartbeatResponse();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(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, RecordActivityTaskHeartbeatByID_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.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class RecordActivityTaskHeartbeatByID_resultTupleSchemeFactory implements SchemeFactory {
      public RecordActivityTaskHeartbeatByID_resultTupleScheme getScheme() {
        return new RecordActivityTaskHeartbeatByID_resultTupleScheme();
      }
    }

    private static class RecordActivityTaskHeartbeatByID_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, RecordActivityTaskHeartbeatByID_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetBadRequestError()) {
          optionals.set(1);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(2);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(3);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(4);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(5);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(6);
        }
        oprot.writeBitSet(optionals, 7);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RecordActivityTaskHeartbeatByID_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(7);
        if (incoming.get(0)) {
          struct.success = new com.uber.cadence.RecordActivityTaskHeartbeatResponse();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
        if (incoming.get(6)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
      }
    }

  }

  public static class RespondActivityTaskCompleted_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("RespondActivityTaskCompleted_args");

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

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

    public com.uber.cadence.RespondActivityTaskCompletedRequest completeRequest; // 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 {
      COMPLETE_REQUEST((short)1, "completeRequest");

      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: // COMPLETE_REQUEST
            return COMPLETE_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.COMPLETE_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("completeRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.RespondActivityTaskCompletedRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RespondActivityTaskCompleted_args.class, metaDataMap);
    }

    public RespondActivityTaskCompleted_args() {
    }

    public RespondActivityTaskCompleted_args(
      com.uber.cadence.RespondActivityTaskCompletedRequest completeRequest)
    {
      this();
      this.completeRequest = completeRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public RespondActivityTaskCompleted_args(RespondActivityTaskCompleted_args other) {
      if (other.isSetCompleteRequest()) {
        this.completeRequest = new com.uber.cadence.RespondActivityTaskCompletedRequest(other.completeRequest);
      }
    }

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

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

    public com.uber.cadence.RespondActivityTaskCompletedRequest getCompleteRequest() {
      return this.completeRequest;
    }

    public RespondActivityTaskCompleted_args setCompleteRequest(com.uber.cadence.RespondActivityTaskCompletedRequest completeRequest) {
      this.completeRequest = completeRequest;
      return this;
    }

    public void unsetCompleteRequest() {
      this.completeRequest = null;
    }

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

    public void setCompleteRequestIsSet(boolean value) {
      if (!value) {
        this.completeRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case COMPLETE_REQUEST:
        if (value == null) {
          unsetCompleteRequest();
        } else {
          setCompleteRequest((com.uber.cadence.RespondActivityTaskCompletedRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case COMPLETE_REQUEST:
        return getCompleteRequest();

      }
      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 COMPLETE_REQUEST:
        return isSetCompleteRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_completeRequest = true && this.isSetCompleteRequest();
      boolean that_present_completeRequest = true && that.isSetCompleteRequest();
      if (this_present_completeRequest || that_present_completeRequest) {
        if (!(this_present_completeRequest && that_present_completeRequest))
          return false;
        if (!this.completeRequest.equals(that.completeRequest))
          return false;
      }

      return true;
    }

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

      boolean present_completeRequest = true && (isSetCompleteRequest());
      list.add(present_completeRequest);
      if (present_completeRequest)
        list.add(completeRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCompleteRequest()).compareTo(other.isSetCompleteRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCompleteRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.completeRequest, other.completeRequest);
        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("RespondActivityTaskCompleted_args(");
      boolean first = true;

      sb.append("completeRequest:");
      if (this.completeRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.completeRequest);
      }
      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 (completeRequest != null) {
        completeRequest.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 RespondActivityTaskCompleted_argsStandardSchemeFactory implements SchemeFactory {
      public RespondActivityTaskCompleted_argsStandardScheme getScheme() {
        return new RespondActivityTaskCompleted_argsStandardScheme();
      }
    }

    private static class RespondActivityTaskCompleted_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RespondActivityTaskCompleted_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: // COMPLETE_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.completeRequest = new com.uber.cadence.RespondActivityTaskCompletedRequest();
                struct.completeRequest.read(iprot);
                struct.setCompleteRequestIsSet(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, RespondActivityTaskCompleted_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class RespondActivityTaskCompleted_argsTupleSchemeFactory implements SchemeFactory {
      public RespondActivityTaskCompleted_argsTupleScheme getScheme() {
        return new RespondActivityTaskCompleted_argsTupleScheme();
      }
    }

    private static class RespondActivityTaskCompleted_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RespondActivityTaskCompleted_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.completeRequest = new com.uber.cadence.RespondActivityTaskCompletedRequest();
          struct.completeRequest.read(iprot);
          struct.setCompleteRequestIsSet(true);
        }
      }
    }

  }

  public static class RespondActivityTaskCompleted_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("RespondActivityTaskCompleted_result");

    private static final org.apache.thrift.protocol.TField BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // 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 {
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)4, "domainNotActiveError"),
      LIMIT_EXCEEDED_ERROR((short)5, "limitExceededError"),
      SERVICE_BUSY_ERROR((short)6, "serviceBusyError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          case 5: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          case 6: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          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.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RespondActivityTaskCompleted_result.class, metaDataMap);
    }

    public RespondActivityTaskCompleted_result() {
    }

    public RespondActivityTaskCompleted_result(
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError,
      com.uber.cadence.LimitExceededError limitExceededError,
      com.uber.cadence.ServiceBusyError serviceBusyError)
    {
      this();
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.domainNotActiveError = domainNotActiveError;
      this.limitExceededError = limitExceededError;
      this.serviceBusyError = serviceBusyError;
    }

    /**
     * Performs a deep copy on other.
     */
    public RespondActivityTaskCompleted_result(RespondActivityTaskCompleted_result other) {
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
    }

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

    @Override
    public void clear() {
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.domainNotActiveError = null;
      this.limitExceededError = null;
      this.serviceBusyError = null;
    }

    public com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public RespondActivityTaskCompleted_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public RespondActivityTaskCompleted_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public RespondActivityTaskCompleted_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public RespondActivityTaskCompleted_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public RespondActivityTaskCompleted_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public RespondActivityTaskCompleted_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      return true;
    }

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

      boolean present_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        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("RespondActivityTaskCompleted_result(");
      boolean first = true;

      sb.append("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      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 {
        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 RespondActivityTaskCompleted_resultStandardSchemeFactory implements SchemeFactory {
      public RespondActivityTaskCompleted_resultStandardScheme getScheme() {
        return new RespondActivityTaskCompleted_resultStandardScheme();
      }
    }

    private static class RespondActivityTaskCompleted_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RespondActivityTaskCompleted_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 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(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, RespondActivityTaskCompleted_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class RespondActivityTaskCompleted_resultTupleSchemeFactory implements SchemeFactory {
      public RespondActivityTaskCompleted_resultTupleScheme getScheme() {
        return new RespondActivityTaskCompleted_resultTupleScheme();
      }
    }

    private static class RespondActivityTaskCompleted_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, RespondActivityTaskCompleted_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetBadRequestError()) {
          optionals.set(0);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(1);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(2);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(3);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(4);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(5);
        }
        oprot.writeBitSet(optionals, 6);
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RespondActivityTaskCompleted_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(6);
        if (incoming.get(0)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(1)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
      }
    }

  }

  public static class RespondActivityTaskCompletedByID_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("RespondActivityTaskCompletedByID_args");

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

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

    public com.uber.cadence.RespondActivityTaskCompletedByIDRequest completeRequest; // 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 {
      COMPLETE_REQUEST((short)1, "completeRequest");

      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: // COMPLETE_REQUEST
            return COMPLETE_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.COMPLETE_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("completeRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.RespondActivityTaskCompletedByIDRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RespondActivityTaskCompletedByID_args.class, metaDataMap);
    }

    public RespondActivityTaskCompletedByID_args() {
    }

    public RespondActivityTaskCompletedByID_args(
      com.uber.cadence.RespondActivityTaskCompletedByIDRequest completeRequest)
    {
      this();
      this.completeRequest = completeRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public RespondActivityTaskCompletedByID_args(RespondActivityTaskCompletedByID_args other) {
      if (other.isSetCompleteRequest()) {
        this.completeRequest = new com.uber.cadence.RespondActivityTaskCompletedByIDRequest(other.completeRequest);
      }
    }

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

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

    public com.uber.cadence.RespondActivityTaskCompletedByIDRequest getCompleteRequest() {
      return this.completeRequest;
    }

    public RespondActivityTaskCompletedByID_args setCompleteRequest(com.uber.cadence.RespondActivityTaskCompletedByIDRequest completeRequest) {
      this.completeRequest = completeRequest;
      return this;
    }

    public void unsetCompleteRequest() {
      this.completeRequest = null;
    }

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

    public void setCompleteRequestIsSet(boolean value) {
      if (!value) {
        this.completeRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case COMPLETE_REQUEST:
        if (value == null) {
          unsetCompleteRequest();
        } else {
          setCompleteRequest((com.uber.cadence.RespondActivityTaskCompletedByIDRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case COMPLETE_REQUEST:
        return getCompleteRequest();

      }
      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 COMPLETE_REQUEST:
        return isSetCompleteRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_completeRequest = true && this.isSetCompleteRequest();
      boolean that_present_completeRequest = true && that.isSetCompleteRequest();
      if (this_present_completeRequest || that_present_completeRequest) {
        if (!(this_present_completeRequest && that_present_completeRequest))
          return false;
        if (!this.completeRequest.equals(that.completeRequest))
          return false;
      }

      return true;
    }

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

      boolean present_completeRequest = true && (isSetCompleteRequest());
      list.add(present_completeRequest);
      if (present_completeRequest)
        list.add(completeRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCompleteRequest()).compareTo(other.isSetCompleteRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCompleteRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.completeRequest, other.completeRequest);
        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("RespondActivityTaskCompletedByID_args(");
      boolean first = true;

      sb.append("completeRequest:");
      if (this.completeRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.completeRequest);
      }
      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 (completeRequest != null) {
        completeRequest.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 RespondActivityTaskCompletedByID_argsStandardSchemeFactory implements SchemeFactory {
      public RespondActivityTaskCompletedByID_argsStandardScheme getScheme() {
        return new RespondActivityTaskCompletedByID_argsStandardScheme();
      }
    }

    private static class RespondActivityTaskCompletedByID_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RespondActivityTaskCompletedByID_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: // COMPLETE_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.completeRequest = new com.uber.cadence.RespondActivityTaskCompletedByIDRequest();
                struct.completeRequest.read(iprot);
                struct.setCompleteRequestIsSet(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, RespondActivityTaskCompletedByID_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class RespondActivityTaskCompletedByID_argsTupleSchemeFactory implements SchemeFactory {
      public RespondActivityTaskCompletedByID_argsTupleScheme getScheme() {
        return new RespondActivityTaskCompletedByID_argsTupleScheme();
      }
    }

    private static class RespondActivityTaskCompletedByID_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RespondActivityTaskCompletedByID_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.completeRequest = new com.uber.cadence.RespondActivityTaskCompletedByIDRequest();
          struct.completeRequest.read(iprot);
          struct.setCompleteRequestIsSet(true);
        }
      }
    }

  }

  public static class RespondActivityTaskCompletedByID_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("RespondActivityTaskCompletedByID_result");

    private static final org.apache.thrift.protocol.TField BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // 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 {
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)4, "domainNotActiveError"),
      LIMIT_EXCEEDED_ERROR((short)5, "limitExceededError"),
      SERVICE_BUSY_ERROR((short)6, "serviceBusyError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          case 5: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          case 6: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          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.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RespondActivityTaskCompletedByID_result.class, metaDataMap);
    }

    public RespondActivityTaskCompletedByID_result() {
    }

    public RespondActivityTaskCompletedByID_result(
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError,
      com.uber.cadence.LimitExceededError limitExceededError,
      com.uber.cadence.ServiceBusyError serviceBusyError)
    {
      this();
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.domainNotActiveError = domainNotActiveError;
      this.limitExceededError = limitExceededError;
      this.serviceBusyError = serviceBusyError;
    }

    /**
     * Performs a deep copy on other.
     */
    public RespondActivityTaskCompletedByID_result(RespondActivityTaskCompletedByID_result other) {
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
    }

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

    @Override
    public void clear() {
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.domainNotActiveError = null;
      this.limitExceededError = null;
      this.serviceBusyError = null;
    }

    public com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public RespondActivityTaskCompletedByID_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public RespondActivityTaskCompletedByID_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public RespondActivityTaskCompletedByID_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public RespondActivityTaskCompletedByID_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public RespondActivityTaskCompletedByID_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public RespondActivityTaskCompletedByID_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      return true;
    }

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

      boolean present_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        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("RespondActivityTaskCompletedByID_result(");
      boolean first = true;

      sb.append("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      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 {
        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 RespondActivityTaskCompletedByID_resultStandardSchemeFactory implements SchemeFactory {
      public RespondActivityTaskCompletedByID_resultStandardScheme getScheme() {
        return new RespondActivityTaskCompletedByID_resultStandardScheme();
      }
    }

    private static class RespondActivityTaskCompletedByID_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RespondActivityTaskCompletedByID_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 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(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, RespondActivityTaskCompletedByID_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class RespondActivityTaskCompletedByID_resultTupleSchemeFactory implements SchemeFactory {
      public RespondActivityTaskCompletedByID_resultTupleScheme getScheme() {
        return new RespondActivityTaskCompletedByID_resultTupleScheme();
      }
    }

    private static class RespondActivityTaskCompletedByID_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, RespondActivityTaskCompletedByID_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetBadRequestError()) {
          optionals.set(0);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(1);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(2);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(3);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(4);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(5);
        }
        oprot.writeBitSet(optionals, 6);
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RespondActivityTaskCompletedByID_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(6);
        if (incoming.get(0)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(1)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
      }
    }

  }

  public static class RespondActivityTaskFailed_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("RespondActivityTaskFailed_args");

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

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

    public com.uber.cadence.RespondActivityTaskFailedRequest failRequest; // 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 {
      FAIL_REQUEST((short)1, "failRequest");

      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: // FAIL_REQUEST
            return FAIL_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.FAIL_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("failRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.RespondActivityTaskFailedRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RespondActivityTaskFailed_args.class, metaDataMap);
    }

    public RespondActivityTaskFailed_args() {
    }

    public RespondActivityTaskFailed_args(
      com.uber.cadence.RespondActivityTaskFailedRequest failRequest)
    {
      this();
      this.failRequest = failRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public RespondActivityTaskFailed_args(RespondActivityTaskFailed_args other) {
      if (other.isSetFailRequest()) {
        this.failRequest = new com.uber.cadence.RespondActivityTaskFailedRequest(other.failRequest);
      }
    }

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

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

    public com.uber.cadence.RespondActivityTaskFailedRequest getFailRequest() {
      return this.failRequest;
    }

    public RespondActivityTaskFailed_args setFailRequest(com.uber.cadence.RespondActivityTaskFailedRequest failRequest) {
      this.failRequest = failRequest;
      return this;
    }

    public void unsetFailRequest() {
      this.failRequest = null;
    }

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

    public void setFailRequestIsSet(boolean value) {
      if (!value) {
        this.failRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case FAIL_REQUEST:
        if (value == null) {
          unsetFailRequest();
        } else {
          setFailRequest((com.uber.cadence.RespondActivityTaskFailedRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case FAIL_REQUEST:
        return getFailRequest();

      }
      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 FAIL_REQUEST:
        return isSetFailRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_failRequest = true && this.isSetFailRequest();
      boolean that_present_failRequest = true && that.isSetFailRequest();
      if (this_present_failRequest || that_present_failRequest) {
        if (!(this_present_failRequest && that_present_failRequest))
          return false;
        if (!this.failRequest.equals(that.failRequest))
          return false;
      }

      return true;
    }

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

      boolean present_failRequest = true && (isSetFailRequest());
      list.add(present_failRequest);
      if (present_failRequest)
        list.add(failRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetFailRequest()).compareTo(other.isSetFailRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFailRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failRequest, other.failRequest);
        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("RespondActivityTaskFailed_args(");
      boolean first = true;

      sb.append("failRequest:");
      if (this.failRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.failRequest);
      }
      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 (failRequest != null) {
        failRequest.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 RespondActivityTaskFailed_argsStandardSchemeFactory implements SchemeFactory {
      public RespondActivityTaskFailed_argsStandardScheme getScheme() {
        return new RespondActivityTaskFailed_argsStandardScheme();
      }
    }

    private static class RespondActivityTaskFailed_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RespondActivityTaskFailed_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: // FAIL_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.failRequest = new com.uber.cadence.RespondActivityTaskFailedRequest();
                struct.failRequest.read(iprot);
                struct.setFailRequestIsSet(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, RespondActivityTaskFailed_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class RespondActivityTaskFailed_argsTupleSchemeFactory implements SchemeFactory {
      public RespondActivityTaskFailed_argsTupleScheme getScheme() {
        return new RespondActivityTaskFailed_argsTupleScheme();
      }
    }

    private static class RespondActivityTaskFailed_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RespondActivityTaskFailed_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.failRequest = new com.uber.cadence.RespondActivityTaskFailedRequest();
          struct.failRequest.read(iprot);
          struct.setFailRequestIsSet(true);
        }
      }
    }

  }

  public static class RespondActivityTaskFailed_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("RespondActivityTaskFailed_result");

    private static final org.apache.thrift.protocol.TField BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // 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 {
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)4, "domainNotActiveError"),
      LIMIT_EXCEEDED_ERROR((short)5, "limitExceededError"),
      SERVICE_BUSY_ERROR((short)6, "serviceBusyError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          case 5: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          case 6: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          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.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RespondActivityTaskFailed_result.class, metaDataMap);
    }

    public RespondActivityTaskFailed_result() {
    }

    public RespondActivityTaskFailed_result(
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError,
      com.uber.cadence.LimitExceededError limitExceededError,
      com.uber.cadence.ServiceBusyError serviceBusyError)
    {
      this();
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.domainNotActiveError = domainNotActiveError;
      this.limitExceededError = limitExceededError;
      this.serviceBusyError = serviceBusyError;
    }

    /**
     * Performs a deep copy on other.
     */
    public RespondActivityTaskFailed_result(RespondActivityTaskFailed_result other) {
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
    }

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

    @Override
    public void clear() {
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.domainNotActiveError = null;
      this.limitExceededError = null;
      this.serviceBusyError = null;
    }

    public com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public RespondActivityTaskFailed_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public RespondActivityTaskFailed_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public RespondActivityTaskFailed_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public RespondActivityTaskFailed_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public RespondActivityTaskFailed_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public RespondActivityTaskFailed_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      return true;
    }

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

      boolean present_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        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("RespondActivityTaskFailed_result(");
      boolean first = true;

      sb.append("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      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 {
        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 RespondActivityTaskFailed_resultStandardSchemeFactory implements SchemeFactory {
      public RespondActivityTaskFailed_resultStandardScheme getScheme() {
        return new RespondActivityTaskFailed_resultStandardScheme();
      }
    }

    private static class RespondActivityTaskFailed_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RespondActivityTaskFailed_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 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(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, RespondActivityTaskFailed_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class RespondActivityTaskFailed_resultTupleSchemeFactory implements SchemeFactory {
      public RespondActivityTaskFailed_resultTupleScheme getScheme() {
        return new RespondActivityTaskFailed_resultTupleScheme();
      }
    }

    private static class RespondActivityTaskFailed_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, RespondActivityTaskFailed_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetBadRequestError()) {
          optionals.set(0);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(1);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(2);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(3);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(4);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(5);
        }
        oprot.writeBitSet(optionals, 6);
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RespondActivityTaskFailed_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(6);
        if (incoming.get(0)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(1)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
      }
    }

  }

  public static class RespondActivityTaskFailedByID_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("RespondActivityTaskFailedByID_args");

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

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

    public com.uber.cadence.RespondActivityTaskFailedByIDRequest failRequest; // 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 {
      FAIL_REQUEST((short)1, "failRequest");

      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: // FAIL_REQUEST
            return FAIL_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.FAIL_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("failRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.RespondActivityTaskFailedByIDRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RespondActivityTaskFailedByID_args.class, metaDataMap);
    }

    public RespondActivityTaskFailedByID_args() {
    }

    public RespondActivityTaskFailedByID_args(
      com.uber.cadence.RespondActivityTaskFailedByIDRequest failRequest)
    {
      this();
      this.failRequest = failRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public RespondActivityTaskFailedByID_args(RespondActivityTaskFailedByID_args other) {
      if (other.isSetFailRequest()) {
        this.failRequest = new com.uber.cadence.RespondActivityTaskFailedByIDRequest(other.failRequest);
      }
    }

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

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

    public com.uber.cadence.RespondActivityTaskFailedByIDRequest getFailRequest() {
      return this.failRequest;
    }

    public RespondActivityTaskFailedByID_args setFailRequest(com.uber.cadence.RespondActivityTaskFailedByIDRequest failRequest) {
      this.failRequest = failRequest;
      return this;
    }

    public void unsetFailRequest() {
      this.failRequest = null;
    }

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

    public void setFailRequestIsSet(boolean value) {
      if (!value) {
        this.failRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case FAIL_REQUEST:
        if (value == null) {
          unsetFailRequest();
        } else {
          setFailRequest((com.uber.cadence.RespondActivityTaskFailedByIDRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case FAIL_REQUEST:
        return getFailRequest();

      }
      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 FAIL_REQUEST:
        return isSetFailRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_failRequest = true && this.isSetFailRequest();
      boolean that_present_failRequest = true && that.isSetFailRequest();
      if (this_present_failRequest || that_present_failRequest) {
        if (!(this_present_failRequest && that_present_failRequest))
          return false;
        if (!this.failRequest.equals(that.failRequest))
          return false;
      }

      return true;
    }

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

      boolean present_failRequest = true && (isSetFailRequest());
      list.add(present_failRequest);
      if (present_failRequest)
        list.add(failRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetFailRequest()).compareTo(other.isSetFailRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFailRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failRequest, other.failRequest);
        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("RespondActivityTaskFailedByID_args(");
      boolean first = true;

      sb.append("failRequest:");
      if (this.failRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.failRequest);
      }
      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 (failRequest != null) {
        failRequest.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 RespondActivityTaskFailedByID_argsStandardSchemeFactory implements SchemeFactory {
      public RespondActivityTaskFailedByID_argsStandardScheme getScheme() {
        return new RespondActivityTaskFailedByID_argsStandardScheme();
      }
    }

    private static class RespondActivityTaskFailedByID_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RespondActivityTaskFailedByID_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: // FAIL_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.failRequest = new com.uber.cadence.RespondActivityTaskFailedByIDRequest();
                struct.failRequest.read(iprot);
                struct.setFailRequestIsSet(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, RespondActivityTaskFailedByID_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class RespondActivityTaskFailedByID_argsTupleSchemeFactory implements SchemeFactory {
      public RespondActivityTaskFailedByID_argsTupleScheme getScheme() {
        return new RespondActivityTaskFailedByID_argsTupleScheme();
      }
    }

    private static class RespondActivityTaskFailedByID_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RespondActivityTaskFailedByID_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.failRequest = new com.uber.cadence.RespondActivityTaskFailedByIDRequest();
          struct.failRequest.read(iprot);
          struct.setFailRequestIsSet(true);
        }
      }
    }

  }

  public static class RespondActivityTaskFailedByID_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("RespondActivityTaskFailedByID_result");

    private static final org.apache.thrift.protocol.TField BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // 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 {
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)4, "domainNotActiveError"),
      LIMIT_EXCEEDED_ERROR((short)5, "limitExceededError"),
      SERVICE_BUSY_ERROR((short)6, "serviceBusyError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          case 5: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          case 6: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          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.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RespondActivityTaskFailedByID_result.class, metaDataMap);
    }

    public RespondActivityTaskFailedByID_result() {
    }

    public RespondActivityTaskFailedByID_result(
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError,
      com.uber.cadence.LimitExceededError limitExceededError,
      com.uber.cadence.ServiceBusyError serviceBusyError)
    {
      this();
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.domainNotActiveError = domainNotActiveError;
      this.limitExceededError = limitExceededError;
      this.serviceBusyError = serviceBusyError;
    }

    /**
     * Performs a deep copy on other.
     */
    public RespondActivityTaskFailedByID_result(RespondActivityTaskFailedByID_result other) {
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
    }

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

    @Override
    public void clear() {
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.domainNotActiveError = null;
      this.limitExceededError = null;
      this.serviceBusyError = null;
    }

    public com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public RespondActivityTaskFailedByID_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public RespondActivityTaskFailedByID_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public RespondActivityTaskFailedByID_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public RespondActivityTaskFailedByID_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public RespondActivityTaskFailedByID_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public RespondActivityTaskFailedByID_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      return true;
    }

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

      boolean present_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        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("RespondActivityTaskFailedByID_result(");
      boolean first = true;

      sb.append("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      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 {
        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 RespondActivityTaskFailedByID_resultStandardSchemeFactory implements SchemeFactory {
      public RespondActivityTaskFailedByID_resultStandardScheme getScheme() {
        return new RespondActivityTaskFailedByID_resultStandardScheme();
      }
    }

    private static class RespondActivityTaskFailedByID_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RespondActivityTaskFailedByID_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 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(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, RespondActivityTaskFailedByID_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class RespondActivityTaskFailedByID_resultTupleSchemeFactory implements SchemeFactory {
      public RespondActivityTaskFailedByID_resultTupleScheme getScheme() {
        return new RespondActivityTaskFailedByID_resultTupleScheme();
      }
    }

    private static class RespondActivityTaskFailedByID_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, RespondActivityTaskFailedByID_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetBadRequestError()) {
          optionals.set(0);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(1);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(2);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(3);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(4);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(5);
        }
        oprot.writeBitSet(optionals, 6);
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RespondActivityTaskFailedByID_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(6);
        if (incoming.get(0)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(1)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
      }
    }

  }

  public static class RespondActivityTaskCanceled_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("RespondActivityTaskCanceled_args");

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

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

    public com.uber.cadence.RespondActivityTaskCanceledRequest canceledRequest; // 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 {
      CANCELED_REQUEST((short)1, "canceledRequest");

      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: // CANCELED_REQUEST
            return CANCELED_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.CANCELED_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("canceledRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.RespondActivityTaskCanceledRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RespondActivityTaskCanceled_args.class, metaDataMap);
    }

    public RespondActivityTaskCanceled_args() {
    }

    public RespondActivityTaskCanceled_args(
      com.uber.cadence.RespondActivityTaskCanceledRequest canceledRequest)
    {
      this();
      this.canceledRequest = canceledRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public RespondActivityTaskCanceled_args(RespondActivityTaskCanceled_args other) {
      if (other.isSetCanceledRequest()) {
        this.canceledRequest = new com.uber.cadence.RespondActivityTaskCanceledRequest(other.canceledRequest);
      }
    }

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

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

    public com.uber.cadence.RespondActivityTaskCanceledRequest getCanceledRequest() {
      return this.canceledRequest;
    }

    public RespondActivityTaskCanceled_args setCanceledRequest(com.uber.cadence.RespondActivityTaskCanceledRequest canceledRequest) {
      this.canceledRequest = canceledRequest;
      return this;
    }

    public void unsetCanceledRequest() {
      this.canceledRequest = null;
    }

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

    public void setCanceledRequestIsSet(boolean value) {
      if (!value) {
        this.canceledRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CANCELED_REQUEST:
        if (value == null) {
          unsetCanceledRequest();
        } else {
          setCanceledRequest((com.uber.cadence.RespondActivityTaskCanceledRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CANCELED_REQUEST:
        return getCanceledRequest();

      }
      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 CANCELED_REQUEST:
        return isSetCanceledRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_canceledRequest = true && this.isSetCanceledRequest();
      boolean that_present_canceledRequest = true && that.isSetCanceledRequest();
      if (this_present_canceledRequest || that_present_canceledRequest) {
        if (!(this_present_canceledRequest && that_present_canceledRequest))
          return false;
        if (!this.canceledRequest.equals(that.canceledRequest))
          return false;
      }

      return true;
    }

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

      boolean present_canceledRequest = true && (isSetCanceledRequest());
      list.add(present_canceledRequest);
      if (present_canceledRequest)
        list.add(canceledRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCanceledRequest()).compareTo(other.isSetCanceledRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCanceledRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.canceledRequest, other.canceledRequest);
        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("RespondActivityTaskCanceled_args(");
      boolean first = true;

      sb.append("canceledRequest:");
      if (this.canceledRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.canceledRequest);
      }
      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 (canceledRequest != null) {
        canceledRequest.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 RespondActivityTaskCanceled_argsStandardSchemeFactory implements SchemeFactory {
      public RespondActivityTaskCanceled_argsStandardScheme getScheme() {
        return new RespondActivityTaskCanceled_argsStandardScheme();
      }
    }

    private static class RespondActivityTaskCanceled_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RespondActivityTaskCanceled_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: // CANCELED_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.canceledRequest = new com.uber.cadence.RespondActivityTaskCanceledRequest();
                struct.canceledRequest.read(iprot);
                struct.setCanceledRequestIsSet(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, RespondActivityTaskCanceled_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class RespondActivityTaskCanceled_argsTupleSchemeFactory implements SchemeFactory {
      public RespondActivityTaskCanceled_argsTupleScheme getScheme() {
        return new RespondActivityTaskCanceled_argsTupleScheme();
      }
    }

    private static class RespondActivityTaskCanceled_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RespondActivityTaskCanceled_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.canceledRequest = new com.uber.cadence.RespondActivityTaskCanceledRequest();
          struct.canceledRequest.read(iprot);
          struct.setCanceledRequestIsSet(true);
        }
      }
    }

  }

  public static class RespondActivityTaskCanceled_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("RespondActivityTaskCanceled_result");

    private static final org.apache.thrift.protocol.TField BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // 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 {
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)4, "domainNotActiveError"),
      LIMIT_EXCEEDED_ERROR((short)5, "limitExceededError"),
      SERVICE_BUSY_ERROR((short)6, "serviceBusyError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          case 5: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          case 6: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          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.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RespondActivityTaskCanceled_result.class, metaDataMap);
    }

    public RespondActivityTaskCanceled_result() {
    }

    public RespondActivityTaskCanceled_result(
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError,
      com.uber.cadence.LimitExceededError limitExceededError,
      com.uber.cadence.ServiceBusyError serviceBusyError)
    {
      this();
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.domainNotActiveError = domainNotActiveError;
      this.limitExceededError = limitExceededError;
      this.serviceBusyError = serviceBusyError;
    }

    /**
     * Performs a deep copy on other.
     */
    public RespondActivityTaskCanceled_result(RespondActivityTaskCanceled_result other) {
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
    }

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

    @Override
    public void clear() {
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.domainNotActiveError = null;
      this.limitExceededError = null;
      this.serviceBusyError = null;
    }

    public com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public RespondActivityTaskCanceled_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public RespondActivityTaskCanceled_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public RespondActivityTaskCanceled_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public RespondActivityTaskCanceled_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public RespondActivityTaskCanceled_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public RespondActivityTaskCanceled_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      return true;
    }

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

      boolean present_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        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("RespondActivityTaskCanceled_result(");
      boolean first = true;

      sb.append("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      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 {
        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 RespondActivityTaskCanceled_resultStandardSchemeFactory implements SchemeFactory {
      public RespondActivityTaskCanceled_resultStandardScheme getScheme() {
        return new RespondActivityTaskCanceled_resultStandardScheme();
      }
    }

    private static class RespondActivityTaskCanceled_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RespondActivityTaskCanceled_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 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(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, RespondActivityTaskCanceled_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class RespondActivityTaskCanceled_resultTupleSchemeFactory implements SchemeFactory {
      public RespondActivityTaskCanceled_resultTupleScheme getScheme() {
        return new RespondActivityTaskCanceled_resultTupleScheme();
      }
    }

    private static class RespondActivityTaskCanceled_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, RespondActivityTaskCanceled_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetBadRequestError()) {
          optionals.set(0);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(1);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(2);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(3);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(4);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(5);
        }
        oprot.writeBitSet(optionals, 6);
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RespondActivityTaskCanceled_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(6);
        if (incoming.get(0)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(1)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
      }
    }

  }

  public static class RespondActivityTaskCanceledByID_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("RespondActivityTaskCanceledByID_args");

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

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

    public com.uber.cadence.RespondActivityTaskCanceledByIDRequest canceledRequest; // 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 {
      CANCELED_REQUEST((short)1, "canceledRequest");

      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: // CANCELED_REQUEST
            return CANCELED_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.CANCELED_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("canceledRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.RespondActivityTaskCanceledByIDRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RespondActivityTaskCanceledByID_args.class, metaDataMap);
    }

    public RespondActivityTaskCanceledByID_args() {
    }

    public RespondActivityTaskCanceledByID_args(
      com.uber.cadence.RespondActivityTaskCanceledByIDRequest canceledRequest)
    {
      this();
      this.canceledRequest = canceledRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public RespondActivityTaskCanceledByID_args(RespondActivityTaskCanceledByID_args other) {
      if (other.isSetCanceledRequest()) {
        this.canceledRequest = new com.uber.cadence.RespondActivityTaskCanceledByIDRequest(other.canceledRequest);
      }
    }

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

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

    public com.uber.cadence.RespondActivityTaskCanceledByIDRequest getCanceledRequest() {
      return this.canceledRequest;
    }

    public RespondActivityTaskCanceledByID_args setCanceledRequest(com.uber.cadence.RespondActivityTaskCanceledByIDRequest canceledRequest) {
      this.canceledRequest = canceledRequest;
      return this;
    }

    public void unsetCanceledRequest() {
      this.canceledRequest = null;
    }

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

    public void setCanceledRequestIsSet(boolean value) {
      if (!value) {
        this.canceledRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CANCELED_REQUEST:
        if (value == null) {
          unsetCanceledRequest();
        } else {
          setCanceledRequest((com.uber.cadence.RespondActivityTaskCanceledByIDRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CANCELED_REQUEST:
        return getCanceledRequest();

      }
      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 CANCELED_REQUEST:
        return isSetCanceledRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_canceledRequest = true && this.isSetCanceledRequest();
      boolean that_present_canceledRequest = true && that.isSetCanceledRequest();
      if (this_present_canceledRequest || that_present_canceledRequest) {
        if (!(this_present_canceledRequest && that_present_canceledRequest))
          return false;
        if (!this.canceledRequest.equals(that.canceledRequest))
          return false;
      }

      return true;
    }

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

      boolean present_canceledRequest = true && (isSetCanceledRequest());
      list.add(present_canceledRequest);
      if (present_canceledRequest)
        list.add(canceledRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCanceledRequest()).compareTo(other.isSetCanceledRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCanceledRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.canceledRequest, other.canceledRequest);
        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("RespondActivityTaskCanceledByID_args(");
      boolean first = true;

      sb.append("canceledRequest:");
      if (this.canceledRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.canceledRequest);
      }
      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 (canceledRequest != null) {
        canceledRequest.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 RespondActivityTaskCanceledByID_argsStandardSchemeFactory implements SchemeFactory {
      public RespondActivityTaskCanceledByID_argsStandardScheme getScheme() {
        return new RespondActivityTaskCanceledByID_argsStandardScheme();
      }
    }

    private static class RespondActivityTaskCanceledByID_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RespondActivityTaskCanceledByID_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: // CANCELED_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.canceledRequest = new com.uber.cadence.RespondActivityTaskCanceledByIDRequest();
                struct.canceledRequest.read(iprot);
                struct.setCanceledRequestIsSet(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, RespondActivityTaskCanceledByID_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class RespondActivityTaskCanceledByID_argsTupleSchemeFactory implements SchemeFactory {
      public RespondActivityTaskCanceledByID_argsTupleScheme getScheme() {
        return new RespondActivityTaskCanceledByID_argsTupleScheme();
      }
    }

    private static class RespondActivityTaskCanceledByID_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RespondActivityTaskCanceledByID_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.canceledRequest = new com.uber.cadence.RespondActivityTaskCanceledByIDRequest();
          struct.canceledRequest.read(iprot);
          struct.setCanceledRequestIsSet(true);
        }
      }
    }

  }

  public static class RespondActivityTaskCanceledByID_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("RespondActivityTaskCanceledByID_result");

    private static final org.apache.thrift.protocol.TField BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // 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 {
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)4, "domainNotActiveError"),
      LIMIT_EXCEEDED_ERROR((short)5, "limitExceededError"),
      SERVICE_BUSY_ERROR((short)6, "serviceBusyError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          case 5: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          case 6: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          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.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RespondActivityTaskCanceledByID_result.class, metaDataMap);
    }

    public RespondActivityTaskCanceledByID_result() {
    }

    public RespondActivityTaskCanceledByID_result(
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError,
      com.uber.cadence.LimitExceededError limitExceededError,
      com.uber.cadence.ServiceBusyError serviceBusyError)
    {
      this();
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.domainNotActiveError = domainNotActiveError;
      this.limitExceededError = limitExceededError;
      this.serviceBusyError = serviceBusyError;
    }

    /**
     * Performs a deep copy on other.
     */
    public RespondActivityTaskCanceledByID_result(RespondActivityTaskCanceledByID_result other) {
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
    }

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

    @Override
    public void clear() {
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.domainNotActiveError = null;
      this.limitExceededError = null;
      this.serviceBusyError = null;
    }

    public com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public RespondActivityTaskCanceledByID_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public RespondActivityTaskCanceledByID_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public RespondActivityTaskCanceledByID_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public RespondActivityTaskCanceledByID_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public RespondActivityTaskCanceledByID_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public RespondActivityTaskCanceledByID_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      return true;
    }

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

      boolean present_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        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("RespondActivityTaskCanceledByID_result(");
      boolean first = true;

      sb.append("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      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 {
        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 RespondActivityTaskCanceledByID_resultStandardSchemeFactory implements SchemeFactory {
      public RespondActivityTaskCanceledByID_resultStandardScheme getScheme() {
        return new RespondActivityTaskCanceledByID_resultStandardScheme();
      }
    }

    private static class RespondActivityTaskCanceledByID_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RespondActivityTaskCanceledByID_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 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(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, RespondActivityTaskCanceledByID_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class RespondActivityTaskCanceledByID_resultTupleSchemeFactory implements SchemeFactory {
      public RespondActivityTaskCanceledByID_resultTupleScheme getScheme() {
        return new RespondActivityTaskCanceledByID_resultTupleScheme();
      }
    }

    private static class RespondActivityTaskCanceledByID_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, RespondActivityTaskCanceledByID_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetBadRequestError()) {
          optionals.set(0);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(1);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(2);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(3);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(4);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(5);
        }
        oprot.writeBitSet(optionals, 6);
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RespondActivityTaskCanceledByID_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(6);
        if (incoming.get(0)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(1)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
      }
    }

  }

  public static class RequestCancelWorkflowExecution_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("RequestCancelWorkflowExecution_args");

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

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

    public com.uber.cadence.RequestCancelWorkflowExecutionRequest cancelRequest; // 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 {
      CANCEL_REQUEST((short)1, "cancelRequest");

      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: // CANCEL_REQUEST
            return CANCEL_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.CANCEL_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("cancelRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.RequestCancelWorkflowExecutionRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RequestCancelWorkflowExecution_args.class, metaDataMap);
    }

    public RequestCancelWorkflowExecution_args() {
    }

    public RequestCancelWorkflowExecution_args(
      com.uber.cadence.RequestCancelWorkflowExecutionRequest cancelRequest)
    {
      this();
      this.cancelRequest = cancelRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public RequestCancelWorkflowExecution_args(RequestCancelWorkflowExecution_args other) {
      if (other.isSetCancelRequest()) {
        this.cancelRequest = new com.uber.cadence.RequestCancelWorkflowExecutionRequest(other.cancelRequest);
      }
    }

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

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

    public com.uber.cadence.RequestCancelWorkflowExecutionRequest getCancelRequest() {
      return this.cancelRequest;
    }

    public RequestCancelWorkflowExecution_args setCancelRequest(com.uber.cadence.RequestCancelWorkflowExecutionRequest cancelRequest) {
      this.cancelRequest = cancelRequest;
      return this;
    }

    public void unsetCancelRequest() {
      this.cancelRequest = null;
    }

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

    public void setCancelRequestIsSet(boolean value) {
      if (!value) {
        this.cancelRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CANCEL_REQUEST:
        if (value == null) {
          unsetCancelRequest();
        } else {
          setCancelRequest((com.uber.cadence.RequestCancelWorkflowExecutionRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CANCEL_REQUEST:
        return getCancelRequest();

      }
      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 CANCEL_REQUEST:
        return isSetCancelRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_cancelRequest = true && this.isSetCancelRequest();
      boolean that_present_cancelRequest = true && that.isSetCancelRequest();
      if (this_present_cancelRequest || that_present_cancelRequest) {
        if (!(this_present_cancelRequest && that_present_cancelRequest))
          return false;
        if (!this.cancelRequest.equals(that.cancelRequest))
          return false;
      }

      return true;
    }

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

      boolean present_cancelRequest = true && (isSetCancelRequest());
      list.add(present_cancelRequest);
      if (present_cancelRequest)
        list.add(cancelRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCancelRequest()).compareTo(other.isSetCancelRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCancelRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cancelRequest, other.cancelRequest);
        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("RequestCancelWorkflowExecution_args(");
      boolean first = true;

      sb.append("cancelRequest:");
      if (this.cancelRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.cancelRequest);
      }
      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 (cancelRequest != null) {
        cancelRequest.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 RequestCancelWorkflowExecution_argsStandardSchemeFactory implements SchemeFactory {
      public RequestCancelWorkflowExecution_argsStandardScheme getScheme() {
        return new RequestCancelWorkflowExecution_argsStandardScheme();
      }
    }

    private static class RequestCancelWorkflowExecution_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RequestCancelWorkflowExecution_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: // CANCEL_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.cancelRequest = new com.uber.cadence.RequestCancelWorkflowExecutionRequest();
                struct.cancelRequest.read(iprot);
                struct.setCancelRequestIsSet(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, RequestCancelWorkflowExecution_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class RequestCancelWorkflowExecution_argsTupleSchemeFactory implements SchemeFactory {
      public RequestCancelWorkflowExecution_argsTupleScheme getScheme() {
        return new RequestCancelWorkflowExecution_argsTupleScheme();
      }
    }

    private static class RequestCancelWorkflowExecution_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RequestCancelWorkflowExecution_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.cancelRequest = new com.uber.cadence.RequestCancelWorkflowExecutionRequest();
          struct.cancelRequest.read(iprot);
          struct.setCancelRequestIsSet(true);
        }
      }
    }

  }

  public static class RequestCancelWorkflowExecution_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("RequestCancelWorkflowExecution_result");

    private static final org.apache.thrift.protocol.TField BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField CANCELLATION_ALREADY_REQUESTED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("cancellationAlreadyRequestedError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)6);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)7);

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

    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.CancellationAlreadyRequestedError cancellationAlreadyRequestedError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // 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 {
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      CANCELLATION_ALREADY_REQUESTED_ERROR((short)4, "cancellationAlreadyRequestedError"),
      SERVICE_BUSY_ERROR((short)5, "serviceBusyError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)6, "domainNotActiveError"),
      LIMIT_EXCEEDED_ERROR((short)7, "limitExceededError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // CANCELLATION_ALREADY_REQUESTED_ERROR
            return CANCELLATION_ALREADY_REQUESTED_ERROR;
          case 5: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          case 6: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          case 7: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          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.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.CANCELLATION_ALREADY_REQUESTED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("cancellationAlreadyRequestedError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RequestCancelWorkflowExecution_result.class, metaDataMap);
    }

    public RequestCancelWorkflowExecution_result() {
    }

    public RequestCancelWorkflowExecution_result(
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.CancellationAlreadyRequestedError cancellationAlreadyRequestedError,
      com.uber.cadence.ServiceBusyError serviceBusyError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError,
      com.uber.cadence.LimitExceededError limitExceededError)
    {
      this();
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.cancellationAlreadyRequestedError = cancellationAlreadyRequestedError;
      this.serviceBusyError = serviceBusyError;
      this.domainNotActiveError = domainNotActiveError;
      this.limitExceededError = limitExceededError;
    }

    /**
     * Performs a deep copy on other.
     */
    public RequestCancelWorkflowExecution_result(RequestCancelWorkflowExecution_result other) {
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetCancellationAlreadyRequestedError()) {
        this.cancellationAlreadyRequestedError = new com.uber.cadence.CancellationAlreadyRequestedError(other.cancellationAlreadyRequestedError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
    }

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

    @Override
    public void clear() {
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.cancellationAlreadyRequestedError = null;
      this.serviceBusyError = null;
      this.domainNotActiveError = null;
      this.limitExceededError = null;
    }

    public com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public RequestCancelWorkflowExecution_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public RequestCancelWorkflowExecution_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public RequestCancelWorkflowExecution_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.CancellationAlreadyRequestedError getCancellationAlreadyRequestedError() {
      return this.cancellationAlreadyRequestedError;
    }

    public RequestCancelWorkflowExecution_result setCancellationAlreadyRequestedError(com.uber.cadence.CancellationAlreadyRequestedError cancellationAlreadyRequestedError) {
      this.cancellationAlreadyRequestedError = cancellationAlreadyRequestedError;
      return this;
    }

    public void unsetCancellationAlreadyRequestedError() {
      this.cancellationAlreadyRequestedError = null;
    }

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

    public void setCancellationAlreadyRequestedErrorIsSet(boolean value) {
      if (!value) {
        this.cancellationAlreadyRequestedError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public RequestCancelWorkflowExecution_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public RequestCancelWorkflowExecution_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public RequestCancelWorkflowExecution_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case CANCELLATION_ALREADY_REQUESTED_ERROR:
        if (value == null) {
          unsetCancellationAlreadyRequestedError();
        } else {
          setCancellationAlreadyRequestedError((com.uber.cadence.CancellationAlreadyRequestedError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case CANCELLATION_ALREADY_REQUESTED_ERROR:
        return getCancellationAlreadyRequestedError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case CANCELLATION_ALREADY_REQUESTED_ERROR:
        return isSetCancellationAlreadyRequestedError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_cancellationAlreadyRequestedError = true && this.isSetCancellationAlreadyRequestedError();
      boolean that_present_cancellationAlreadyRequestedError = true && that.isSetCancellationAlreadyRequestedError();
      if (this_present_cancellationAlreadyRequestedError || that_present_cancellationAlreadyRequestedError) {
        if (!(this_present_cancellationAlreadyRequestedError && that_present_cancellationAlreadyRequestedError))
          return false;
        if (!this.cancellationAlreadyRequestedError.equals(that.cancellationAlreadyRequestedError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      return true;
    }

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

      boolean present_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_cancellationAlreadyRequestedError = true && (isSetCancellationAlreadyRequestedError());
      list.add(present_cancellationAlreadyRequestedError);
      if (present_cancellationAlreadyRequestedError)
        list.add(cancellationAlreadyRequestedError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetCancellationAlreadyRequestedError()).compareTo(other.isSetCancellationAlreadyRequestedError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCancellationAlreadyRequestedError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cancellationAlreadyRequestedError, other.cancellationAlreadyRequestedError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        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("RequestCancelWorkflowExecution_result(");
      boolean first = true;

      sb.append("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("cancellationAlreadyRequestedError:");
      if (this.cancellationAlreadyRequestedError == null) {
        sb.append("null");
      } else {
        sb.append(this.cancellationAlreadyRequestedError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      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 {
        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 RequestCancelWorkflowExecution_resultStandardSchemeFactory implements SchemeFactory {
      public RequestCancelWorkflowExecution_resultStandardScheme getScheme() {
        return new RequestCancelWorkflowExecution_resultStandardScheme();
      }
    }

    private static class RequestCancelWorkflowExecution_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RequestCancelWorkflowExecution_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 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // CANCELLATION_ALREADY_REQUESTED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.cancellationAlreadyRequestedError = new com.uber.cadence.CancellationAlreadyRequestedError();
                struct.cancellationAlreadyRequestedError.read(iprot);
                struct.setCancellationAlreadyRequestedErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 7: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(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, RequestCancelWorkflowExecution_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.cancellationAlreadyRequestedError != null) {
          oprot.writeFieldBegin(CANCELLATION_ALREADY_REQUESTED_ERROR_FIELD_DESC);
          struct.cancellationAlreadyRequestedError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class RequestCancelWorkflowExecution_resultTupleSchemeFactory implements SchemeFactory {
      public RequestCancelWorkflowExecution_resultTupleScheme getScheme() {
        return new RequestCancelWorkflowExecution_resultTupleScheme();
      }
    }

    private static class RequestCancelWorkflowExecution_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, RequestCancelWorkflowExecution_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetBadRequestError()) {
          optionals.set(0);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(1);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(2);
        }
        if (struct.isSetCancellationAlreadyRequestedError()) {
          optionals.set(3);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(4);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(5);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(6);
        }
        oprot.writeBitSet(optionals, 7);
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetCancellationAlreadyRequestedError()) {
          struct.cancellationAlreadyRequestedError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RequestCancelWorkflowExecution_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(7);
        if (incoming.get(0)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(1)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.cancellationAlreadyRequestedError = new com.uber.cadence.CancellationAlreadyRequestedError();
          struct.cancellationAlreadyRequestedError.read(iprot);
          struct.setCancellationAlreadyRequestedErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
        if (incoming.get(6)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
      }
    }

  }

  public static class SignalWorkflowExecution_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("SignalWorkflowExecution_args");

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

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

    public com.uber.cadence.SignalWorkflowExecutionRequest signalRequest; // 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 {
      SIGNAL_REQUEST((short)1, "signalRequest");

      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: // SIGNAL_REQUEST
            return SIGNAL_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.SIGNAL_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("signalRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.SignalWorkflowExecutionRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SignalWorkflowExecution_args.class, metaDataMap);
    }

    public SignalWorkflowExecution_args() {
    }

    public SignalWorkflowExecution_args(
      com.uber.cadence.SignalWorkflowExecutionRequest signalRequest)
    {
      this();
      this.signalRequest = signalRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public SignalWorkflowExecution_args(SignalWorkflowExecution_args other) {
      if (other.isSetSignalRequest()) {
        this.signalRequest = new com.uber.cadence.SignalWorkflowExecutionRequest(other.signalRequest);
      }
    }

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

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

    public com.uber.cadence.SignalWorkflowExecutionRequest getSignalRequest() {
      return this.signalRequest;
    }

    public SignalWorkflowExecution_args setSignalRequest(com.uber.cadence.SignalWorkflowExecutionRequest signalRequest) {
      this.signalRequest = signalRequest;
      return this;
    }

    public void unsetSignalRequest() {
      this.signalRequest = null;
    }

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

    public void setSignalRequestIsSet(boolean value) {
      if (!value) {
        this.signalRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SIGNAL_REQUEST:
        if (value == null) {
          unsetSignalRequest();
        } else {
          setSignalRequest((com.uber.cadence.SignalWorkflowExecutionRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SIGNAL_REQUEST:
        return getSignalRequest();

      }
      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 SIGNAL_REQUEST:
        return isSetSignalRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_signalRequest = true && this.isSetSignalRequest();
      boolean that_present_signalRequest = true && that.isSetSignalRequest();
      if (this_present_signalRequest || that_present_signalRequest) {
        if (!(this_present_signalRequest && that_present_signalRequest))
          return false;
        if (!this.signalRequest.equals(that.signalRequest))
          return false;
      }

      return true;
    }

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

      boolean present_signalRequest = true && (isSetSignalRequest());
      list.add(present_signalRequest);
      if (present_signalRequest)
        list.add(signalRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSignalRequest()).compareTo(other.isSetSignalRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSignalRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.signalRequest, other.signalRequest);
        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("SignalWorkflowExecution_args(");
      boolean first = true;

      sb.append("signalRequest:");
      if (this.signalRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.signalRequest);
      }
      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 (signalRequest != null) {
        signalRequest.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 SignalWorkflowExecution_argsStandardSchemeFactory implements SchemeFactory {
      public SignalWorkflowExecution_argsStandardScheme getScheme() {
        return new SignalWorkflowExecution_argsStandardScheme();
      }
    }

    private static class SignalWorkflowExecution_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, SignalWorkflowExecution_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: // SIGNAL_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.signalRequest = new com.uber.cadence.SignalWorkflowExecutionRequest();
                struct.signalRequest.read(iprot);
                struct.setSignalRequestIsSet(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, SignalWorkflowExecution_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class SignalWorkflowExecution_argsTupleSchemeFactory implements SchemeFactory {
      public SignalWorkflowExecution_argsTupleScheme getScheme() {
        return new SignalWorkflowExecution_argsTupleScheme();
      }
    }

    private static class SignalWorkflowExecution_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, SignalWorkflowExecution_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.signalRequest = new com.uber.cadence.SignalWorkflowExecutionRequest();
          struct.signalRequest.read(iprot);
          struct.setSignalRequestIsSet(true);
        }
      }
    }

  }

  public static class SignalWorkflowExecution_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("SignalWorkflowExecution_result");

    private static final org.apache.thrift.protocol.TField BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // 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 {
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      SERVICE_BUSY_ERROR((short)4, "serviceBusyError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)5, "domainNotActiveError"),
      LIMIT_EXCEEDED_ERROR((short)6, "limitExceededError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          case 5: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          case 6: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          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.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SignalWorkflowExecution_result.class, metaDataMap);
    }

    public SignalWorkflowExecution_result() {
    }

    public SignalWorkflowExecution_result(
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.ServiceBusyError serviceBusyError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError,
      com.uber.cadence.LimitExceededError limitExceededError)
    {
      this();
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.serviceBusyError = serviceBusyError;
      this.domainNotActiveError = domainNotActiveError;
      this.limitExceededError = limitExceededError;
    }

    /**
     * Performs a deep copy on other.
     */
    public SignalWorkflowExecution_result(SignalWorkflowExecution_result other) {
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
    }

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

    @Override
    public void clear() {
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.serviceBusyError = null;
      this.domainNotActiveError = null;
      this.limitExceededError = null;
    }

    public com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public SignalWorkflowExecution_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public SignalWorkflowExecution_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public SignalWorkflowExecution_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public SignalWorkflowExecution_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public SignalWorkflowExecution_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public SignalWorkflowExecution_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      return true;
    }

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

      boolean present_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        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("SignalWorkflowExecution_result(");
      boolean first = true;

      sb.append("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      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 {
        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 SignalWorkflowExecution_resultStandardSchemeFactory implements SchemeFactory {
      public SignalWorkflowExecution_resultStandardScheme getScheme() {
        return new SignalWorkflowExecution_resultStandardScheme();
      }
    }

    private static class SignalWorkflowExecution_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, SignalWorkflowExecution_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 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(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, SignalWorkflowExecution_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class SignalWorkflowExecution_resultTupleSchemeFactory implements SchemeFactory {
      public SignalWorkflowExecution_resultTupleScheme getScheme() {
        return new SignalWorkflowExecution_resultTupleScheme();
      }
    }

    private static class SignalWorkflowExecution_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, SignalWorkflowExecution_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetBadRequestError()) {
          optionals.set(0);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(1);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(2);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(3);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(4);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(5);
        }
        oprot.writeBitSet(optionals, 6);
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, SignalWorkflowExecution_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(6);
        if (incoming.get(0)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(1)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
      }
    }

  }

  public static class SignalWithStartWorkflowExecution_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("SignalWithStartWorkflowExecution_args");

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

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

    public com.uber.cadence.SignalWithStartWorkflowExecutionRequest signalWithStartRequest; // 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 {
      SIGNAL_WITH_START_REQUEST((short)1, "signalWithStartRequest");

      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: // SIGNAL_WITH_START_REQUEST
            return SIGNAL_WITH_START_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.SIGNAL_WITH_START_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("signalWithStartRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.SignalWithStartWorkflowExecutionRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SignalWithStartWorkflowExecution_args.class, metaDataMap);
    }

    public SignalWithStartWorkflowExecution_args() {
    }

    public SignalWithStartWorkflowExecution_args(
      com.uber.cadence.SignalWithStartWorkflowExecutionRequest signalWithStartRequest)
    {
      this();
      this.signalWithStartRequest = signalWithStartRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public SignalWithStartWorkflowExecution_args(SignalWithStartWorkflowExecution_args other) {
      if (other.isSetSignalWithStartRequest()) {
        this.signalWithStartRequest = new com.uber.cadence.SignalWithStartWorkflowExecutionRequest(other.signalWithStartRequest);
      }
    }

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

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

    public com.uber.cadence.SignalWithStartWorkflowExecutionRequest getSignalWithStartRequest() {
      return this.signalWithStartRequest;
    }

    public SignalWithStartWorkflowExecution_args setSignalWithStartRequest(com.uber.cadence.SignalWithStartWorkflowExecutionRequest signalWithStartRequest) {
      this.signalWithStartRequest = signalWithStartRequest;
      return this;
    }

    public void unsetSignalWithStartRequest() {
      this.signalWithStartRequest = null;
    }

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

    public void setSignalWithStartRequestIsSet(boolean value) {
      if (!value) {
        this.signalWithStartRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SIGNAL_WITH_START_REQUEST:
        if (value == null) {
          unsetSignalWithStartRequest();
        } else {
          setSignalWithStartRequest((com.uber.cadence.SignalWithStartWorkflowExecutionRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SIGNAL_WITH_START_REQUEST:
        return getSignalWithStartRequest();

      }
      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 SIGNAL_WITH_START_REQUEST:
        return isSetSignalWithStartRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_signalWithStartRequest = true && this.isSetSignalWithStartRequest();
      boolean that_present_signalWithStartRequest = true && that.isSetSignalWithStartRequest();
      if (this_present_signalWithStartRequest || that_present_signalWithStartRequest) {
        if (!(this_present_signalWithStartRequest && that_present_signalWithStartRequest))
          return false;
        if (!this.signalWithStartRequest.equals(that.signalWithStartRequest))
          return false;
      }

      return true;
    }

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

      boolean present_signalWithStartRequest = true && (isSetSignalWithStartRequest());
      list.add(present_signalWithStartRequest);
      if (present_signalWithStartRequest)
        list.add(signalWithStartRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSignalWithStartRequest()).compareTo(other.isSetSignalWithStartRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSignalWithStartRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.signalWithStartRequest, other.signalWithStartRequest);
        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("SignalWithStartWorkflowExecution_args(");
      boolean first = true;

      sb.append("signalWithStartRequest:");
      if (this.signalWithStartRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.signalWithStartRequest);
      }
      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 (signalWithStartRequest != null) {
        signalWithStartRequest.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 SignalWithStartWorkflowExecution_argsStandardSchemeFactory implements SchemeFactory {
      public SignalWithStartWorkflowExecution_argsStandardScheme getScheme() {
        return new SignalWithStartWorkflowExecution_argsStandardScheme();
      }
    }

    private static class SignalWithStartWorkflowExecution_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, SignalWithStartWorkflowExecution_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: // SIGNAL_WITH_START_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.signalWithStartRequest = new com.uber.cadence.SignalWithStartWorkflowExecutionRequest();
                struct.signalWithStartRequest.read(iprot);
                struct.setSignalWithStartRequestIsSet(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, SignalWithStartWorkflowExecution_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class SignalWithStartWorkflowExecution_argsTupleSchemeFactory implements SchemeFactory {
      public SignalWithStartWorkflowExecution_argsTupleScheme getScheme() {
        return new SignalWithStartWorkflowExecution_argsTupleScheme();
      }
    }

    private static class SignalWithStartWorkflowExecution_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, SignalWithStartWorkflowExecution_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.signalWithStartRequest = new com.uber.cadence.SignalWithStartWorkflowExecutionRequest();
          struct.signalWithStartRequest.read(iprot);
          struct.setSignalWithStartRequestIsSet(true);
        }
      }
    }

  }

  public static class SignalWithStartWorkflowExecution_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("SignalWithStartWorkflowExecution_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 BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)6);
    private static final org.apache.thrift.protocol.TField WORKFLOW_ALREADY_STARTED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("workflowAlreadyStartedError", org.apache.thrift.protocol.TType.STRUCT, (short)7);

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

    public com.uber.cadence.StartWorkflowExecutionResponse success; // required
    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // required
    public com.uber.cadence.WorkflowExecutionAlreadyStartedError workflowAlreadyStartedError; // 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"),
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      SERVICE_BUSY_ERROR((short)4, "serviceBusyError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)5, "domainNotActiveError"),
      LIMIT_EXCEEDED_ERROR((short)6, "limitExceededError"),
      WORKFLOW_ALREADY_STARTED_ERROR((short)7, "workflowAlreadyStartedError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          case 5: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          case 6: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          case 7: // WORKFLOW_ALREADY_STARTED_ERROR
            return WORKFLOW_ALREADY_STARTED_ERROR;
          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, com.uber.cadence.StartWorkflowExecutionResponse.class)));
      tmpMap.put(_Fields.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.WORKFLOW_ALREADY_STARTED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("workflowAlreadyStartedError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SignalWithStartWorkflowExecution_result.class, metaDataMap);
    }

    public SignalWithStartWorkflowExecution_result() {
    }

    public SignalWithStartWorkflowExecution_result(
      com.uber.cadence.StartWorkflowExecutionResponse success,
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.ServiceBusyError serviceBusyError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError,
      com.uber.cadence.LimitExceededError limitExceededError,
      com.uber.cadence.WorkflowExecutionAlreadyStartedError workflowAlreadyStartedError)
    {
      this();
      this.success = success;
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.serviceBusyError = serviceBusyError;
      this.domainNotActiveError = domainNotActiveError;
      this.limitExceededError = limitExceededError;
      this.workflowAlreadyStartedError = workflowAlreadyStartedError;
    }

    /**
     * Performs a deep copy on other.
     */
    public SignalWithStartWorkflowExecution_result(SignalWithStartWorkflowExecution_result other) {
      if (other.isSetSuccess()) {
        this.success = new com.uber.cadence.StartWorkflowExecutionResponse(other.success);
      }
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
      if (other.isSetWorkflowAlreadyStartedError()) {
        this.workflowAlreadyStartedError = new com.uber.cadence.WorkflowExecutionAlreadyStartedError(other.workflowAlreadyStartedError);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.serviceBusyError = null;
      this.domainNotActiveError = null;
      this.limitExceededError = null;
      this.workflowAlreadyStartedError = null;
    }

    public com.uber.cadence.StartWorkflowExecutionResponse getSuccess() {
      return this.success;
    }

    public SignalWithStartWorkflowExecution_result setSuccess(com.uber.cadence.StartWorkflowExecutionResponse 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 com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public SignalWithStartWorkflowExecution_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public SignalWithStartWorkflowExecution_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public SignalWithStartWorkflowExecution_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public SignalWithStartWorkflowExecution_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public SignalWithStartWorkflowExecution_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public SignalWithStartWorkflowExecution_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public com.uber.cadence.WorkflowExecutionAlreadyStartedError getWorkflowAlreadyStartedError() {
      return this.workflowAlreadyStartedError;
    }

    public SignalWithStartWorkflowExecution_result setWorkflowAlreadyStartedError(com.uber.cadence.WorkflowExecutionAlreadyStartedError workflowAlreadyStartedError) {
      this.workflowAlreadyStartedError = workflowAlreadyStartedError;
      return this;
    }

    public void unsetWorkflowAlreadyStartedError() {
      this.workflowAlreadyStartedError = null;
    }

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

    public void setWorkflowAlreadyStartedErrorIsSet(boolean value) {
      if (!value) {
        this.workflowAlreadyStartedError = null;
      }
    }

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

      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      case WORKFLOW_ALREADY_STARTED_ERROR:
        if (value == null) {
          unsetWorkflowAlreadyStartedError();
        } else {
          setWorkflowAlreadyStartedError((com.uber.cadence.WorkflowExecutionAlreadyStartedError)value);
        }
        break;

      }
    }

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

      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      case WORKFLOW_ALREADY_STARTED_ERROR:
        return getWorkflowAlreadyStartedError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      case WORKFLOW_ALREADY_STARTED_ERROR:
        return isSetWorkflowAlreadyStartedError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(SignalWithStartWorkflowExecution_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_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      boolean this_present_workflowAlreadyStartedError = true && this.isSetWorkflowAlreadyStartedError();
      boolean that_present_workflowAlreadyStartedError = true && that.isSetWorkflowAlreadyStartedError();
      if (this_present_workflowAlreadyStartedError || that_present_workflowAlreadyStartedError) {
        if (!(this_present_workflowAlreadyStartedError && that_present_workflowAlreadyStartedError))
          return false;
        if (!this.workflowAlreadyStartedError.equals(that.workflowAlreadyStartedError))
          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_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      boolean present_workflowAlreadyStartedError = true && (isSetWorkflowAlreadyStartedError());
      list.add(present_workflowAlreadyStartedError);
      if (present_workflowAlreadyStartedError)
        list.add(workflowAlreadyStartedError);

      return list.hashCode();
    }

    @Override
    public int compareTo(SignalWithStartWorkflowExecution_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(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetWorkflowAlreadyStartedError()).compareTo(other.isSetWorkflowAlreadyStartedError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWorkflowAlreadyStartedError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workflowAlreadyStartedError, other.workflowAlreadyStartedError);
        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("SignalWithStartWorkflowExecution_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("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("workflowAlreadyStartedError:");
      if (this.workflowAlreadyStartedError == null) {
        sb.append("null");
      } else {
        sb.append(this.workflowAlreadyStartedError);
      }
      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 SignalWithStartWorkflowExecution_resultStandardSchemeFactory implements SchemeFactory {
      public SignalWithStartWorkflowExecution_resultStandardScheme getScheme() {
        return new SignalWithStartWorkflowExecution_resultStandardScheme();
      }
    }

    private static class SignalWithStartWorkflowExecution_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, SignalWithStartWorkflowExecution_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 com.uber.cadence.StartWorkflowExecutionResponse();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 7: // WORKFLOW_ALREADY_STARTED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.workflowAlreadyStartedError = new com.uber.cadence.WorkflowExecutionAlreadyStartedError();
                struct.workflowAlreadyStartedError.read(iprot);
                struct.setWorkflowAlreadyStartedErrorIsSet(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, SignalWithStartWorkflowExecution_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.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.workflowAlreadyStartedError != null) {
          oprot.writeFieldBegin(WORKFLOW_ALREADY_STARTED_ERROR_FIELD_DESC);
          struct.workflowAlreadyStartedError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class SignalWithStartWorkflowExecution_resultTupleSchemeFactory implements SchemeFactory {
      public SignalWithStartWorkflowExecution_resultTupleScheme getScheme() {
        return new SignalWithStartWorkflowExecution_resultTupleScheme();
      }
    }

    private static class SignalWithStartWorkflowExecution_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, SignalWithStartWorkflowExecution_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetBadRequestError()) {
          optionals.set(1);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(2);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(3);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(4);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(5);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(6);
        }
        if (struct.isSetWorkflowAlreadyStartedError()) {
          optionals.set(7);
        }
        oprot.writeBitSet(optionals, 8);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
        if (struct.isSetWorkflowAlreadyStartedError()) {
          struct.workflowAlreadyStartedError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, SignalWithStartWorkflowExecution_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(8);
        if (incoming.get(0)) {
          struct.success = new com.uber.cadence.StartWorkflowExecutionResponse();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
        if (incoming.get(6)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
        if (incoming.get(7)) {
          struct.workflowAlreadyStartedError = new com.uber.cadence.WorkflowExecutionAlreadyStartedError();
          struct.workflowAlreadyStartedError.read(iprot);
          struct.setWorkflowAlreadyStartedErrorIsSet(true);
        }
      }
    }

  }

  public static class TerminateWorkflowExecution_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("TerminateWorkflowExecution_args");

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

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

    public com.uber.cadence.TerminateWorkflowExecutionRequest terminateRequest; // 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 {
      TERMINATE_REQUEST((short)1, "terminateRequest");

      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: // TERMINATE_REQUEST
            return TERMINATE_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.TERMINATE_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("terminateRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.TerminateWorkflowExecutionRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TerminateWorkflowExecution_args.class, metaDataMap);
    }

    public TerminateWorkflowExecution_args() {
    }

    public TerminateWorkflowExecution_args(
      com.uber.cadence.TerminateWorkflowExecutionRequest terminateRequest)
    {
      this();
      this.terminateRequest = terminateRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public TerminateWorkflowExecution_args(TerminateWorkflowExecution_args other) {
      if (other.isSetTerminateRequest()) {
        this.terminateRequest = new com.uber.cadence.TerminateWorkflowExecutionRequest(other.terminateRequest);
      }
    }

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

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

    public com.uber.cadence.TerminateWorkflowExecutionRequest getTerminateRequest() {
      return this.terminateRequest;
    }

    public TerminateWorkflowExecution_args setTerminateRequest(com.uber.cadence.TerminateWorkflowExecutionRequest terminateRequest) {
      this.terminateRequest = terminateRequest;
      return this;
    }

    public void unsetTerminateRequest() {
      this.terminateRequest = null;
    }

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

    public void setTerminateRequestIsSet(boolean value) {
      if (!value) {
        this.terminateRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case TERMINATE_REQUEST:
        if (value == null) {
          unsetTerminateRequest();
        } else {
          setTerminateRequest((com.uber.cadence.TerminateWorkflowExecutionRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case TERMINATE_REQUEST:
        return getTerminateRequest();

      }
      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 TERMINATE_REQUEST:
        return isSetTerminateRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_terminateRequest = true && this.isSetTerminateRequest();
      boolean that_present_terminateRequest = true && that.isSetTerminateRequest();
      if (this_present_terminateRequest || that_present_terminateRequest) {
        if (!(this_present_terminateRequest && that_present_terminateRequest))
          return false;
        if (!this.terminateRequest.equals(that.terminateRequest))
          return false;
      }

      return true;
    }

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

      boolean present_terminateRequest = true && (isSetTerminateRequest());
      list.add(present_terminateRequest);
      if (present_terminateRequest)
        list.add(terminateRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetTerminateRequest()).compareTo(other.isSetTerminateRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTerminateRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.terminateRequest, other.terminateRequest);
        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("TerminateWorkflowExecution_args(");
      boolean first = true;

      sb.append("terminateRequest:");
      if (this.terminateRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.terminateRequest);
      }
      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 (terminateRequest != null) {
        terminateRequest.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 TerminateWorkflowExecution_argsStandardSchemeFactory implements SchemeFactory {
      public TerminateWorkflowExecution_argsStandardScheme getScheme() {
        return new TerminateWorkflowExecution_argsStandardScheme();
      }
    }

    private static class TerminateWorkflowExecution_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, TerminateWorkflowExecution_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: // TERMINATE_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.terminateRequest = new com.uber.cadence.TerminateWorkflowExecutionRequest();
                struct.terminateRequest.read(iprot);
                struct.setTerminateRequestIsSet(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, TerminateWorkflowExecution_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class TerminateWorkflowExecution_argsTupleSchemeFactory implements SchemeFactory {
      public TerminateWorkflowExecution_argsTupleScheme getScheme() {
        return new TerminateWorkflowExecution_argsTupleScheme();
      }
    }

    private static class TerminateWorkflowExecution_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, TerminateWorkflowExecution_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.terminateRequest = new com.uber.cadence.TerminateWorkflowExecutionRequest();
          struct.terminateRequest.read(iprot);
          struct.setTerminateRequestIsSet(true);
        }
      }
    }

  }

  public static class TerminateWorkflowExecution_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("TerminateWorkflowExecution_result");

    private static final org.apache.thrift.protocol.TField BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // 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 {
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      SERVICE_BUSY_ERROR((short)4, "serviceBusyError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)5, "domainNotActiveError"),
      LIMIT_EXCEEDED_ERROR((short)6, "limitExceededError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          case 5: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          case 6: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          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.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TerminateWorkflowExecution_result.class, metaDataMap);
    }

    public TerminateWorkflowExecution_result() {
    }

    public TerminateWorkflowExecution_result(
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.ServiceBusyError serviceBusyError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError,
      com.uber.cadence.LimitExceededError limitExceededError)
    {
      this();
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.serviceBusyError = serviceBusyError;
      this.domainNotActiveError = domainNotActiveError;
      this.limitExceededError = limitExceededError;
    }

    /**
     * Performs a deep copy on other.
     */
    public TerminateWorkflowExecution_result(TerminateWorkflowExecution_result other) {
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
    }

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

    @Override
    public void clear() {
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.serviceBusyError = null;
      this.domainNotActiveError = null;
      this.limitExceededError = null;
    }

    public com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public TerminateWorkflowExecution_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public TerminateWorkflowExecution_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public TerminateWorkflowExecution_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public TerminateWorkflowExecution_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public TerminateWorkflowExecution_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public TerminateWorkflowExecution_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      return true;
    }

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

      boolean present_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        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("TerminateWorkflowExecution_result(");
      boolean first = true;

      sb.append("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      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 {
        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 TerminateWorkflowExecution_resultStandardSchemeFactory implements SchemeFactory {
      public TerminateWorkflowExecution_resultStandardScheme getScheme() {
        return new TerminateWorkflowExecution_resultStandardScheme();
      }
    }

    private static class TerminateWorkflowExecution_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, TerminateWorkflowExecution_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 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(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, TerminateWorkflowExecution_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class TerminateWorkflowExecution_resultTupleSchemeFactory implements SchemeFactory {
      public TerminateWorkflowExecution_resultTupleScheme getScheme() {
        return new TerminateWorkflowExecution_resultTupleScheme();
      }
    }

    private static class TerminateWorkflowExecution_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, TerminateWorkflowExecution_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetBadRequestError()) {
          optionals.set(0);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(1);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(2);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(3);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(4);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(5);
        }
        oprot.writeBitSet(optionals, 6);
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, TerminateWorkflowExecution_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(6);
        if (incoming.get(0)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(1)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
      }
    }

  }

  public static class ListOpenWorkflowExecutions_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("ListOpenWorkflowExecutions_args");

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

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

    public com.uber.cadence.ListOpenWorkflowExecutionsRequest listRequest; // 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 {
      LIST_REQUEST((short)1, "listRequest");

      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: // LIST_REQUEST
            return LIST_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.LIST_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("listRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.ListOpenWorkflowExecutionsRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ListOpenWorkflowExecutions_args.class, metaDataMap);
    }

    public ListOpenWorkflowExecutions_args() {
    }

    public ListOpenWorkflowExecutions_args(
      com.uber.cadence.ListOpenWorkflowExecutionsRequest listRequest)
    {
      this();
      this.listRequest = listRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public ListOpenWorkflowExecutions_args(ListOpenWorkflowExecutions_args other) {
      if (other.isSetListRequest()) {
        this.listRequest = new com.uber.cadence.ListOpenWorkflowExecutionsRequest(other.listRequest);
      }
    }

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

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

    public com.uber.cadence.ListOpenWorkflowExecutionsRequest getListRequest() {
      return this.listRequest;
    }

    public ListOpenWorkflowExecutions_args setListRequest(com.uber.cadence.ListOpenWorkflowExecutionsRequest listRequest) {
      this.listRequest = listRequest;
      return this;
    }

    public void unsetListRequest() {
      this.listRequest = null;
    }

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

    public void setListRequestIsSet(boolean value) {
      if (!value) {
        this.listRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case LIST_REQUEST:
        if (value == null) {
          unsetListRequest();
        } else {
          setListRequest((com.uber.cadence.ListOpenWorkflowExecutionsRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case LIST_REQUEST:
        return getListRequest();

      }
      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 LIST_REQUEST:
        return isSetListRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_listRequest = true && this.isSetListRequest();
      boolean that_present_listRequest = true && that.isSetListRequest();
      if (this_present_listRequest || that_present_listRequest) {
        if (!(this_present_listRequest && that_present_listRequest))
          return false;
        if (!this.listRequest.equals(that.listRequest))
          return false;
      }

      return true;
    }

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

      boolean present_listRequest = true && (isSetListRequest());
      list.add(present_listRequest);
      if (present_listRequest)
        list.add(listRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetListRequest()).compareTo(other.isSetListRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetListRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.listRequest, other.listRequest);
        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("ListOpenWorkflowExecutions_args(");
      boolean first = true;

      sb.append("listRequest:");
      if (this.listRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.listRequest);
      }
      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 (listRequest != null) {
        listRequest.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 ListOpenWorkflowExecutions_argsStandardSchemeFactory implements SchemeFactory {
      public ListOpenWorkflowExecutions_argsStandardScheme getScheme() {
        return new ListOpenWorkflowExecutions_argsStandardScheme();
      }
    }

    private static class ListOpenWorkflowExecutions_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, ListOpenWorkflowExecutions_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: // LIST_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.listRequest = new com.uber.cadence.ListOpenWorkflowExecutionsRequest();
                struct.listRequest.read(iprot);
                struct.setListRequestIsSet(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, ListOpenWorkflowExecutions_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class ListOpenWorkflowExecutions_argsTupleSchemeFactory implements SchemeFactory {
      public ListOpenWorkflowExecutions_argsTupleScheme getScheme() {
        return new ListOpenWorkflowExecutions_argsTupleScheme();
      }
    }

    private static class ListOpenWorkflowExecutions_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, ListOpenWorkflowExecutions_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.listRequest = new com.uber.cadence.ListOpenWorkflowExecutionsRequest();
          struct.listRequest.read(iprot);
          struct.setListRequestIsSet(true);
        }
      }
    }

  }

  public static class ListOpenWorkflowExecutions_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("ListOpenWorkflowExecutions_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 BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)5);

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

    public com.uber.cadence.ListOpenWorkflowExecutionsResponse success; // required
    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // 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"),
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      SERVICE_BUSY_ERROR((short)4, "serviceBusyError"),
      LIMIT_EXCEEDED_ERROR((short)5, "limitExceededError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          case 5: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          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, com.uber.cadence.ListOpenWorkflowExecutionsResponse.class)));
      tmpMap.put(_Fields.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ListOpenWorkflowExecutions_result.class, metaDataMap);
    }

    public ListOpenWorkflowExecutions_result() {
    }

    public ListOpenWorkflowExecutions_result(
      com.uber.cadence.ListOpenWorkflowExecutionsResponse success,
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.ServiceBusyError serviceBusyError,
      com.uber.cadence.LimitExceededError limitExceededError)
    {
      this();
      this.success = success;
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.serviceBusyError = serviceBusyError;
      this.limitExceededError = limitExceededError;
    }

    /**
     * Performs a deep copy on other.
     */
    public ListOpenWorkflowExecutions_result(ListOpenWorkflowExecutions_result other) {
      if (other.isSetSuccess()) {
        this.success = new com.uber.cadence.ListOpenWorkflowExecutionsResponse(other.success);
      }
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.serviceBusyError = null;
      this.limitExceededError = null;
    }

    public com.uber.cadence.ListOpenWorkflowExecutionsResponse getSuccess() {
      return this.success;
    }

    public ListOpenWorkflowExecutions_result setSuccess(com.uber.cadence.ListOpenWorkflowExecutionsResponse 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 com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public ListOpenWorkflowExecutions_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public ListOpenWorkflowExecutions_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public ListOpenWorkflowExecutions_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public ListOpenWorkflowExecutions_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public ListOpenWorkflowExecutions_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

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

      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      }
    }

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

      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(ListOpenWorkflowExecutions_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_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          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_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      return list.hashCode();
    }

    @Override
    public int compareTo(ListOpenWorkflowExecutions_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(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        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("ListOpenWorkflowExecutions_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("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      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 ListOpenWorkflowExecutions_resultStandardSchemeFactory implements SchemeFactory {
      public ListOpenWorkflowExecutions_resultStandardScheme getScheme() {
        return new ListOpenWorkflowExecutions_resultStandardScheme();
      }
    }

    private static class ListOpenWorkflowExecutions_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, ListOpenWorkflowExecutions_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 com.uber.cadence.ListOpenWorkflowExecutionsResponse();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(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, ListOpenWorkflowExecutions_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.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class ListOpenWorkflowExecutions_resultTupleSchemeFactory implements SchemeFactory {
      public ListOpenWorkflowExecutions_resultTupleScheme getScheme() {
        return new ListOpenWorkflowExecutions_resultTupleScheme();
      }
    }

    private static class ListOpenWorkflowExecutions_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, ListOpenWorkflowExecutions_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetBadRequestError()) {
          optionals.set(1);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(2);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(3);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(4);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(5);
        }
        oprot.writeBitSet(optionals, 6);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, ListOpenWorkflowExecutions_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(6);
        if (incoming.get(0)) {
          struct.success = new com.uber.cadence.ListOpenWorkflowExecutionsResponse();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
      }
    }

  }

  public static class ListClosedWorkflowExecutions_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("ListClosedWorkflowExecutions_args");

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

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

    public com.uber.cadence.ListClosedWorkflowExecutionsRequest listRequest; // 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 {
      LIST_REQUEST((short)1, "listRequest");

      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: // LIST_REQUEST
            return LIST_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.LIST_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("listRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.ListClosedWorkflowExecutionsRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ListClosedWorkflowExecutions_args.class, metaDataMap);
    }

    public ListClosedWorkflowExecutions_args() {
    }

    public ListClosedWorkflowExecutions_args(
      com.uber.cadence.ListClosedWorkflowExecutionsRequest listRequest)
    {
      this();
      this.listRequest = listRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public ListClosedWorkflowExecutions_args(ListClosedWorkflowExecutions_args other) {
      if (other.isSetListRequest()) {
        this.listRequest = new com.uber.cadence.ListClosedWorkflowExecutionsRequest(other.listRequest);
      }
    }

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

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

    public com.uber.cadence.ListClosedWorkflowExecutionsRequest getListRequest() {
      return this.listRequest;
    }

    public ListClosedWorkflowExecutions_args setListRequest(com.uber.cadence.ListClosedWorkflowExecutionsRequest listRequest) {
      this.listRequest = listRequest;
      return this;
    }

    public void unsetListRequest() {
      this.listRequest = null;
    }

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

    public void setListRequestIsSet(boolean value) {
      if (!value) {
        this.listRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case LIST_REQUEST:
        if (value == null) {
          unsetListRequest();
        } else {
          setListRequest((com.uber.cadence.ListClosedWorkflowExecutionsRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case LIST_REQUEST:
        return getListRequest();

      }
      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 LIST_REQUEST:
        return isSetListRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_listRequest = true && this.isSetListRequest();
      boolean that_present_listRequest = true && that.isSetListRequest();
      if (this_present_listRequest || that_present_listRequest) {
        if (!(this_present_listRequest && that_present_listRequest))
          return false;
        if (!this.listRequest.equals(that.listRequest))
          return false;
      }

      return true;
    }

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

      boolean present_listRequest = true && (isSetListRequest());
      list.add(present_listRequest);
      if (present_listRequest)
        list.add(listRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetListRequest()).compareTo(other.isSetListRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetListRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.listRequest, other.listRequest);
        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("ListClosedWorkflowExecutions_args(");
      boolean first = true;

      sb.append("listRequest:");
      if (this.listRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.listRequest);
      }
      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 (listRequest != null) {
        listRequest.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 ListClosedWorkflowExecutions_argsStandardSchemeFactory implements SchemeFactory {
      public ListClosedWorkflowExecutions_argsStandardScheme getScheme() {
        return new ListClosedWorkflowExecutions_argsStandardScheme();
      }
    }

    private static class ListClosedWorkflowExecutions_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, ListClosedWorkflowExecutions_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: // LIST_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.listRequest = new com.uber.cadence.ListClosedWorkflowExecutionsRequest();
                struct.listRequest.read(iprot);
                struct.setListRequestIsSet(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, ListClosedWorkflowExecutions_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class ListClosedWorkflowExecutions_argsTupleSchemeFactory implements SchemeFactory {
      public ListClosedWorkflowExecutions_argsTupleScheme getScheme() {
        return new ListClosedWorkflowExecutions_argsTupleScheme();
      }
    }

    private static class ListClosedWorkflowExecutions_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, ListClosedWorkflowExecutions_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.listRequest = new com.uber.cadence.ListClosedWorkflowExecutionsRequest();
          struct.listRequest.read(iprot);
          struct.setListRequestIsSet(true);
        }
      }
    }

  }

  public static class ListClosedWorkflowExecutions_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("ListClosedWorkflowExecutions_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 BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)4);

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

    public com.uber.cadence.ListClosedWorkflowExecutionsResponse success; // required
    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // 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"),
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      SERVICE_BUSY_ERROR((short)4, "serviceBusyError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          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, com.uber.cadence.ListClosedWorkflowExecutionsResponse.class)));
      tmpMap.put(_Fields.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ListClosedWorkflowExecutions_result.class, metaDataMap);
    }

    public ListClosedWorkflowExecutions_result() {
    }

    public ListClosedWorkflowExecutions_result(
      com.uber.cadence.ListClosedWorkflowExecutionsResponse success,
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.ServiceBusyError serviceBusyError)
    {
      this();
      this.success = success;
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.serviceBusyError = serviceBusyError;
    }

    /**
     * Performs a deep copy on other.
     */
    public ListClosedWorkflowExecutions_result(ListClosedWorkflowExecutions_result other) {
      if (other.isSetSuccess()) {
        this.success = new com.uber.cadence.ListClosedWorkflowExecutionsResponse(other.success);
      }
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.serviceBusyError = null;
    }

    public com.uber.cadence.ListClosedWorkflowExecutionsResponse getSuccess() {
      return this.success;
    }

    public ListClosedWorkflowExecutions_result setSuccess(com.uber.cadence.ListClosedWorkflowExecutionsResponse 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 com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public ListClosedWorkflowExecutions_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public ListClosedWorkflowExecutions_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public ListClosedWorkflowExecutions_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public ListClosedWorkflowExecutions_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

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

      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      }
    }

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

      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(ListClosedWorkflowExecutions_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_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          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_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      return list.hashCode();
    }

    @Override
    public int compareTo(ListClosedWorkflowExecutions_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(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        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("ListClosedWorkflowExecutions_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("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      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 ListClosedWorkflowExecutions_resultStandardSchemeFactory implements SchemeFactory {
      public ListClosedWorkflowExecutions_resultStandardScheme getScheme() {
        return new ListClosedWorkflowExecutions_resultStandardScheme();
      }
    }

    private static class ListClosedWorkflowExecutions_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, ListClosedWorkflowExecutions_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 com.uber.cadence.ListClosedWorkflowExecutionsResponse();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(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, ListClosedWorkflowExecutions_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.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class ListClosedWorkflowExecutions_resultTupleSchemeFactory implements SchemeFactory {
      public ListClosedWorkflowExecutions_resultTupleScheme getScheme() {
        return new ListClosedWorkflowExecutions_resultTupleScheme();
      }
    }

    private static class ListClosedWorkflowExecutions_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, ListClosedWorkflowExecutions_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetBadRequestError()) {
          optionals.set(1);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(2);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(3);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(4);
        }
        oprot.writeBitSet(optionals, 5);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, ListClosedWorkflowExecutions_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(5);
        if (incoming.get(0)) {
          struct.success = new com.uber.cadence.ListClosedWorkflowExecutionsResponse();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
      }
    }

  }

  public static class RespondQueryTaskCompleted_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("RespondQueryTaskCompleted_args");

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

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

    public com.uber.cadence.RespondQueryTaskCompletedRequest completeRequest; // 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 {
      COMPLETE_REQUEST((short)1, "completeRequest");

      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: // COMPLETE_REQUEST
            return COMPLETE_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.COMPLETE_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("completeRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.RespondQueryTaskCompletedRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RespondQueryTaskCompleted_args.class, metaDataMap);
    }

    public RespondQueryTaskCompleted_args() {
    }

    public RespondQueryTaskCompleted_args(
      com.uber.cadence.RespondQueryTaskCompletedRequest completeRequest)
    {
      this();
      this.completeRequest = completeRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public RespondQueryTaskCompleted_args(RespondQueryTaskCompleted_args other) {
      if (other.isSetCompleteRequest()) {
        this.completeRequest = new com.uber.cadence.RespondQueryTaskCompletedRequest(other.completeRequest);
      }
    }

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

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

    public com.uber.cadence.RespondQueryTaskCompletedRequest getCompleteRequest() {
      return this.completeRequest;
    }

    public RespondQueryTaskCompleted_args setCompleteRequest(com.uber.cadence.RespondQueryTaskCompletedRequest completeRequest) {
      this.completeRequest = completeRequest;
      return this;
    }

    public void unsetCompleteRequest() {
      this.completeRequest = null;
    }

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

    public void setCompleteRequestIsSet(boolean value) {
      if (!value) {
        this.completeRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case COMPLETE_REQUEST:
        if (value == null) {
          unsetCompleteRequest();
        } else {
          setCompleteRequest((com.uber.cadence.RespondQueryTaskCompletedRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case COMPLETE_REQUEST:
        return getCompleteRequest();

      }
      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 COMPLETE_REQUEST:
        return isSetCompleteRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_completeRequest = true && this.isSetCompleteRequest();
      boolean that_present_completeRequest = true && that.isSetCompleteRequest();
      if (this_present_completeRequest || that_present_completeRequest) {
        if (!(this_present_completeRequest && that_present_completeRequest))
          return false;
        if (!this.completeRequest.equals(that.completeRequest))
          return false;
      }

      return true;
    }

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

      boolean present_completeRequest = true && (isSetCompleteRequest());
      list.add(present_completeRequest);
      if (present_completeRequest)
        list.add(completeRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCompleteRequest()).compareTo(other.isSetCompleteRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCompleteRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.completeRequest, other.completeRequest);
        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("RespondQueryTaskCompleted_args(");
      boolean first = true;

      sb.append("completeRequest:");
      if (this.completeRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.completeRequest);
      }
      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 (completeRequest != null) {
        completeRequest.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 RespondQueryTaskCompleted_argsStandardSchemeFactory implements SchemeFactory {
      public RespondQueryTaskCompleted_argsStandardScheme getScheme() {
        return new RespondQueryTaskCompleted_argsStandardScheme();
      }
    }

    private static class RespondQueryTaskCompleted_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RespondQueryTaskCompleted_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: // COMPLETE_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.completeRequest = new com.uber.cadence.RespondQueryTaskCompletedRequest();
                struct.completeRequest.read(iprot);
                struct.setCompleteRequestIsSet(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, RespondQueryTaskCompleted_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class RespondQueryTaskCompleted_argsTupleSchemeFactory implements SchemeFactory {
      public RespondQueryTaskCompleted_argsTupleScheme getScheme() {
        return new RespondQueryTaskCompleted_argsTupleScheme();
      }
    }

    private static class RespondQueryTaskCompleted_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RespondQueryTaskCompleted_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.completeRequest = new com.uber.cadence.RespondQueryTaskCompletedRequest();
          struct.completeRequest.read(iprot);
          struct.setCompleteRequestIsSet(true);
        }
      }
    }

  }

  public static class RespondQueryTaskCompleted_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("RespondQueryTaskCompleted_result");

    private static final org.apache.thrift.protocol.TField BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // 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 {
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      LIMIT_EXCEEDED_ERROR((short)4, "limitExceededError"),
      SERVICE_BUSY_ERROR((short)5, "serviceBusyError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)6, "domainNotActiveError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          case 5: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          case 6: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          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.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RespondQueryTaskCompleted_result.class, metaDataMap);
    }

    public RespondQueryTaskCompleted_result() {
    }

    public RespondQueryTaskCompleted_result(
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.LimitExceededError limitExceededError,
      com.uber.cadence.ServiceBusyError serviceBusyError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError)
    {
      this();
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.limitExceededError = limitExceededError;
      this.serviceBusyError = serviceBusyError;
      this.domainNotActiveError = domainNotActiveError;
    }

    /**
     * Performs a deep copy on other.
     */
    public RespondQueryTaskCompleted_result(RespondQueryTaskCompleted_result other) {
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
    }

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

    @Override
    public void clear() {
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.limitExceededError = null;
      this.serviceBusyError = null;
      this.domainNotActiveError = null;
    }

    public com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public RespondQueryTaskCompleted_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public RespondQueryTaskCompleted_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public RespondQueryTaskCompleted_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public RespondQueryTaskCompleted_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public RespondQueryTaskCompleted_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public RespondQueryTaskCompleted_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          return false;
      }

      return true;
    }

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

      boolean present_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        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("RespondQueryTaskCompleted_result(");
      boolean first = true;

      sb.append("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      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 {
        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 RespondQueryTaskCompleted_resultStandardSchemeFactory implements SchemeFactory {
      public RespondQueryTaskCompleted_resultStandardScheme getScheme() {
        return new RespondQueryTaskCompleted_resultStandardScheme();
      }
    }

    private static class RespondQueryTaskCompleted_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RespondQueryTaskCompleted_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 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(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, RespondQueryTaskCompleted_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class RespondQueryTaskCompleted_resultTupleSchemeFactory implements SchemeFactory {
      public RespondQueryTaskCompleted_resultTupleScheme getScheme() {
        return new RespondQueryTaskCompleted_resultTupleScheme();
      }
    }

    private static class RespondQueryTaskCompleted_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, RespondQueryTaskCompleted_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetBadRequestError()) {
          optionals.set(0);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(1);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(2);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(3);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(4);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(5);
        }
        oprot.writeBitSet(optionals, 6);
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RespondQueryTaskCompleted_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(6);
        if (incoming.get(0)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(1)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
      }
    }

  }

  public static class ResetStickyTaskList_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("ResetStickyTaskList_args");

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

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

    public com.uber.cadence.ResetStickyTaskListRequest resetRequest; // 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 {
      RESET_REQUEST((short)1, "resetRequest");

      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: // RESET_REQUEST
            return RESET_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.RESET_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("resetRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.ResetStickyTaskListRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ResetStickyTaskList_args.class, metaDataMap);
    }

    public ResetStickyTaskList_args() {
    }

    public ResetStickyTaskList_args(
      com.uber.cadence.ResetStickyTaskListRequest resetRequest)
    {
      this();
      this.resetRequest = resetRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public ResetStickyTaskList_args(ResetStickyTaskList_args other) {
      if (other.isSetResetRequest()) {
        this.resetRequest = new com.uber.cadence.ResetStickyTaskListRequest(other.resetRequest);
      }
    }

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

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

    public com.uber.cadence.ResetStickyTaskListRequest getResetRequest() {
      return this.resetRequest;
    }

    public ResetStickyTaskList_args setResetRequest(com.uber.cadence.ResetStickyTaskListRequest resetRequest) {
      this.resetRequest = resetRequest;
      return this;
    }

    public void unsetResetRequest() {
      this.resetRequest = null;
    }

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

    public void setResetRequestIsSet(boolean value) {
      if (!value) {
        this.resetRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case RESET_REQUEST:
        if (value == null) {
          unsetResetRequest();
        } else {
          setResetRequest((com.uber.cadence.ResetStickyTaskListRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case RESET_REQUEST:
        return getResetRequest();

      }
      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 RESET_REQUEST:
        return isSetResetRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_resetRequest = true && this.isSetResetRequest();
      boolean that_present_resetRequest = true && that.isSetResetRequest();
      if (this_present_resetRequest || that_present_resetRequest) {
        if (!(this_present_resetRequest && that_present_resetRequest))
          return false;
        if (!this.resetRequest.equals(that.resetRequest))
          return false;
      }

      return true;
    }

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

      boolean present_resetRequest = true && (isSetResetRequest());
      list.add(present_resetRequest);
      if (present_resetRequest)
        list.add(resetRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetResetRequest()).compareTo(other.isSetResetRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetResetRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resetRequest, other.resetRequest);
        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("ResetStickyTaskList_args(");
      boolean first = true;

      sb.append("resetRequest:");
      if (this.resetRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.resetRequest);
      }
      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 (resetRequest != null) {
        resetRequest.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 ResetStickyTaskList_argsStandardSchemeFactory implements SchemeFactory {
      public ResetStickyTaskList_argsStandardScheme getScheme() {
        return new ResetStickyTaskList_argsStandardScheme();
      }
    }

    private static class ResetStickyTaskList_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, ResetStickyTaskList_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: // RESET_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.resetRequest = new com.uber.cadence.ResetStickyTaskListRequest();
                struct.resetRequest.read(iprot);
                struct.setResetRequestIsSet(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, ResetStickyTaskList_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class ResetStickyTaskList_argsTupleSchemeFactory implements SchemeFactory {
      public ResetStickyTaskList_argsTupleScheme getScheme() {
        return new ResetStickyTaskList_argsTupleScheme();
      }
    }

    private static class ResetStickyTaskList_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, ResetStickyTaskList_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.resetRequest = new com.uber.cadence.ResetStickyTaskListRequest();
          struct.resetRequest.read(iprot);
          struct.setResetRequestIsSet(true);
        }
      }
    }

  }

  public static class ResetStickyTaskList_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("ResetStickyTaskList_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 BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("domainNotActiveError", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

    public com.uber.cadence.ResetStickyTaskListResponse success; // required
    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // required
    public com.uber.cadence.DomainNotActiveError domainNotActiveError; // 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"),
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      LIMIT_EXCEEDED_ERROR((short)4, "limitExceededError"),
      SERVICE_BUSY_ERROR((short)5, "serviceBusyError"),
      DOMAIN_NOT_ACTIVE_ERROR((short)6, "domainNotActiveError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          case 5: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          case 6: // DOMAIN_NOT_ACTIVE_ERROR
            return DOMAIN_NOT_ACTIVE_ERROR;
          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, com.uber.cadence.ResetStickyTaskListResponse.class)));
      tmpMap.put(_Fields.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DOMAIN_NOT_ACTIVE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("domainNotActiveError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ResetStickyTaskList_result.class, metaDataMap);
    }

    public ResetStickyTaskList_result() {
    }

    public ResetStickyTaskList_result(
      com.uber.cadence.ResetStickyTaskListResponse success,
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.LimitExceededError limitExceededError,
      com.uber.cadence.ServiceBusyError serviceBusyError,
      com.uber.cadence.DomainNotActiveError domainNotActiveError)
    {
      this();
      this.success = success;
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.limitExceededError = limitExceededError;
      this.serviceBusyError = serviceBusyError;
      this.domainNotActiveError = domainNotActiveError;
    }

    /**
     * Performs a deep copy on other.
     */
    public ResetStickyTaskList_result(ResetStickyTaskList_result other) {
      if (other.isSetSuccess()) {
        this.success = new com.uber.cadence.ResetStickyTaskListResponse(other.success);
      }
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
      if (other.isSetDomainNotActiveError()) {
        this.domainNotActiveError = new com.uber.cadence.DomainNotActiveError(other.domainNotActiveError);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.limitExceededError = null;
      this.serviceBusyError = null;
      this.domainNotActiveError = null;
    }

    public com.uber.cadence.ResetStickyTaskListResponse getSuccess() {
      return this.success;
    }

    public ResetStickyTaskList_result setSuccess(com.uber.cadence.ResetStickyTaskListResponse 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 com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public ResetStickyTaskList_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public ResetStickyTaskList_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public ResetStickyTaskList_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public ResetStickyTaskList_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public ResetStickyTaskList_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

    public com.uber.cadence.DomainNotActiveError getDomainNotActiveError() {
      return this.domainNotActiveError;
    }

    public ResetStickyTaskList_result setDomainNotActiveError(com.uber.cadence.DomainNotActiveError domainNotActiveError) {
      this.domainNotActiveError = domainNotActiveError;
      return this;
    }

    public void unsetDomainNotActiveError() {
      this.domainNotActiveError = null;
    }

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

    public void setDomainNotActiveErrorIsSet(boolean value) {
      if (!value) {
        this.domainNotActiveError = null;
      }
    }

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

      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      case DOMAIN_NOT_ACTIVE_ERROR:
        if (value == null) {
          unsetDomainNotActiveError();
        } else {
          setDomainNotActiveError((com.uber.cadence.DomainNotActiveError)value);
        }
        break;

      }
    }

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

      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      case DOMAIN_NOT_ACTIVE_ERROR:
        return getDomainNotActiveError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      case DOMAIN_NOT_ACTIVE_ERROR:
        return isSetDomainNotActiveError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(ResetStickyTaskList_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_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          return false;
      }

      boolean this_present_domainNotActiveError = true && this.isSetDomainNotActiveError();
      boolean that_present_domainNotActiveError = true && that.isSetDomainNotActiveError();
      if (this_present_domainNotActiveError || that_present_domainNotActiveError) {
        if (!(this_present_domainNotActiveError && that_present_domainNotActiveError))
          return false;
        if (!this.domainNotActiveError.equals(that.domainNotActiveError))
          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_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      boolean present_domainNotActiveError = true && (isSetDomainNotActiveError());
      list.add(present_domainNotActiveError);
      if (present_domainNotActiveError)
        list.add(domainNotActiveError);

      return list.hashCode();
    }

    @Override
    public int compareTo(ResetStickyTaskList_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(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDomainNotActiveError()).compareTo(other.isSetDomainNotActiveError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDomainNotActiveError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainNotActiveError, other.domainNotActiveError);
        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("ResetStickyTaskList_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("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("domainNotActiveError:");
      if (this.domainNotActiveError == null) {
        sb.append("null");
      } else {
        sb.append(this.domainNotActiveError);
      }
      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 ResetStickyTaskList_resultStandardSchemeFactory implements SchemeFactory {
      public ResetStickyTaskList_resultStandardScheme getScheme() {
        return new ResetStickyTaskList_resultStandardScheme();
      }
    }

    private static class ResetStickyTaskList_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, ResetStickyTaskList_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 com.uber.cadence.ResetStickyTaskListResponse();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // DOMAIN_NOT_ACTIVE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
                struct.domainNotActiveError.read(iprot);
                struct.setDomainNotActiveErrorIsSet(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, ResetStickyTaskList_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.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.domainNotActiveError != null) {
          oprot.writeFieldBegin(DOMAIN_NOT_ACTIVE_ERROR_FIELD_DESC);
          struct.domainNotActiveError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class ResetStickyTaskList_resultTupleSchemeFactory implements SchemeFactory {
      public ResetStickyTaskList_resultTupleScheme getScheme() {
        return new ResetStickyTaskList_resultTupleScheme();
      }
    }

    private static class ResetStickyTaskList_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, ResetStickyTaskList_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetBadRequestError()) {
          optionals.set(1);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(2);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(3);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(4);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(5);
        }
        if (struct.isSetDomainNotActiveError()) {
          optionals.set(6);
        }
        oprot.writeBitSet(optionals, 7);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
        if (struct.isSetDomainNotActiveError()) {
          struct.domainNotActiveError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, ResetStickyTaskList_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(7);
        if (incoming.get(0)) {
          struct.success = new com.uber.cadence.ResetStickyTaskListResponse();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
        if (incoming.get(6)) {
          struct.domainNotActiveError = new com.uber.cadence.DomainNotActiveError();
          struct.domainNotActiveError.read(iprot);
          struct.setDomainNotActiveErrorIsSet(true);
        }
      }
    }

  }

  public static class QueryWorkflow_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("QueryWorkflow_args");

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

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

    public com.uber.cadence.QueryWorkflowRequest queryRequest; // 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 {
      QUERY_REQUEST((short)1, "queryRequest");

      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: // QUERY_REQUEST
            return QUERY_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.QUERY_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("queryRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.QueryWorkflowRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(QueryWorkflow_args.class, metaDataMap);
    }

    public QueryWorkflow_args() {
    }

    public QueryWorkflow_args(
      com.uber.cadence.QueryWorkflowRequest queryRequest)
    {
      this();
      this.queryRequest = queryRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public QueryWorkflow_args(QueryWorkflow_args other) {
      if (other.isSetQueryRequest()) {
        this.queryRequest = new com.uber.cadence.QueryWorkflowRequest(other.queryRequest);
      }
    }

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

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

    public com.uber.cadence.QueryWorkflowRequest getQueryRequest() {
      return this.queryRequest;
    }

    public QueryWorkflow_args setQueryRequest(com.uber.cadence.QueryWorkflowRequest queryRequest) {
      this.queryRequest = queryRequest;
      return this;
    }

    public void unsetQueryRequest() {
      this.queryRequest = null;
    }

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

    public void setQueryRequestIsSet(boolean value) {
      if (!value) {
        this.queryRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case QUERY_REQUEST:
        if (value == null) {
          unsetQueryRequest();
        } else {
          setQueryRequest((com.uber.cadence.QueryWorkflowRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case QUERY_REQUEST:
        return getQueryRequest();

      }
      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 QUERY_REQUEST:
        return isSetQueryRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_queryRequest = true && this.isSetQueryRequest();
      boolean that_present_queryRequest = true && that.isSetQueryRequest();
      if (this_present_queryRequest || that_present_queryRequest) {
        if (!(this_present_queryRequest && that_present_queryRequest))
          return false;
        if (!this.queryRequest.equals(that.queryRequest))
          return false;
      }

      return true;
    }

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

      boolean present_queryRequest = true && (isSetQueryRequest());
      list.add(present_queryRequest);
      if (present_queryRequest)
        list.add(queryRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetQueryRequest()).compareTo(other.isSetQueryRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetQueryRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryRequest, other.queryRequest);
        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("QueryWorkflow_args(");
      boolean first = true;

      sb.append("queryRequest:");
      if (this.queryRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.queryRequest);
      }
      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 (queryRequest != null) {
        queryRequest.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 QueryWorkflow_argsStandardSchemeFactory implements SchemeFactory {
      public QueryWorkflow_argsStandardScheme getScheme() {
        return new QueryWorkflow_argsStandardScheme();
      }
    }

    private static class QueryWorkflow_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, QueryWorkflow_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: // QUERY_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.queryRequest = new com.uber.cadence.QueryWorkflowRequest();
                struct.queryRequest.read(iprot);
                struct.setQueryRequestIsSet(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, QueryWorkflow_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class QueryWorkflow_argsTupleSchemeFactory implements SchemeFactory {
      public QueryWorkflow_argsTupleScheme getScheme() {
        return new QueryWorkflow_argsTupleScheme();
      }
    }

    private static class QueryWorkflow_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, QueryWorkflow_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.queryRequest = new com.uber.cadence.QueryWorkflowRequest();
          struct.queryRequest.read(iprot);
          struct.setQueryRequestIsSet(true);
        }
      }
    }

  }

  public static class QueryWorkflow_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("QueryWorkflow_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 BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField QUERY_FAILED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("queryFailedError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

    public com.uber.cadence.QueryWorkflowResponse success; // required
    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.QueryFailedError queryFailedError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // 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"),
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      QUERY_FAILED_ERROR((short)4, "queryFailedError"),
      LIMIT_EXCEEDED_ERROR((short)5, "limitExceededError"),
      SERVICE_BUSY_ERROR((short)6, "serviceBusyError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // QUERY_FAILED_ERROR
            return QUERY_FAILED_ERROR;
          case 5: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          case 6: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          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, com.uber.cadence.QueryWorkflowResponse.class)));
      tmpMap.put(_Fields.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.QUERY_FAILED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("queryFailedError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(QueryWorkflow_result.class, metaDataMap);
    }

    public QueryWorkflow_result() {
    }

    public QueryWorkflow_result(
      com.uber.cadence.QueryWorkflowResponse success,
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.QueryFailedError queryFailedError,
      com.uber.cadence.LimitExceededError limitExceededError,
      com.uber.cadence.ServiceBusyError serviceBusyError)
    {
      this();
      this.success = success;
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.queryFailedError = queryFailedError;
      this.limitExceededError = limitExceededError;
      this.serviceBusyError = serviceBusyError;
    }

    /**
     * Performs a deep copy on other.
     */
    public QueryWorkflow_result(QueryWorkflow_result other) {
      if (other.isSetSuccess()) {
        this.success = new com.uber.cadence.QueryWorkflowResponse(other.success);
      }
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetQueryFailedError()) {
        this.queryFailedError = new com.uber.cadence.QueryFailedError(other.queryFailedError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.queryFailedError = null;
      this.limitExceededError = null;
      this.serviceBusyError = null;
    }

    public com.uber.cadence.QueryWorkflowResponse getSuccess() {
      return this.success;
    }

    public QueryWorkflow_result setSuccess(com.uber.cadence.QueryWorkflowResponse 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 com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public QueryWorkflow_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public QueryWorkflow_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public QueryWorkflow_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.QueryFailedError getQueryFailedError() {
      return this.queryFailedError;
    }

    public QueryWorkflow_result setQueryFailedError(com.uber.cadence.QueryFailedError queryFailedError) {
      this.queryFailedError = queryFailedError;
      return this;
    }

    public void unsetQueryFailedError() {
      this.queryFailedError = null;
    }

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

    public void setQueryFailedErrorIsSet(boolean value) {
      if (!value) {
        this.queryFailedError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public QueryWorkflow_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public QueryWorkflow_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

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

      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case QUERY_FAILED_ERROR:
        if (value == null) {
          unsetQueryFailedError();
        } else {
          setQueryFailedError((com.uber.cadence.QueryFailedError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      }
    }

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

      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case QUERY_FAILED_ERROR:
        return getQueryFailedError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case QUERY_FAILED_ERROR:
        return isSetQueryFailedError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(QueryWorkflow_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_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_queryFailedError = true && this.isSetQueryFailedError();
      boolean that_present_queryFailedError = true && that.isSetQueryFailedError();
      if (this_present_queryFailedError || that_present_queryFailedError) {
        if (!(this_present_queryFailedError && that_present_queryFailedError))
          return false;
        if (!this.queryFailedError.equals(that.queryFailedError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          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_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_queryFailedError = true && (isSetQueryFailedError());
      list.add(present_queryFailedError);
      if (present_queryFailedError)
        list.add(queryFailedError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      return list.hashCode();
    }

    @Override
    public int compareTo(QueryWorkflow_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(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetQueryFailedError()).compareTo(other.isSetQueryFailedError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetQueryFailedError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryFailedError, other.queryFailedError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        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("QueryWorkflow_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("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("queryFailedError:");
      if (this.queryFailedError == null) {
        sb.append("null");
      } else {
        sb.append(this.queryFailedError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      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 QueryWorkflow_resultStandardSchemeFactory implements SchemeFactory {
      public QueryWorkflow_resultStandardScheme getScheme() {
        return new QueryWorkflow_resultStandardScheme();
      }
    }

    private static class QueryWorkflow_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, QueryWorkflow_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 com.uber.cadence.QueryWorkflowResponse();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // QUERY_FAILED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.queryFailedError = new com.uber.cadence.QueryFailedError();
                struct.queryFailedError.read(iprot);
                struct.setQueryFailedErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(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, QueryWorkflow_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.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.queryFailedError != null) {
          oprot.writeFieldBegin(QUERY_FAILED_ERROR_FIELD_DESC);
          struct.queryFailedError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class QueryWorkflow_resultTupleSchemeFactory implements SchemeFactory {
      public QueryWorkflow_resultTupleScheme getScheme() {
        return new QueryWorkflow_resultTupleScheme();
      }
    }

    private static class QueryWorkflow_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, QueryWorkflow_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetBadRequestError()) {
          optionals.set(1);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(2);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(3);
        }
        if (struct.isSetQueryFailedError()) {
          optionals.set(4);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(5);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(6);
        }
        oprot.writeBitSet(optionals, 7);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetQueryFailedError()) {
          struct.queryFailedError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, QueryWorkflow_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(7);
        if (incoming.get(0)) {
          struct.success = new com.uber.cadence.QueryWorkflowResponse();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.queryFailedError = new com.uber.cadence.QueryFailedError();
          struct.queryFailedError.read(iprot);
          struct.setQueryFailedErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
        if (incoming.get(6)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
      }
    }

  }

  public static class DescribeWorkflowExecution_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("DescribeWorkflowExecution_args");

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

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

    public com.uber.cadence.DescribeWorkflowExecutionRequest describeRequest; // 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 {
      DESCRIBE_REQUEST((short)1, "describeRequest");

      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: // DESCRIBE_REQUEST
            return DESCRIBE_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.DESCRIBE_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("describeRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.uber.cadence.DescribeWorkflowExecutionRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DescribeWorkflowExecution_args.class, metaDataMap);
    }

    public DescribeWorkflowExecution_args() {
    }

    public DescribeWorkflowExecution_args(
      com.uber.cadence.DescribeWorkflowExecutionRequest describeRequest)
    {
      this();
      this.describeRequest = describeRequest;
    }

    /**
     * Performs a deep copy on other.
     */
    public DescribeWorkflowExecution_args(DescribeWorkflowExecution_args other) {
      if (other.isSetDescribeRequest()) {
        this.describeRequest = new com.uber.cadence.DescribeWorkflowExecutionRequest(other.describeRequest);
      }
    }

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

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

    public com.uber.cadence.DescribeWorkflowExecutionRequest getDescribeRequest() {
      return this.describeRequest;
    }

    public DescribeWorkflowExecution_args setDescribeRequest(com.uber.cadence.DescribeWorkflowExecutionRequest describeRequest) {
      this.describeRequest = describeRequest;
      return this;
    }

    public void unsetDescribeRequest() {
      this.describeRequest = null;
    }

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

    public void setDescribeRequestIsSet(boolean value) {
      if (!value) {
        this.describeRequest = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case DESCRIBE_REQUEST:
        if (value == null) {
          unsetDescribeRequest();
        } else {
          setDescribeRequest((com.uber.cadence.DescribeWorkflowExecutionRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case DESCRIBE_REQUEST:
        return getDescribeRequest();

      }
      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 DESCRIBE_REQUEST:
        return isSetDescribeRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_describeRequest = true && this.isSetDescribeRequest();
      boolean that_present_describeRequest = true && that.isSetDescribeRequest();
      if (this_present_describeRequest || that_present_describeRequest) {
        if (!(this_present_describeRequest && that_present_describeRequest))
          return false;
        if (!this.describeRequest.equals(that.describeRequest))
          return false;
      }

      return true;
    }

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

      boolean present_describeRequest = true && (isSetDescribeRequest());
      list.add(present_describeRequest);
      if (present_describeRequest)
        list.add(describeRequest);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetDescribeRequest()).compareTo(other.isSetDescribeRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDescribeRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.describeRequest, other.describeRequest);
        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("DescribeWorkflowExecution_args(");
      boolean first = true;

      sb.append("describeRequest:");
      if (this.describeRequest == null) {
        sb.append("null");
      } else {
        sb.append(this.describeRequest);
      }
      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 (describeRequest != null) {
        describeRequest.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 DescribeWorkflowExecution_argsStandardSchemeFactory implements SchemeFactory {
      public DescribeWorkflowExecution_argsStandardScheme getScheme() {
        return new DescribeWorkflowExecution_argsStandardScheme();
      }
    }

    private static class DescribeWorkflowExecution_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, DescribeWorkflowExecution_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: // DESCRIBE_REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.describeRequest = new com.uber.cadence.DescribeWorkflowExecutionRequest();
                struct.describeRequest.read(iprot);
                struct.setDescribeRequestIsSet(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, DescribeWorkflowExecution_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class DescribeWorkflowExecution_argsTupleSchemeFactory implements SchemeFactory {
      public DescribeWorkflowExecution_argsTupleScheme getScheme() {
        return new DescribeWorkflowExecution_argsTupleScheme();
      }
    }

    private static class DescribeWorkflowExecution_argsTupleScheme extends TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, DescribeWorkflowExecution_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.describeRequest = new com.uber.cadence.DescribeWorkflowExecutionRequest();
          struct.describeRequest.read(iprot);
          struct.setDescribeRequestIsSet(true);
        }
      }
    }

  }

  public static class DescribeWorkflowExecution_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("DescribeWorkflowExecution_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 BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)5);

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

    public com.uber.cadence.DescribeWorkflowExecutionResponse success; // required
    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // 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"),
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      LIMIT_EXCEEDED_ERROR((short)4, "limitExceededError"),
      SERVICE_BUSY_ERROR((short)5, "serviceBusyError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          case 5: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          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, com.uber.cadence.DescribeWorkflowExecutionResponse.class)));
      tmpMap.put(_Fields.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DescribeWorkflowExecution_result.class, metaDataMap);
    }

    public DescribeWorkflowExecution_result() {
    }

    public DescribeWorkflowExecution_result(
      com.uber.cadence.DescribeWorkflowExecutionResponse success,
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.LimitExceededError limitExceededError,
      com.uber.cadence.ServiceBusyError serviceBusyError)
    {
      this();
      this.success = success;
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.limitExceededError = limitExceededError;
      this.serviceBusyError = serviceBusyError;
    }

    /**
     * Performs a deep copy on other.
     */
    public DescribeWorkflowExecution_result(DescribeWorkflowExecution_result other) {
      if (other.isSetSuccess()) {
        this.success = new com.uber.cadence.DescribeWorkflowExecutionResponse(other.success);
      }
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.limitExceededError = null;
      this.serviceBusyError = null;
    }

    public com.uber.cadence.DescribeWorkflowExecutionResponse getSuccess() {
      return this.success;
    }

    public DescribeWorkflowExecution_result setSuccess(com.uber.cadence.DescribeWorkflowExecutionResponse 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 com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public DescribeWorkflowExecution_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public DescribeWorkflowExecution_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public DescribeWorkflowExecution_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public DescribeWorkflowExecution_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public DescribeWorkflowExecution_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

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

      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      }
    }

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

      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(DescribeWorkflowExecution_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_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          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_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      return list.hashCode();
    }

    @Override
    public int compareTo(DescribeWorkflowExecution_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(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        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("DescribeWorkflowExecution_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("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      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 DescribeWorkflowExecution_resultStandardSchemeFactory implements SchemeFactory {
      public DescribeWorkflowExecution_resultStandardScheme getScheme() {
        return new DescribeWorkflowExecution_resultStandardScheme();
      }
    }

    private static class DescribeWorkflowExecution_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, DescribeWorkflowExecution_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 com.uber.cadence.DescribeWorkflowExecutionResponse();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(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, DescribeWorkflowExecution_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.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class DescribeWorkflowExecution_resultTupleSchemeFactory implements SchemeFactory {
      public DescribeWorkflowExecution_resultTupleScheme getScheme() {
        return new DescribeWorkflowExecution_resultTupleScheme();
      }
    }

    private static class DescribeWorkflowExecution_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, DescribeWorkflowExecution_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetBadRequestError()) {
          optionals.set(1);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(2);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(3);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(4);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(5);
        }
        oprot.writeBitSet(optionals, 6);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, DescribeWorkflowExecution_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(6);
        if (incoming.get(0)) {
          struct.success = new com.uber.cadence.DescribeWorkflowExecutionResponse();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
      }
    }

  }

  public static class DescribeTaskList_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("DescribeTaskList_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 DescribeTaskList_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new DescribeTaskList_argsTupleSchemeFactory());
    }

    public com.uber.cadence.DescribeTaskListRequest 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, com.uber.cadence.DescribeTaskListRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DescribeTaskList_args.class, metaDataMap);
    }

    public DescribeTaskList_args() {
    }

    public DescribeTaskList_args(
      com.uber.cadence.DescribeTaskListRequest request)
    {
      this();
      this.request = request;
    }

    /**
     * Performs a deep copy on other.
     */
    public DescribeTaskList_args(DescribeTaskList_args other) {
      if (other.isSetRequest()) {
        this.request = new com.uber.cadence.DescribeTaskListRequest(other.request);
      }
    }

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

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

    public com.uber.cadence.DescribeTaskListRequest getRequest() {
      return this.request;
    }

    public DescribeTaskList_args setRequest(com.uber.cadence.DescribeTaskListRequest 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((com.uber.cadence.DescribeTaskListRequest)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 DescribeTaskList_args)
        return this.equals((DescribeTaskList_args)that);
      return false;
    }

    public boolean equals(DescribeTaskList_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(DescribeTaskList_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("DescribeTaskList_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 DescribeTaskList_argsStandardSchemeFactory implements SchemeFactory {
      public DescribeTaskList_argsStandardScheme getScheme() {
        return new DescribeTaskList_argsStandardScheme();
      }
    }

    private static class DescribeTaskList_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, DescribeTaskList_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 com.uber.cadence.DescribeTaskListRequest();
                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, DescribeTaskList_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 DescribeTaskList_argsTupleSchemeFactory implements SchemeFactory {
      public DescribeTaskList_argsTupleScheme getScheme() {
        return new DescribeTaskList_argsTupleScheme();
      }
    }

    private static class DescribeTaskList_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, DescribeTaskList_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, DescribeTaskList_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.request = new com.uber.cadence.DescribeTaskListRequest();
          struct.request.read(iprot);
          struct.setRequestIsSet(true);
        }
      }
    }

  }

  public static class DescribeTaskList_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("DescribeTaskList_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 BAD_REQUEST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("badRequestError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField INTERNAL_SERVICE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("internalServiceError", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ENTITY_NOT_EXIST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("entityNotExistError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField LIMIT_EXCEEDED_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("limitExceededError", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField SERVICE_BUSY_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceBusyError", org.apache.thrift.protocol.TType.STRUCT, (short)5);

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

    public com.uber.cadence.DescribeTaskListResponse success; // required
    public com.uber.cadence.BadRequestError badRequestError; // required
    public com.uber.cadence.InternalServiceError internalServiceError; // required
    public com.uber.cadence.EntityNotExistsError entityNotExistError; // required
    public com.uber.cadence.LimitExceededError limitExceededError; // required
    public com.uber.cadence.ServiceBusyError serviceBusyError; // 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"),
      BAD_REQUEST_ERROR((short)1, "badRequestError"),
      INTERNAL_SERVICE_ERROR((short)2, "internalServiceError"),
      ENTITY_NOT_EXIST_ERROR((short)3, "entityNotExistError"),
      LIMIT_EXCEEDED_ERROR((short)4, "limitExceededError"),
      SERVICE_BUSY_ERROR((short)5, "serviceBusyError");

      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: // BAD_REQUEST_ERROR
            return BAD_REQUEST_ERROR;
          case 2: // INTERNAL_SERVICE_ERROR
            return INTERNAL_SERVICE_ERROR;
          case 3: // ENTITY_NOT_EXIST_ERROR
            return ENTITY_NOT_EXIST_ERROR;
          case 4: // LIMIT_EXCEEDED_ERROR
            return LIMIT_EXCEEDED_ERROR;
          case 5: // SERVICE_BUSY_ERROR
            return SERVICE_BUSY_ERROR;
          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, com.uber.cadence.DescribeTaskListResponse.class)));
      tmpMap.put(_Fields.BAD_REQUEST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("badRequestError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.INTERNAL_SERVICE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("internalServiceError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.ENTITY_NOT_EXIST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("entityNotExistError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.LIMIT_EXCEEDED_ERROR, new org.apache.thrift.meta_data.FieldMetaData("limitExceededError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.SERVICE_BUSY_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serviceBusyError", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DescribeTaskList_result.class, metaDataMap);
    }

    public DescribeTaskList_result() {
    }

    public DescribeTaskList_result(
      com.uber.cadence.DescribeTaskListResponse success,
      com.uber.cadence.BadRequestError badRequestError,
      com.uber.cadence.InternalServiceError internalServiceError,
      com.uber.cadence.EntityNotExistsError entityNotExistError,
      com.uber.cadence.LimitExceededError limitExceededError,
      com.uber.cadence.ServiceBusyError serviceBusyError)
    {
      this();
      this.success = success;
      this.badRequestError = badRequestError;
      this.internalServiceError = internalServiceError;
      this.entityNotExistError = entityNotExistError;
      this.limitExceededError = limitExceededError;
      this.serviceBusyError = serviceBusyError;
    }

    /**
     * Performs a deep copy on other.
     */
    public DescribeTaskList_result(DescribeTaskList_result other) {
      if (other.isSetSuccess()) {
        this.success = new com.uber.cadence.DescribeTaskListResponse(other.success);
      }
      if (other.isSetBadRequestError()) {
        this.badRequestError = new com.uber.cadence.BadRequestError(other.badRequestError);
      }
      if (other.isSetInternalServiceError()) {
        this.internalServiceError = new com.uber.cadence.InternalServiceError(other.internalServiceError);
      }
      if (other.isSetEntityNotExistError()) {
        this.entityNotExistError = new com.uber.cadence.EntityNotExistsError(other.entityNotExistError);
      }
      if (other.isSetLimitExceededError()) {
        this.limitExceededError = new com.uber.cadence.LimitExceededError(other.limitExceededError);
      }
      if (other.isSetServiceBusyError()) {
        this.serviceBusyError = new com.uber.cadence.ServiceBusyError(other.serviceBusyError);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.badRequestError = null;
      this.internalServiceError = null;
      this.entityNotExistError = null;
      this.limitExceededError = null;
      this.serviceBusyError = null;
    }

    public com.uber.cadence.DescribeTaskListResponse getSuccess() {
      return this.success;
    }

    public DescribeTaskList_result setSuccess(com.uber.cadence.DescribeTaskListResponse 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 com.uber.cadence.BadRequestError getBadRequestError() {
      return this.badRequestError;
    }

    public DescribeTaskList_result setBadRequestError(com.uber.cadence.BadRequestError badRequestError) {
      this.badRequestError = badRequestError;
      return this;
    }

    public void unsetBadRequestError() {
      this.badRequestError = null;
    }

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

    public void setBadRequestErrorIsSet(boolean value) {
      if (!value) {
        this.badRequestError = null;
      }
    }

    public com.uber.cadence.InternalServiceError getInternalServiceError() {
      return this.internalServiceError;
    }

    public DescribeTaskList_result setInternalServiceError(com.uber.cadence.InternalServiceError internalServiceError) {
      this.internalServiceError = internalServiceError;
      return this;
    }

    public void unsetInternalServiceError() {
      this.internalServiceError = null;
    }

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

    public void setInternalServiceErrorIsSet(boolean value) {
      if (!value) {
        this.internalServiceError = null;
      }
    }

    public com.uber.cadence.EntityNotExistsError getEntityNotExistError() {
      return this.entityNotExistError;
    }

    public DescribeTaskList_result setEntityNotExistError(com.uber.cadence.EntityNotExistsError entityNotExistError) {
      this.entityNotExistError = entityNotExistError;
      return this;
    }

    public void unsetEntityNotExistError() {
      this.entityNotExistError = null;
    }

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

    public void setEntityNotExistErrorIsSet(boolean value) {
      if (!value) {
        this.entityNotExistError = null;
      }
    }

    public com.uber.cadence.LimitExceededError getLimitExceededError() {
      return this.limitExceededError;
    }

    public DescribeTaskList_result setLimitExceededError(com.uber.cadence.LimitExceededError limitExceededError) {
      this.limitExceededError = limitExceededError;
      return this;
    }

    public void unsetLimitExceededError() {
      this.limitExceededError = null;
    }

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

    public void setLimitExceededErrorIsSet(boolean value) {
      if (!value) {
        this.limitExceededError = null;
      }
    }

    public com.uber.cadence.ServiceBusyError getServiceBusyError() {
      return this.serviceBusyError;
    }

    public DescribeTaskList_result setServiceBusyError(com.uber.cadence.ServiceBusyError serviceBusyError) {
      this.serviceBusyError = serviceBusyError;
      return this;
    }

    public void unsetServiceBusyError() {
      this.serviceBusyError = null;
    }

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

    public void setServiceBusyErrorIsSet(boolean value) {
      if (!value) {
        this.serviceBusyError = null;
      }
    }

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

      case BAD_REQUEST_ERROR:
        if (value == null) {
          unsetBadRequestError();
        } else {
          setBadRequestError((com.uber.cadence.BadRequestError)value);
        }
        break;

      case INTERNAL_SERVICE_ERROR:
        if (value == null) {
          unsetInternalServiceError();
        } else {
          setInternalServiceError((com.uber.cadence.InternalServiceError)value);
        }
        break;

      case ENTITY_NOT_EXIST_ERROR:
        if (value == null) {
          unsetEntityNotExistError();
        } else {
          setEntityNotExistError((com.uber.cadence.EntityNotExistsError)value);
        }
        break;

      case LIMIT_EXCEEDED_ERROR:
        if (value == null) {
          unsetLimitExceededError();
        } else {
          setLimitExceededError((com.uber.cadence.LimitExceededError)value);
        }
        break;

      case SERVICE_BUSY_ERROR:
        if (value == null) {
          unsetServiceBusyError();
        } else {
          setServiceBusyError((com.uber.cadence.ServiceBusyError)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case BAD_REQUEST_ERROR:
        return getBadRequestError();

      case INTERNAL_SERVICE_ERROR:
        return getInternalServiceError();

      case ENTITY_NOT_EXIST_ERROR:
        return getEntityNotExistError();

      case LIMIT_EXCEEDED_ERROR:
        return getLimitExceededError();

      case SERVICE_BUSY_ERROR:
        return getServiceBusyError();

      }
      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 BAD_REQUEST_ERROR:
        return isSetBadRequestError();
      case INTERNAL_SERVICE_ERROR:
        return isSetInternalServiceError();
      case ENTITY_NOT_EXIST_ERROR:
        return isSetEntityNotExistError();
      case LIMIT_EXCEEDED_ERROR:
        return isSetLimitExceededError();
      case SERVICE_BUSY_ERROR:
        return isSetServiceBusyError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof DescribeTaskList_result)
        return this.equals((DescribeTaskList_result)that);
      return false;
    }

    public boolean equals(DescribeTaskList_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_badRequestError = true && this.isSetBadRequestError();
      boolean that_present_badRequestError = true && that.isSetBadRequestError();
      if (this_present_badRequestError || that_present_badRequestError) {
        if (!(this_present_badRequestError && that_present_badRequestError))
          return false;
        if (!this.badRequestError.equals(that.badRequestError))
          return false;
      }

      boolean this_present_internalServiceError = true && this.isSetInternalServiceError();
      boolean that_present_internalServiceError = true && that.isSetInternalServiceError();
      if (this_present_internalServiceError || that_present_internalServiceError) {
        if (!(this_present_internalServiceError && that_present_internalServiceError))
          return false;
        if (!this.internalServiceError.equals(that.internalServiceError))
          return false;
      }

      boolean this_present_entityNotExistError = true && this.isSetEntityNotExistError();
      boolean that_present_entityNotExistError = true && that.isSetEntityNotExistError();
      if (this_present_entityNotExistError || that_present_entityNotExistError) {
        if (!(this_present_entityNotExistError && that_present_entityNotExistError))
          return false;
        if (!this.entityNotExistError.equals(that.entityNotExistError))
          return false;
      }

      boolean this_present_limitExceededError = true && this.isSetLimitExceededError();
      boolean that_present_limitExceededError = true && that.isSetLimitExceededError();
      if (this_present_limitExceededError || that_present_limitExceededError) {
        if (!(this_present_limitExceededError && that_present_limitExceededError))
          return false;
        if (!this.limitExceededError.equals(that.limitExceededError))
          return false;
      }

      boolean this_present_serviceBusyError = true && this.isSetServiceBusyError();
      boolean that_present_serviceBusyError = true && that.isSetServiceBusyError();
      if (this_present_serviceBusyError || that_present_serviceBusyError) {
        if (!(this_present_serviceBusyError && that_present_serviceBusyError))
          return false;
        if (!this.serviceBusyError.equals(that.serviceBusyError))
          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_badRequestError = true && (isSetBadRequestError());
      list.add(present_badRequestError);
      if (present_badRequestError)
        list.add(badRequestError);

      boolean present_internalServiceError = true && (isSetInternalServiceError());
      list.add(present_internalServiceError);
      if (present_internalServiceError)
        list.add(internalServiceError);

      boolean present_entityNotExistError = true && (isSetEntityNotExistError());
      list.add(present_entityNotExistError);
      if (present_entityNotExistError)
        list.add(entityNotExistError);

      boolean present_limitExceededError = true && (isSetLimitExceededError());
      list.add(present_limitExceededError);
      if (present_limitExceededError)
        list.add(limitExceededError);

      boolean present_serviceBusyError = true && (isSetServiceBusyError());
      list.add(present_serviceBusyError);
      if (present_serviceBusyError)
        list.add(serviceBusyError);

      return list.hashCode();
    }

    @Override
    public int compareTo(DescribeTaskList_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(isSetBadRequestError()).compareTo(other.isSetBadRequestError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetBadRequestError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badRequestError, other.badRequestError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetInternalServiceError()).compareTo(other.isSetInternalServiceError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetInternalServiceError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalServiceError, other.internalServiceError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEntityNotExistError()).compareTo(other.isSetEntityNotExistError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntityNotExistError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityNotExistError, other.entityNotExistError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLimitExceededError()).compareTo(other.isSetLimitExceededError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLimitExceededError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitExceededError, other.limitExceededError);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServiceBusyError()).compareTo(other.isSetServiceBusyError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServiceBusyError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceBusyError, other.serviceBusyError);
        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("DescribeTaskList_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("badRequestError:");
      if (this.badRequestError == null) {
        sb.append("null");
      } else {
        sb.append(this.badRequestError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("internalServiceError:");
      if (this.internalServiceError == null) {
        sb.append("null");
      } else {
        sb.append(this.internalServiceError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("entityNotExistError:");
      if (this.entityNotExistError == null) {
        sb.append("null");
      } else {
        sb.append(this.entityNotExistError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("limitExceededError:");
      if (this.limitExceededError == null) {
        sb.append("null");
      } else {
        sb.append(this.limitExceededError);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serviceBusyError:");
      if (this.serviceBusyError == null) {
        sb.append("null");
      } else {
        sb.append(this.serviceBusyError);
      }
      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 DescribeTaskList_resultStandardSchemeFactory implements SchemeFactory {
      public DescribeTaskList_resultStandardScheme getScheme() {
        return new DescribeTaskList_resultStandardScheme();
      }
    }

    private static class DescribeTaskList_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, DescribeTaskList_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 com.uber.cadence.DescribeTaskListResponse();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // BAD_REQUEST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.badRequestError = new com.uber.cadence.BadRequestError();
                struct.badRequestError.read(iprot);
                struct.setBadRequestErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // INTERNAL_SERVICE_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.internalServiceError = new com.uber.cadence.InternalServiceError();
                struct.internalServiceError.read(iprot);
                struct.setInternalServiceErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ENTITY_NOT_EXIST_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
                struct.entityNotExistError.read(iprot);
                struct.setEntityNotExistErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // LIMIT_EXCEEDED_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.limitExceededError = new com.uber.cadence.LimitExceededError();
                struct.limitExceededError.read(iprot);
                struct.setLimitExceededErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // SERVICE_BUSY_ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
                struct.serviceBusyError.read(iprot);
                struct.setServiceBusyErrorIsSet(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, DescribeTaskList_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.badRequestError != null) {
          oprot.writeFieldBegin(BAD_REQUEST_ERROR_FIELD_DESC);
          struct.badRequestError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.internalServiceError != null) {
          oprot.writeFieldBegin(INTERNAL_SERVICE_ERROR_FIELD_DESC);
          struct.internalServiceError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.entityNotExistError != null) {
          oprot.writeFieldBegin(ENTITY_NOT_EXIST_ERROR_FIELD_DESC);
          struct.entityNotExistError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.limitExceededError != null) {
          oprot.writeFieldBegin(LIMIT_EXCEEDED_ERROR_FIELD_DESC);
          struct.limitExceededError.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.serviceBusyError != null) {
          oprot.writeFieldBegin(SERVICE_BUSY_ERROR_FIELD_DESC);
          struct.serviceBusyError.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class DescribeTaskList_resultTupleSchemeFactory implements SchemeFactory {
      public DescribeTaskList_resultTupleScheme getScheme() {
        return new DescribeTaskList_resultTupleScheme();
      }
    }

    private static class DescribeTaskList_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, DescribeTaskList_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetBadRequestError()) {
          optionals.set(1);
        }
        if (struct.isSetInternalServiceError()) {
          optionals.set(2);
        }
        if (struct.isSetEntityNotExistError()) {
          optionals.set(3);
        }
        if (struct.isSetLimitExceededError()) {
          optionals.set(4);
        }
        if (struct.isSetServiceBusyError()) {
          optionals.set(5);
        }
        oprot.writeBitSet(optionals, 6);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetBadRequestError()) {
          struct.badRequestError.write(oprot);
        }
        if (struct.isSetInternalServiceError()) {
          struct.internalServiceError.write(oprot);
        }
        if (struct.isSetEntityNotExistError()) {
          struct.entityNotExistError.write(oprot);
        }
        if (struct.isSetLimitExceededError()) {
          struct.limitExceededError.write(oprot);
        }
        if (struct.isSetServiceBusyError()) {
          struct.serviceBusyError.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, DescribeTaskList_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(6);
        if (incoming.get(0)) {
          struct.success = new com.uber.cadence.DescribeTaskListResponse();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.badRequestError = new com.uber.cadence.BadRequestError();
          struct.badRequestError.read(iprot);
          struct.setBadRequestErrorIsSet(true);
        }
        if (incoming.get(2)) {
          struct.internalServiceError = new com.uber.cadence.InternalServiceError();
          struct.internalServiceError.read(iprot);
          struct.setInternalServiceErrorIsSet(true);
        }
        if (incoming.get(3)) {
          struct.entityNotExistError = new com.uber.cadence.EntityNotExistsError();
          struct.entityNotExistError.read(iprot);
          struct.setEntityNotExistErrorIsSet(true);
        }
        if (incoming.get(4)) {
          struct.limitExceededError = new com.uber.cadence.LimitExceededError();
          struct.limitExceededError.read(iprot);
          struct.setLimitExceededErrorIsSet(true);
        }
        if (incoming.get(5)) {
          struct.serviceBusyError = new com.uber.cadence.ServiceBusyError();
          struct.serviceBusyError.read(iprot);
          struct.setServiceBusyErrorIsSet(true);
        }
      }
    }

  }

}