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

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

There is a newer version: 3.12.5
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.9.3)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package 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-06-18")
public class WorkflowExecutionStartedEventAttributes 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("WorkflowExecutionStartedEventAttributes");

  private static final org.apache.thrift.protocol.TField WORKFLOW_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("workflowType", org.apache.thrift.protocol.TType.STRUCT, (short)10);
  private static final org.apache.thrift.protocol.TField PARENT_WORKFLOW_DOMAIN_FIELD_DESC = new org.apache.thrift.protocol.TField("parentWorkflowDomain", org.apache.thrift.protocol.TType.STRING, (short)12);
  private static final org.apache.thrift.protocol.TField PARENT_WORKFLOW_EXECUTION_FIELD_DESC = new org.apache.thrift.protocol.TField("parentWorkflowExecution", org.apache.thrift.protocol.TType.STRUCT, (short)14);
  private static final org.apache.thrift.protocol.TField PARENT_INITIATED_EVENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("parentInitiatedEventId", org.apache.thrift.protocol.TType.I64, (short)16);
  private static final org.apache.thrift.protocol.TField TASK_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("taskList", org.apache.thrift.protocol.TType.STRUCT, (short)20);
  private static final org.apache.thrift.protocol.TField INPUT_FIELD_DESC = new org.apache.thrift.protocol.TField("input", org.apache.thrift.protocol.TType.STRING, (short)30);
  private static final org.apache.thrift.protocol.TField EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS_FIELD_DESC = new org.apache.thrift.protocol.TField("executionStartToCloseTimeoutSeconds", org.apache.thrift.protocol.TType.I32, (short)40);
  private static final org.apache.thrift.protocol.TField TASK_START_TO_CLOSE_TIMEOUT_SECONDS_FIELD_DESC = new org.apache.thrift.protocol.TField("taskStartToCloseTimeoutSeconds", org.apache.thrift.protocol.TType.I32, (short)50);
  private static final org.apache.thrift.protocol.TField CHILD_POLICY_FIELD_DESC = new org.apache.thrift.protocol.TField("childPolicy", org.apache.thrift.protocol.TType.I32, (short)52);
  private static final org.apache.thrift.protocol.TField CONTINUED_EXECUTION_RUN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("continuedExecutionRunId", org.apache.thrift.protocol.TType.STRING, (short)54);
  private static final org.apache.thrift.protocol.TField INITIATOR_FIELD_DESC = new org.apache.thrift.protocol.TField("initiator", org.apache.thrift.protocol.TType.I32, (short)55);
  private static final org.apache.thrift.protocol.TField CONTINUED_FAILURE_REASON_FIELD_DESC = new org.apache.thrift.protocol.TField("continuedFailureReason", org.apache.thrift.protocol.TType.STRING, (short)56);
  private static final org.apache.thrift.protocol.TField CONTINUED_FAILURE_DETAILS_FIELD_DESC = new org.apache.thrift.protocol.TField("continuedFailureDetails", org.apache.thrift.protocol.TType.STRING, (short)57);
  private static final org.apache.thrift.protocol.TField LAST_COMPLETION_RESULT_FIELD_DESC = new org.apache.thrift.protocol.TField("lastCompletionResult", org.apache.thrift.protocol.TType.STRING, (short)58);
  private static final org.apache.thrift.protocol.TField ORIGINAL_EXECUTION_RUN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("originalExecutionRunId", org.apache.thrift.protocol.TType.STRING, (short)59);
  private static final org.apache.thrift.protocol.TField IDENTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("identity", org.apache.thrift.protocol.TType.STRING, (short)60);
  private static final org.apache.thrift.protocol.TField FIRST_EXECUTION_RUN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("firstExecutionRunId", org.apache.thrift.protocol.TType.STRING, (short)61);
  private static final org.apache.thrift.protocol.TField RETRY_POLICY_FIELD_DESC = new org.apache.thrift.protocol.TField("retryPolicy", org.apache.thrift.protocol.TType.STRUCT, (short)70);
  private static final org.apache.thrift.protocol.TField ATTEMPT_FIELD_DESC = new org.apache.thrift.protocol.TField("attempt", org.apache.thrift.protocol.TType.I32, (short)80);
  private static final org.apache.thrift.protocol.TField EXPIRATION_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("expirationTimestamp", org.apache.thrift.protocol.TType.I64, (short)90);
  private static final org.apache.thrift.protocol.TField CRON_SCHEDULE_FIELD_DESC = new org.apache.thrift.protocol.TField("cronSchedule", org.apache.thrift.protocol.TType.STRING, (short)100);
  private static final org.apache.thrift.protocol.TField FIRST_DECISION_TASK_BACKOFF_SECONDS_FIELD_DESC = new org.apache.thrift.protocol.TField("firstDecisionTaskBackoffSeconds", org.apache.thrift.protocol.TType.I32, (short)110);
  private static final org.apache.thrift.protocol.TField MEMO_FIELD_DESC = new org.apache.thrift.protocol.TField("memo", org.apache.thrift.protocol.TType.STRUCT, (short)120);

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

  public WorkflowType workflowType; // optional
  public String parentWorkflowDomain; // optional
  public WorkflowExecution parentWorkflowExecution; // optional
  public long parentInitiatedEventId; // optional
  public TaskList taskList; // optional
  public ByteBuffer input; // optional
  public int executionStartToCloseTimeoutSeconds; // optional
  public int taskStartToCloseTimeoutSeconds; // optional
  /**
   * 
   * @see ChildPolicy
   */
  public ChildPolicy childPolicy; // optional
  public String continuedExecutionRunId; // optional
  public ContinueAsNewInitiator initiator; // optional
  public String continuedFailureReason; // optional
  public ByteBuffer continuedFailureDetails; // optional
  public ByteBuffer lastCompletionResult; // optional
  public String originalExecutionRunId; // optional
  public String identity; // optional
  public String firstExecutionRunId; // optional
  public RetryPolicy retryPolicy; // optional
  public int attempt; // optional
  public long expirationTimestamp; // optional
  public String cronSchedule; // optional
  public int firstDecisionTaskBackoffSeconds; // optional
  public Memo memo; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    WORKFLOW_TYPE((short)10, "workflowType"),
    PARENT_WORKFLOW_DOMAIN((short)12, "parentWorkflowDomain"),
    PARENT_WORKFLOW_EXECUTION((short)14, "parentWorkflowExecution"),
    PARENT_INITIATED_EVENT_ID((short)16, "parentInitiatedEventId"),
    TASK_LIST((short)20, "taskList"),
    INPUT((short)30, "input"),
    EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS((short)40, "executionStartToCloseTimeoutSeconds"),
    TASK_START_TO_CLOSE_TIMEOUT_SECONDS((short)50, "taskStartToCloseTimeoutSeconds"),
    /**
     * 
     * @see ChildPolicy
     */
    CHILD_POLICY((short)52, "childPolicy"),
    CONTINUED_EXECUTION_RUN_ID((short)54, "continuedExecutionRunId"),
    INITIATOR((short)55, "initiator"),
    CONTINUED_FAILURE_REASON((short)56, "continuedFailureReason"),
    CONTINUED_FAILURE_DETAILS((short)57, "continuedFailureDetails"),
    LAST_COMPLETION_RESULT((short)58, "lastCompletionResult"),
    ORIGINAL_EXECUTION_RUN_ID((short)59, "originalExecutionRunId"),
    IDENTITY((short)60, "identity"),
    FIRST_EXECUTION_RUN_ID((short)61, "firstExecutionRunId"),
    RETRY_POLICY((short)70, "retryPolicy"),
    ATTEMPT((short)80, "attempt"),
    EXPIRATION_TIMESTAMP((short)90, "expirationTimestamp"),
    CRON_SCHEDULE((short)100, "cronSchedule"),
    FIRST_DECISION_TASK_BACKOFF_SECONDS((short)110, "firstDecisionTaskBackoffSeconds"),
    MEMO((short)120, "memo");

    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 10: // WORKFLOW_TYPE
          return WORKFLOW_TYPE;
        case 12: // PARENT_WORKFLOW_DOMAIN
          return PARENT_WORKFLOW_DOMAIN;
        case 14: // PARENT_WORKFLOW_EXECUTION
          return PARENT_WORKFLOW_EXECUTION;
        case 16: // PARENT_INITIATED_EVENT_ID
          return PARENT_INITIATED_EVENT_ID;
        case 20: // TASK_LIST
          return TASK_LIST;
        case 30: // INPUT
          return INPUT;
        case 40: // EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS
          return EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS;
        case 50: // TASK_START_TO_CLOSE_TIMEOUT_SECONDS
          return TASK_START_TO_CLOSE_TIMEOUT_SECONDS;
        case 52: // CHILD_POLICY
          return CHILD_POLICY;
        case 54: // CONTINUED_EXECUTION_RUN_ID
          return CONTINUED_EXECUTION_RUN_ID;
        case 55: // INITIATOR
          return INITIATOR;
        case 56: // CONTINUED_FAILURE_REASON
          return CONTINUED_FAILURE_REASON;
        case 57: // CONTINUED_FAILURE_DETAILS
          return CONTINUED_FAILURE_DETAILS;
        case 58: // LAST_COMPLETION_RESULT
          return LAST_COMPLETION_RESULT;
        case 59: // ORIGINAL_EXECUTION_RUN_ID
          return ORIGINAL_EXECUTION_RUN_ID;
        case 60: // IDENTITY
          return IDENTITY;
        case 61: // FIRST_EXECUTION_RUN_ID
          return FIRST_EXECUTION_RUN_ID;
        case 70: // RETRY_POLICY
          return RETRY_POLICY;
        case 80: // ATTEMPT
          return ATTEMPT;
        case 90: // EXPIRATION_TIMESTAMP
          return EXPIRATION_TIMESTAMP;
        case 100: // CRON_SCHEDULE
          return CRON_SCHEDULE;
        case 110: // FIRST_DECISION_TASK_BACKOFF_SECONDS
          return FIRST_DECISION_TASK_BACKOFF_SECONDS;
        case 120: // MEMO
          return MEMO;
        default:
          return null;
      }
    }

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

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

    private final short _thriftId;
    private final String _fieldName;

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

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __PARENTINITIATEDEVENTID_ISSET_ID = 0;
  private static final int __EXECUTIONSTARTTOCLOSETIMEOUTSECONDS_ISSET_ID = 1;
  private static final int __TASKSTARTTOCLOSETIMEOUTSECONDS_ISSET_ID = 2;
  private static final int __ATTEMPT_ISSET_ID = 3;
  private static final int __EXPIRATIONTIMESTAMP_ISSET_ID = 4;
  private static final int __FIRSTDECISIONTASKBACKOFFSECONDS_ISSET_ID = 5;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.WORKFLOW_TYPE,_Fields.PARENT_WORKFLOW_DOMAIN,_Fields.PARENT_WORKFLOW_EXECUTION,_Fields.PARENT_INITIATED_EVENT_ID,_Fields.TASK_LIST,_Fields.INPUT,_Fields.EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS,_Fields.TASK_START_TO_CLOSE_TIMEOUT_SECONDS,_Fields.CHILD_POLICY,_Fields.CONTINUED_EXECUTION_RUN_ID,_Fields.INITIATOR,_Fields.CONTINUED_FAILURE_REASON,_Fields.CONTINUED_FAILURE_DETAILS,_Fields.LAST_COMPLETION_RESULT,_Fields.ORIGINAL_EXECUTION_RUN_ID,_Fields.IDENTITY,_Fields.FIRST_EXECUTION_RUN_ID,_Fields.RETRY_POLICY,_Fields.ATTEMPT,_Fields.EXPIRATION_TIMESTAMP,_Fields.CRON_SCHEDULE,_Fields.FIRST_DECISION_TASK_BACKOFF_SECONDS,_Fields.MEMO};
  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.WORKFLOW_TYPE, new org.apache.thrift.meta_data.FieldMetaData("workflowType", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, WorkflowType.class)));
    tmpMap.put(_Fields.PARENT_WORKFLOW_DOMAIN, new org.apache.thrift.meta_data.FieldMetaData("parentWorkflowDomain", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.PARENT_WORKFLOW_EXECUTION, new org.apache.thrift.meta_data.FieldMetaData("parentWorkflowExecution", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, WorkflowExecution.class)));
    tmpMap.put(_Fields.PARENT_INITIATED_EVENT_ID, new org.apache.thrift.meta_data.FieldMetaData("parentInitiatedEventId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.TASK_LIST, new org.apache.thrift.meta_data.FieldMetaData("taskList", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TaskList.class)));
    tmpMap.put(_Fields.INPUT, new org.apache.thrift.meta_data.FieldMetaData("input", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
    tmpMap.put(_Fields.EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS, new org.apache.thrift.meta_data.FieldMetaData("executionStartToCloseTimeoutSeconds", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.TASK_START_TO_CLOSE_TIMEOUT_SECONDS, new org.apache.thrift.meta_data.FieldMetaData("taskStartToCloseTimeoutSeconds", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.CHILD_POLICY, new org.apache.thrift.meta_data.FieldMetaData("childPolicy", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ChildPolicy.class)));
    tmpMap.put(_Fields.CONTINUED_EXECUTION_RUN_ID, new org.apache.thrift.meta_data.FieldMetaData("continuedExecutionRunId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.INITIATOR, new org.apache.thrift.meta_data.FieldMetaData("initiator", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.ENUM        , "ContinueAsNewInitiator")));
    tmpMap.put(_Fields.CONTINUED_FAILURE_REASON, new org.apache.thrift.meta_data.FieldMetaData("continuedFailureReason", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CONTINUED_FAILURE_DETAILS, new org.apache.thrift.meta_data.FieldMetaData("continuedFailureDetails", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
    tmpMap.put(_Fields.LAST_COMPLETION_RESULT, new org.apache.thrift.meta_data.FieldMetaData("lastCompletionResult", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
    tmpMap.put(_Fields.ORIGINAL_EXECUTION_RUN_ID, new org.apache.thrift.meta_data.FieldMetaData("originalExecutionRunId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.IDENTITY, new org.apache.thrift.meta_data.FieldMetaData("identity", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.FIRST_EXECUTION_RUN_ID, new org.apache.thrift.meta_data.FieldMetaData("firstExecutionRunId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.RETRY_POLICY, new org.apache.thrift.meta_data.FieldMetaData("retryPolicy", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT        , "RetryPolicy")));
    tmpMap.put(_Fields.ATTEMPT, new org.apache.thrift.meta_data.FieldMetaData("attempt", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.EXPIRATION_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("expirationTimestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.CRON_SCHEDULE, new org.apache.thrift.meta_data.FieldMetaData("cronSchedule", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.FIRST_DECISION_TASK_BACKOFF_SECONDS, new org.apache.thrift.meta_data.FieldMetaData("firstDecisionTaskBackoffSeconds", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.MEMO, new org.apache.thrift.meta_data.FieldMetaData("memo", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Memo.class)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WorkflowExecutionStartedEventAttributes.class, metaDataMap);
  }

  public WorkflowExecutionStartedEventAttributes() {
  }

  /**
   * Performs a deep copy on other.
   */
  public WorkflowExecutionStartedEventAttributes(WorkflowExecutionStartedEventAttributes other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetWorkflowType()) {
      this.workflowType = new WorkflowType(other.workflowType);
    }
    if (other.isSetParentWorkflowDomain()) {
      this.parentWorkflowDomain = other.parentWorkflowDomain;
    }
    if (other.isSetParentWorkflowExecution()) {
      this.parentWorkflowExecution = new WorkflowExecution(other.parentWorkflowExecution);
    }
    this.parentInitiatedEventId = other.parentInitiatedEventId;
    if (other.isSetTaskList()) {
      this.taskList = new TaskList(other.taskList);
    }
    if (other.isSetInput()) {
      this.input = org.apache.thrift.TBaseHelper.copyBinary(other.input);
    }
    this.executionStartToCloseTimeoutSeconds = other.executionStartToCloseTimeoutSeconds;
    this.taskStartToCloseTimeoutSeconds = other.taskStartToCloseTimeoutSeconds;
    if (other.isSetChildPolicy()) {
      this.childPolicy = other.childPolicy;
    }
    if (other.isSetContinuedExecutionRunId()) {
      this.continuedExecutionRunId = other.continuedExecutionRunId;
    }
    if (other.isSetInitiator()) {
      this.initiator = other.initiator;
    }
    if (other.isSetContinuedFailureReason()) {
      this.continuedFailureReason = other.continuedFailureReason;
    }
    if (other.isSetContinuedFailureDetails()) {
      this.continuedFailureDetails = org.apache.thrift.TBaseHelper.copyBinary(other.continuedFailureDetails);
    }
    if (other.isSetLastCompletionResult()) {
      this.lastCompletionResult = org.apache.thrift.TBaseHelper.copyBinary(other.lastCompletionResult);
    }
    if (other.isSetOriginalExecutionRunId()) {
      this.originalExecutionRunId = other.originalExecutionRunId;
    }
    if (other.isSetIdentity()) {
      this.identity = other.identity;
    }
    if (other.isSetFirstExecutionRunId()) {
      this.firstExecutionRunId = other.firstExecutionRunId;
    }
    if (other.isSetRetryPolicy()) {
      this.retryPolicy = other.retryPolicy;
    }
    this.attempt = other.attempt;
    this.expirationTimestamp = other.expirationTimestamp;
    if (other.isSetCronSchedule()) {
      this.cronSchedule = other.cronSchedule;
    }
    this.firstDecisionTaskBackoffSeconds = other.firstDecisionTaskBackoffSeconds;
    if (other.isSetMemo()) {
      this.memo = new Memo(other.memo);
    }
  }

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

  @Override
  public void clear() {
    this.workflowType = null;
    this.parentWorkflowDomain = null;
    this.parentWorkflowExecution = null;
    setParentInitiatedEventIdIsSet(false);
    this.parentInitiatedEventId = 0;
    this.taskList = null;
    this.input = null;
    setExecutionStartToCloseTimeoutSecondsIsSet(false);
    this.executionStartToCloseTimeoutSeconds = 0;
    setTaskStartToCloseTimeoutSecondsIsSet(false);
    this.taskStartToCloseTimeoutSeconds = 0;
    this.childPolicy = null;
    this.continuedExecutionRunId = null;
    this.initiator = null;
    this.continuedFailureReason = null;
    this.continuedFailureDetails = null;
    this.lastCompletionResult = null;
    this.originalExecutionRunId = null;
    this.identity = null;
    this.firstExecutionRunId = null;
    this.retryPolicy = null;
    setAttemptIsSet(false);
    this.attempt = 0;
    setExpirationTimestampIsSet(false);
    this.expirationTimestamp = 0;
    this.cronSchedule = null;
    setFirstDecisionTaskBackoffSecondsIsSet(false);
    this.firstDecisionTaskBackoffSeconds = 0;
    this.memo = null;
  }

  public WorkflowType getWorkflowType() {
    return this.workflowType;
  }

  public WorkflowExecutionStartedEventAttributes setWorkflowType(WorkflowType workflowType) {
    this.workflowType = workflowType;
    return this;
  }

  public void unsetWorkflowType() {
    this.workflowType = null;
  }

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

  public void setWorkflowTypeIsSet(boolean value) {
    if (!value) {
      this.workflowType = null;
    }
  }

  public String getParentWorkflowDomain() {
    return this.parentWorkflowDomain;
  }

  public WorkflowExecutionStartedEventAttributes setParentWorkflowDomain(String parentWorkflowDomain) {
    this.parentWorkflowDomain = parentWorkflowDomain;
    return this;
  }

  public void unsetParentWorkflowDomain() {
    this.parentWorkflowDomain = null;
  }

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

  public void setParentWorkflowDomainIsSet(boolean value) {
    if (!value) {
      this.parentWorkflowDomain = null;
    }
  }

  public WorkflowExecution getParentWorkflowExecution() {
    return this.parentWorkflowExecution;
  }

  public WorkflowExecutionStartedEventAttributes setParentWorkflowExecution(WorkflowExecution parentWorkflowExecution) {
    this.parentWorkflowExecution = parentWorkflowExecution;
    return this;
  }

  public void unsetParentWorkflowExecution() {
    this.parentWorkflowExecution = null;
  }

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

  public void setParentWorkflowExecutionIsSet(boolean value) {
    if (!value) {
      this.parentWorkflowExecution = null;
    }
  }

  public long getParentInitiatedEventId() {
    return this.parentInitiatedEventId;
  }

  public WorkflowExecutionStartedEventAttributes setParentInitiatedEventId(long parentInitiatedEventId) {
    this.parentInitiatedEventId = parentInitiatedEventId;
    setParentInitiatedEventIdIsSet(true);
    return this;
  }

  public void unsetParentInitiatedEventId() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PARENTINITIATEDEVENTID_ISSET_ID);
  }

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

  public void setParentInitiatedEventIdIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PARENTINITIATEDEVENTID_ISSET_ID, value);
  }

  public TaskList getTaskList() {
    return this.taskList;
  }

  public WorkflowExecutionStartedEventAttributes setTaskList(TaskList taskList) {
    this.taskList = taskList;
    return this;
  }

  public void unsetTaskList() {
    this.taskList = null;
  }

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

  public void setTaskListIsSet(boolean value) {
    if (!value) {
      this.taskList = null;
    }
  }

  public byte[] getInput() {
    setInput(org.apache.thrift.TBaseHelper.rightSize(input));
    return input == null ? null : input.array();
  }

  public ByteBuffer bufferForInput() {
    return org.apache.thrift.TBaseHelper.copyBinary(input);
  }

  public WorkflowExecutionStartedEventAttributes setInput(byte[] input) {
    this.input = input == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(input, input.length));
    return this;
  }

  public WorkflowExecutionStartedEventAttributes setInput(ByteBuffer input) {
    this.input = org.apache.thrift.TBaseHelper.copyBinary(input);
    return this;
  }

  public void unsetInput() {
    this.input = null;
  }

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

  public void setInputIsSet(boolean value) {
    if (!value) {
      this.input = null;
    }
  }

  public int getExecutionStartToCloseTimeoutSeconds() {
    return this.executionStartToCloseTimeoutSeconds;
  }

  public WorkflowExecutionStartedEventAttributes setExecutionStartToCloseTimeoutSeconds(int executionStartToCloseTimeoutSeconds) {
    this.executionStartToCloseTimeoutSeconds = executionStartToCloseTimeoutSeconds;
    setExecutionStartToCloseTimeoutSecondsIsSet(true);
    return this;
  }

  public void unsetExecutionStartToCloseTimeoutSeconds() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXECUTIONSTARTTOCLOSETIMEOUTSECONDS_ISSET_ID);
  }

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

  public void setExecutionStartToCloseTimeoutSecondsIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXECUTIONSTARTTOCLOSETIMEOUTSECONDS_ISSET_ID, value);
  }

  public int getTaskStartToCloseTimeoutSeconds() {
    return this.taskStartToCloseTimeoutSeconds;
  }

  public WorkflowExecutionStartedEventAttributes setTaskStartToCloseTimeoutSeconds(int taskStartToCloseTimeoutSeconds) {
    this.taskStartToCloseTimeoutSeconds = taskStartToCloseTimeoutSeconds;
    setTaskStartToCloseTimeoutSecondsIsSet(true);
    return this;
  }

  public void unsetTaskStartToCloseTimeoutSeconds() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TASKSTARTTOCLOSETIMEOUTSECONDS_ISSET_ID);
  }

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

  public void setTaskStartToCloseTimeoutSecondsIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TASKSTARTTOCLOSETIMEOUTSECONDS_ISSET_ID, value);
  }

  /**
   * 
   * @see ChildPolicy
   */
  public ChildPolicy getChildPolicy() {
    return this.childPolicy;
  }

  /**
   * 
   * @see ChildPolicy
   */
  public WorkflowExecutionStartedEventAttributes setChildPolicy(ChildPolicy childPolicy) {
    this.childPolicy = childPolicy;
    return this;
  }

  public void unsetChildPolicy() {
    this.childPolicy = null;
  }

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

  public void setChildPolicyIsSet(boolean value) {
    if (!value) {
      this.childPolicy = null;
    }
  }

  public String getContinuedExecutionRunId() {
    return this.continuedExecutionRunId;
  }

  public WorkflowExecutionStartedEventAttributes setContinuedExecutionRunId(String continuedExecutionRunId) {
    this.continuedExecutionRunId = continuedExecutionRunId;
    return this;
  }

  public void unsetContinuedExecutionRunId() {
    this.continuedExecutionRunId = null;
  }

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

  public void setContinuedExecutionRunIdIsSet(boolean value) {
    if (!value) {
      this.continuedExecutionRunId = null;
    }
  }

  public ContinueAsNewInitiator getInitiator() {
    return this.initiator;
  }

  public WorkflowExecutionStartedEventAttributes setInitiator(ContinueAsNewInitiator initiator) {
    this.initiator = initiator;
    return this;
  }

  public void unsetInitiator() {
    this.initiator = null;
  }

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

  public void setInitiatorIsSet(boolean value) {
    if (!value) {
      this.initiator = null;
    }
  }

  public String getContinuedFailureReason() {
    return this.continuedFailureReason;
  }

  public WorkflowExecutionStartedEventAttributes setContinuedFailureReason(String continuedFailureReason) {
    this.continuedFailureReason = continuedFailureReason;
    return this;
  }

  public void unsetContinuedFailureReason() {
    this.continuedFailureReason = null;
  }

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

  public void setContinuedFailureReasonIsSet(boolean value) {
    if (!value) {
      this.continuedFailureReason = null;
    }
  }

  public byte[] getContinuedFailureDetails() {
    setContinuedFailureDetails(org.apache.thrift.TBaseHelper.rightSize(continuedFailureDetails));
    return continuedFailureDetails == null ? null : continuedFailureDetails.array();
  }

  public ByteBuffer bufferForContinuedFailureDetails() {
    return org.apache.thrift.TBaseHelper.copyBinary(continuedFailureDetails);
  }

  public WorkflowExecutionStartedEventAttributes setContinuedFailureDetails(byte[] continuedFailureDetails) {
    this.continuedFailureDetails = continuedFailureDetails == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(continuedFailureDetails, continuedFailureDetails.length));
    return this;
  }

  public WorkflowExecutionStartedEventAttributes setContinuedFailureDetails(ByteBuffer continuedFailureDetails) {
    this.continuedFailureDetails = org.apache.thrift.TBaseHelper.copyBinary(continuedFailureDetails);
    return this;
  }

  public void unsetContinuedFailureDetails() {
    this.continuedFailureDetails = null;
  }

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

  public void setContinuedFailureDetailsIsSet(boolean value) {
    if (!value) {
      this.continuedFailureDetails = null;
    }
  }

  public byte[] getLastCompletionResult() {
    setLastCompletionResult(org.apache.thrift.TBaseHelper.rightSize(lastCompletionResult));
    return lastCompletionResult == null ? null : lastCompletionResult.array();
  }

  public ByteBuffer bufferForLastCompletionResult() {
    return org.apache.thrift.TBaseHelper.copyBinary(lastCompletionResult);
  }

  public WorkflowExecutionStartedEventAttributes setLastCompletionResult(byte[] lastCompletionResult) {
    this.lastCompletionResult = lastCompletionResult == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(lastCompletionResult, lastCompletionResult.length));
    return this;
  }

  public WorkflowExecutionStartedEventAttributes setLastCompletionResult(ByteBuffer lastCompletionResult) {
    this.lastCompletionResult = org.apache.thrift.TBaseHelper.copyBinary(lastCompletionResult);
    return this;
  }

  public void unsetLastCompletionResult() {
    this.lastCompletionResult = null;
  }

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

  public void setLastCompletionResultIsSet(boolean value) {
    if (!value) {
      this.lastCompletionResult = null;
    }
  }

  public String getOriginalExecutionRunId() {
    return this.originalExecutionRunId;
  }

  public WorkflowExecutionStartedEventAttributes setOriginalExecutionRunId(String originalExecutionRunId) {
    this.originalExecutionRunId = originalExecutionRunId;
    return this;
  }

  public void unsetOriginalExecutionRunId() {
    this.originalExecutionRunId = null;
  }

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

  public void setOriginalExecutionRunIdIsSet(boolean value) {
    if (!value) {
      this.originalExecutionRunId = null;
    }
  }

  public String getIdentity() {
    return this.identity;
  }

  public WorkflowExecutionStartedEventAttributes setIdentity(String identity) {
    this.identity = identity;
    return this;
  }

  public void unsetIdentity() {
    this.identity = null;
  }

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

  public void setIdentityIsSet(boolean value) {
    if (!value) {
      this.identity = null;
    }
  }

  public String getFirstExecutionRunId() {
    return this.firstExecutionRunId;
  }

  public WorkflowExecutionStartedEventAttributes setFirstExecutionRunId(String firstExecutionRunId) {
    this.firstExecutionRunId = firstExecutionRunId;
    return this;
  }

  public void unsetFirstExecutionRunId() {
    this.firstExecutionRunId = null;
  }

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

  public void setFirstExecutionRunIdIsSet(boolean value) {
    if (!value) {
      this.firstExecutionRunId = null;
    }
  }

  public RetryPolicy getRetryPolicy() {
    return this.retryPolicy;
  }

  public WorkflowExecutionStartedEventAttributes setRetryPolicy(RetryPolicy retryPolicy) {
    this.retryPolicy = retryPolicy;
    return this;
  }

  public void unsetRetryPolicy() {
    this.retryPolicy = null;
  }

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

  public void setRetryPolicyIsSet(boolean value) {
    if (!value) {
      this.retryPolicy = null;
    }
  }

  public int getAttempt() {
    return this.attempt;
  }

  public WorkflowExecutionStartedEventAttributes setAttempt(int attempt) {
    this.attempt = attempt;
    setAttemptIsSet(true);
    return this;
  }

  public void unsetAttempt() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ATTEMPT_ISSET_ID);
  }

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

  public void setAttemptIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ATTEMPT_ISSET_ID, value);
  }

  public long getExpirationTimestamp() {
    return this.expirationTimestamp;
  }

  public WorkflowExecutionStartedEventAttributes setExpirationTimestamp(long expirationTimestamp) {
    this.expirationTimestamp = expirationTimestamp;
    setExpirationTimestampIsSet(true);
    return this;
  }

  public void unsetExpirationTimestamp() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXPIRATIONTIMESTAMP_ISSET_ID);
  }

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

  public void setExpirationTimestampIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXPIRATIONTIMESTAMP_ISSET_ID, value);
  }

  public String getCronSchedule() {
    return this.cronSchedule;
  }

  public WorkflowExecutionStartedEventAttributes setCronSchedule(String cronSchedule) {
    this.cronSchedule = cronSchedule;
    return this;
  }

  public void unsetCronSchedule() {
    this.cronSchedule = null;
  }

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

  public void setCronScheduleIsSet(boolean value) {
    if (!value) {
      this.cronSchedule = null;
    }
  }

  public int getFirstDecisionTaskBackoffSeconds() {
    return this.firstDecisionTaskBackoffSeconds;
  }

  public WorkflowExecutionStartedEventAttributes setFirstDecisionTaskBackoffSeconds(int firstDecisionTaskBackoffSeconds) {
    this.firstDecisionTaskBackoffSeconds = firstDecisionTaskBackoffSeconds;
    setFirstDecisionTaskBackoffSecondsIsSet(true);
    return this;
  }

  public void unsetFirstDecisionTaskBackoffSeconds() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FIRSTDECISIONTASKBACKOFFSECONDS_ISSET_ID);
  }

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

  public void setFirstDecisionTaskBackoffSecondsIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FIRSTDECISIONTASKBACKOFFSECONDS_ISSET_ID, value);
  }

  public Memo getMemo() {
    return this.memo;
  }

  public WorkflowExecutionStartedEventAttributes setMemo(Memo memo) {
    this.memo = memo;
    return this;
  }

  public void unsetMemo() {
    this.memo = null;
  }

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

  public void setMemoIsSet(boolean value) {
    if (!value) {
      this.memo = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case WORKFLOW_TYPE:
      if (value == null) {
        unsetWorkflowType();
      } else {
        setWorkflowType((WorkflowType)value);
      }
      break;

    case PARENT_WORKFLOW_DOMAIN:
      if (value == null) {
        unsetParentWorkflowDomain();
      } else {
        setParentWorkflowDomain((String)value);
      }
      break;

    case PARENT_WORKFLOW_EXECUTION:
      if (value == null) {
        unsetParentWorkflowExecution();
      } else {
        setParentWorkflowExecution((WorkflowExecution)value);
      }
      break;

    case PARENT_INITIATED_EVENT_ID:
      if (value == null) {
        unsetParentInitiatedEventId();
      } else {
        setParentInitiatedEventId((Long)value);
      }
      break;

    case TASK_LIST:
      if (value == null) {
        unsetTaskList();
      } else {
        setTaskList((TaskList)value);
      }
      break;

    case INPUT:
      if (value == null) {
        unsetInput();
      } else {
        setInput((ByteBuffer)value);
      }
      break;

    case EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS:
      if (value == null) {
        unsetExecutionStartToCloseTimeoutSeconds();
      } else {
        setExecutionStartToCloseTimeoutSeconds((Integer)value);
      }
      break;

    case TASK_START_TO_CLOSE_TIMEOUT_SECONDS:
      if (value == null) {
        unsetTaskStartToCloseTimeoutSeconds();
      } else {
        setTaskStartToCloseTimeoutSeconds((Integer)value);
      }
      break;

    case CHILD_POLICY:
      if (value == null) {
        unsetChildPolicy();
      } else {
        setChildPolicy((ChildPolicy)value);
      }
      break;

    case CONTINUED_EXECUTION_RUN_ID:
      if (value == null) {
        unsetContinuedExecutionRunId();
      } else {
        setContinuedExecutionRunId((String)value);
      }
      break;

    case INITIATOR:
      if (value == null) {
        unsetInitiator();
      } else {
        setInitiator((ContinueAsNewInitiator)value);
      }
      break;

    case CONTINUED_FAILURE_REASON:
      if (value == null) {
        unsetContinuedFailureReason();
      } else {
        setContinuedFailureReason((String)value);
      }
      break;

    case CONTINUED_FAILURE_DETAILS:
      if (value == null) {
        unsetContinuedFailureDetails();
      } else {
        setContinuedFailureDetails((ByteBuffer)value);
      }
      break;

    case LAST_COMPLETION_RESULT:
      if (value == null) {
        unsetLastCompletionResult();
      } else {
        setLastCompletionResult((ByteBuffer)value);
      }
      break;

    case ORIGINAL_EXECUTION_RUN_ID:
      if (value == null) {
        unsetOriginalExecutionRunId();
      } else {
        setOriginalExecutionRunId((String)value);
      }
      break;

    case IDENTITY:
      if (value == null) {
        unsetIdentity();
      } else {
        setIdentity((String)value);
      }
      break;

    case FIRST_EXECUTION_RUN_ID:
      if (value == null) {
        unsetFirstExecutionRunId();
      } else {
        setFirstExecutionRunId((String)value);
      }
      break;

    case RETRY_POLICY:
      if (value == null) {
        unsetRetryPolicy();
      } else {
        setRetryPolicy((RetryPolicy)value);
      }
      break;

    case ATTEMPT:
      if (value == null) {
        unsetAttempt();
      } else {
        setAttempt((Integer)value);
      }
      break;

    case EXPIRATION_TIMESTAMP:
      if (value == null) {
        unsetExpirationTimestamp();
      } else {
        setExpirationTimestamp((Long)value);
      }
      break;

    case CRON_SCHEDULE:
      if (value == null) {
        unsetCronSchedule();
      } else {
        setCronSchedule((String)value);
      }
      break;

    case FIRST_DECISION_TASK_BACKOFF_SECONDS:
      if (value == null) {
        unsetFirstDecisionTaskBackoffSeconds();
      } else {
        setFirstDecisionTaskBackoffSeconds((Integer)value);
      }
      break;

    case MEMO:
      if (value == null) {
        unsetMemo();
      } else {
        setMemo((Memo)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case WORKFLOW_TYPE:
      return getWorkflowType();

    case PARENT_WORKFLOW_DOMAIN:
      return getParentWorkflowDomain();

    case PARENT_WORKFLOW_EXECUTION:
      return getParentWorkflowExecution();

    case PARENT_INITIATED_EVENT_ID:
      return getParentInitiatedEventId();

    case TASK_LIST:
      return getTaskList();

    case INPUT:
      return getInput();

    case EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS:
      return getExecutionStartToCloseTimeoutSeconds();

    case TASK_START_TO_CLOSE_TIMEOUT_SECONDS:
      return getTaskStartToCloseTimeoutSeconds();

    case CHILD_POLICY:
      return getChildPolicy();

    case CONTINUED_EXECUTION_RUN_ID:
      return getContinuedExecutionRunId();

    case INITIATOR:
      return getInitiator();

    case CONTINUED_FAILURE_REASON:
      return getContinuedFailureReason();

    case CONTINUED_FAILURE_DETAILS:
      return getContinuedFailureDetails();

    case LAST_COMPLETION_RESULT:
      return getLastCompletionResult();

    case ORIGINAL_EXECUTION_RUN_ID:
      return getOriginalExecutionRunId();

    case IDENTITY:
      return getIdentity();

    case FIRST_EXECUTION_RUN_ID:
      return getFirstExecutionRunId();

    case RETRY_POLICY:
      return getRetryPolicy();

    case ATTEMPT:
      return getAttempt();

    case EXPIRATION_TIMESTAMP:
      return getExpirationTimestamp();

    case CRON_SCHEDULE:
      return getCronSchedule();

    case FIRST_DECISION_TASK_BACKOFF_SECONDS:
      return getFirstDecisionTaskBackoffSeconds();

    case MEMO:
      return getMemo();

    }
    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 WORKFLOW_TYPE:
      return isSetWorkflowType();
    case PARENT_WORKFLOW_DOMAIN:
      return isSetParentWorkflowDomain();
    case PARENT_WORKFLOW_EXECUTION:
      return isSetParentWorkflowExecution();
    case PARENT_INITIATED_EVENT_ID:
      return isSetParentInitiatedEventId();
    case TASK_LIST:
      return isSetTaskList();
    case INPUT:
      return isSetInput();
    case EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS:
      return isSetExecutionStartToCloseTimeoutSeconds();
    case TASK_START_TO_CLOSE_TIMEOUT_SECONDS:
      return isSetTaskStartToCloseTimeoutSeconds();
    case CHILD_POLICY:
      return isSetChildPolicy();
    case CONTINUED_EXECUTION_RUN_ID:
      return isSetContinuedExecutionRunId();
    case INITIATOR:
      return isSetInitiator();
    case CONTINUED_FAILURE_REASON:
      return isSetContinuedFailureReason();
    case CONTINUED_FAILURE_DETAILS:
      return isSetContinuedFailureDetails();
    case LAST_COMPLETION_RESULT:
      return isSetLastCompletionResult();
    case ORIGINAL_EXECUTION_RUN_ID:
      return isSetOriginalExecutionRunId();
    case IDENTITY:
      return isSetIdentity();
    case FIRST_EXECUTION_RUN_ID:
      return isSetFirstExecutionRunId();
    case RETRY_POLICY:
      return isSetRetryPolicy();
    case ATTEMPT:
      return isSetAttempt();
    case EXPIRATION_TIMESTAMP:
      return isSetExpirationTimestamp();
    case CRON_SCHEDULE:
      return isSetCronSchedule();
    case FIRST_DECISION_TASK_BACKOFF_SECONDS:
      return isSetFirstDecisionTaskBackoffSeconds();
    case MEMO:
      return isSetMemo();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_workflowType = true && this.isSetWorkflowType();
    boolean that_present_workflowType = true && that.isSetWorkflowType();
    if (this_present_workflowType || that_present_workflowType) {
      if (!(this_present_workflowType && that_present_workflowType))
        return false;
      if (!this.workflowType.equals(that.workflowType))
        return false;
    }

    boolean this_present_parentWorkflowDomain = true && this.isSetParentWorkflowDomain();
    boolean that_present_parentWorkflowDomain = true && that.isSetParentWorkflowDomain();
    if (this_present_parentWorkflowDomain || that_present_parentWorkflowDomain) {
      if (!(this_present_parentWorkflowDomain && that_present_parentWorkflowDomain))
        return false;
      if (!this.parentWorkflowDomain.equals(that.parentWorkflowDomain))
        return false;
    }

    boolean this_present_parentWorkflowExecution = true && this.isSetParentWorkflowExecution();
    boolean that_present_parentWorkflowExecution = true && that.isSetParentWorkflowExecution();
    if (this_present_parentWorkflowExecution || that_present_parentWorkflowExecution) {
      if (!(this_present_parentWorkflowExecution && that_present_parentWorkflowExecution))
        return false;
      if (!this.parentWorkflowExecution.equals(that.parentWorkflowExecution))
        return false;
    }

    boolean this_present_parentInitiatedEventId = true && this.isSetParentInitiatedEventId();
    boolean that_present_parentInitiatedEventId = true && that.isSetParentInitiatedEventId();
    if (this_present_parentInitiatedEventId || that_present_parentInitiatedEventId) {
      if (!(this_present_parentInitiatedEventId && that_present_parentInitiatedEventId))
        return false;
      if (this.parentInitiatedEventId != that.parentInitiatedEventId)
        return false;
    }

    boolean this_present_taskList = true && this.isSetTaskList();
    boolean that_present_taskList = true && that.isSetTaskList();
    if (this_present_taskList || that_present_taskList) {
      if (!(this_present_taskList && that_present_taskList))
        return false;
      if (!this.taskList.equals(that.taskList))
        return false;
    }

    boolean this_present_input = true && this.isSetInput();
    boolean that_present_input = true && that.isSetInput();
    if (this_present_input || that_present_input) {
      if (!(this_present_input && that_present_input))
        return false;
      if (!this.input.equals(that.input))
        return false;
    }

    boolean this_present_executionStartToCloseTimeoutSeconds = true && this.isSetExecutionStartToCloseTimeoutSeconds();
    boolean that_present_executionStartToCloseTimeoutSeconds = true && that.isSetExecutionStartToCloseTimeoutSeconds();
    if (this_present_executionStartToCloseTimeoutSeconds || that_present_executionStartToCloseTimeoutSeconds) {
      if (!(this_present_executionStartToCloseTimeoutSeconds && that_present_executionStartToCloseTimeoutSeconds))
        return false;
      if (this.executionStartToCloseTimeoutSeconds != that.executionStartToCloseTimeoutSeconds)
        return false;
    }

    boolean this_present_taskStartToCloseTimeoutSeconds = true && this.isSetTaskStartToCloseTimeoutSeconds();
    boolean that_present_taskStartToCloseTimeoutSeconds = true && that.isSetTaskStartToCloseTimeoutSeconds();
    if (this_present_taskStartToCloseTimeoutSeconds || that_present_taskStartToCloseTimeoutSeconds) {
      if (!(this_present_taskStartToCloseTimeoutSeconds && that_present_taskStartToCloseTimeoutSeconds))
        return false;
      if (this.taskStartToCloseTimeoutSeconds != that.taskStartToCloseTimeoutSeconds)
        return false;
    }

    boolean this_present_childPolicy = true && this.isSetChildPolicy();
    boolean that_present_childPolicy = true && that.isSetChildPolicy();
    if (this_present_childPolicy || that_present_childPolicy) {
      if (!(this_present_childPolicy && that_present_childPolicy))
        return false;
      if (!this.childPolicy.equals(that.childPolicy))
        return false;
    }

    boolean this_present_continuedExecutionRunId = true && this.isSetContinuedExecutionRunId();
    boolean that_present_continuedExecutionRunId = true && that.isSetContinuedExecutionRunId();
    if (this_present_continuedExecutionRunId || that_present_continuedExecutionRunId) {
      if (!(this_present_continuedExecutionRunId && that_present_continuedExecutionRunId))
        return false;
      if (!this.continuedExecutionRunId.equals(that.continuedExecutionRunId))
        return false;
    }

    boolean this_present_initiator = true && this.isSetInitiator();
    boolean that_present_initiator = true && that.isSetInitiator();
    if (this_present_initiator || that_present_initiator) {
      if (!(this_present_initiator && that_present_initiator))
        return false;
      if (!this.initiator.equals(that.initiator))
        return false;
    }

    boolean this_present_continuedFailureReason = true && this.isSetContinuedFailureReason();
    boolean that_present_continuedFailureReason = true && that.isSetContinuedFailureReason();
    if (this_present_continuedFailureReason || that_present_continuedFailureReason) {
      if (!(this_present_continuedFailureReason && that_present_continuedFailureReason))
        return false;
      if (!this.continuedFailureReason.equals(that.continuedFailureReason))
        return false;
    }

    boolean this_present_continuedFailureDetails = true && this.isSetContinuedFailureDetails();
    boolean that_present_continuedFailureDetails = true && that.isSetContinuedFailureDetails();
    if (this_present_continuedFailureDetails || that_present_continuedFailureDetails) {
      if (!(this_present_continuedFailureDetails && that_present_continuedFailureDetails))
        return false;
      if (!this.continuedFailureDetails.equals(that.continuedFailureDetails))
        return false;
    }

    boolean this_present_lastCompletionResult = true && this.isSetLastCompletionResult();
    boolean that_present_lastCompletionResult = true && that.isSetLastCompletionResult();
    if (this_present_lastCompletionResult || that_present_lastCompletionResult) {
      if (!(this_present_lastCompletionResult && that_present_lastCompletionResult))
        return false;
      if (!this.lastCompletionResult.equals(that.lastCompletionResult))
        return false;
    }

    boolean this_present_originalExecutionRunId = true && this.isSetOriginalExecutionRunId();
    boolean that_present_originalExecutionRunId = true && that.isSetOriginalExecutionRunId();
    if (this_present_originalExecutionRunId || that_present_originalExecutionRunId) {
      if (!(this_present_originalExecutionRunId && that_present_originalExecutionRunId))
        return false;
      if (!this.originalExecutionRunId.equals(that.originalExecutionRunId))
        return false;
    }

    boolean this_present_identity = true && this.isSetIdentity();
    boolean that_present_identity = true && that.isSetIdentity();
    if (this_present_identity || that_present_identity) {
      if (!(this_present_identity && that_present_identity))
        return false;
      if (!this.identity.equals(that.identity))
        return false;
    }

    boolean this_present_firstExecutionRunId = true && this.isSetFirstExecutionRunId();
    boolean that_present_firstExecutionRunId = true && that.isSetFirstExecutionRunId();
    if (this_present_firstExecutionRunId || that_present_firstExecutionRunId) {
      if (!(this_present_firstExecutionRunId && that_present_firstExecutionRunId))
        return false;
      if (!this.firstExecutionRunId.equals(that.firstExecutionRunId))
        return false;
    }

    boolean this_present_retryPolicy = true && this.isSetRetryPolicy();
    boolean that_present_retryPolicy = true && that.isSetRetryPolicy();
    if (this_present_retryPolicy || that_present_retryPolicy) {
      if (!(this_present_retryPolicy && that_present_retryPolicy))
        return false;
      if (!this.retryPolicy.equals(that.retryPolicy))
        return false;
    }

    boolean this_present_attempt = true && this.isSetAttempt();
    boolean that_present_attempt = true && that.isSetAttempt();
    if (this_present_attempt || that_present_attempt) {
      if (!(this_present_attempt && that_present_attempt))
        return false;
      if (this.attempt != that.attempt)
        return false;
    }

    boolean this_present_expirationTimestamp = true && this.isSetExpirationTimestamp();
    boolean that_present_expirationTimestamp = true && that.isSetExpirationTimestamp();
    if (this_present_expirationTimestamp || that_present_expirationTimestamp) {
      if (!(this_present_expirationTimestamp && that_present_expirationTimestamp))
        return false;
      if (this.expirationTimestamp != that.expirationTimestamp)
        return false;
    }

    boolean this_present_cronSchedule = true && this.isSetCronSchedule();
    boolean that_present_cronSchedule = true && that.isSetCronSchedule();
    if (this_present_cronSchedule || that_present_cronSchedule) {
      if (!(this_present_cronSchedule && that_present_cronSchedule))
        return false;
      if (!this.cronSchedule.equals(that.cronSchedule))
        return false;
    }

    boolean this_present_firstDecisionTaskBackoffSeconds = true && this.isSetFirstDecisionTaskBackoffSeconds();
    boolean that_present_firstDecisionTaskBackoffSeconds = true && that.isSetFirstDecisionTaskBackoffSeconds();
    if (this_present_firstDecisionTaskBackoffSeconds || that_present_firstDecisionTaskBackoffSeconds) {
      if (!(this_present_firstDecisionTaskBackoffSeconds && that_present_firstDecisionTaskBackoffSeconds))
        return false;
      if (this.firstDecisionTaskBackoffSeconds != that.firstDecisionTaskBackoffSeconds)
        return false;
    }

    boolean this_present_memo = true && this.isSetMemo();
    boolean that_present_memo = true && that.isSetMemo();
    if (this_present_memo || that_present_memo) {
      if (!(this_present_memo && that_present_memo))
        return false;
      if (!this.memo.equals(that.memo))
        return false;
    }

    return true;
  }

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

    boolean present_workflowType = true && (isSetWorkflowType());
    list.add(present_workflowType);
    if (present_workflowType)
      list.add(workflowType);

    boolean present_parentWorkflowDomain = true && (isSetParentWorkflowDomain());
    list.add(present_parentWorkflowDomain);
    if (present_parentWorkflowDomain)
      list.add(parentWorkflowDomain);

    boolean present_parentWorkflowExecution = true && (isSetParentWorkflowExecution());
    list.add(present_parentWorkflowExecution);
    if (present_parentWorkflowExecution)
      list.add(parentWorkflowExecution);

    boolean present_parentInitiatedEventId = true && (isSetParentInitiatedEventId());
    list.add(present_parentInitiatedEventId);
    if (present_parentInitiatedEventId)
      list.add(parentInitiatedEventId);

    boolean present_taskList = true && (isSetTaskList());
    list.add(present_taskList);
    if (present_taskList)
      list.add(taskList);

    boolean present_input = true && (isSetInput());
    list.add(present_input);
    if (present_input)
      list.add(input);

    boolean present_executionStartToCloseTimeoutSeconds = true && (isSetExecutionStartToCloseTimeoutSeconds());
    list.add(present_executionStartToCloseTimeoutSeconds);
    if (present_executionStartToCloseTimeoutSeconds)
      list.add(executionStartToCloseTimeoutSeconds);

    boolean present_taskStartToCloseTimeoutSeconds = true && (isSetTaskStartToCloseTimeoutSeconds());
    list.add(present_taskStartToCloseTimeoutSeconds);
    if (present_taskStartToCloseTimeoutSeconds)
      list.add(taskStartToCloseTimeoutSeconds);

    boolean present_childPolicy = true && (isSetChildPolicy());
    list.add(present_childPolicy);
    if (present_childPolicy)
      list.add(childPolicy.getValue());

    boolean present_continuedExecutionRunId = true && (isSetContinuedExecutionRunId());
    list.add(present_continuedExecutionRunId);
    if (present_continuedExecutionRunId)
      list.add(continuedExecutionRunId);

    boolean present_initiator = true && (isSetInitiator());
    list.add(present_initiator);
    if (present_initiator)
      list.add(initiator.getValue());

    boolean present_continuedFailureReason = true && (isSetContinuedFailureReason());
    list.add(present_continuedFailureReason);
    if (present_continuedFailureReason)
      list.add(continuedFailureReason);

    boolean present_continuedFailureDetails = true && (isSetContinuedFailureDetails());
    list.add(present_continuedFailureDetails);
    if (present_continuedFailureDetails)
      list.add(continuedFailureDetails);

    boolean present_lastCompletionResult = true && (isSetLastCompletionResult());
    list.add(present_lastCompletionResult);
    if (present_lastCompletionResult)
      list.add(lastCompletionResult);

    boolean present_originalExecutionRunId = true && (isSetOriginalExecutionRunId());
    list.add(present_originalExecutionRunId);
    if (present_originalExecutionRunId)
      list.add(originalExecutionRunId);

    boolean present_identity = true && (isSetIdentity());
    list.add(present_identity);
    if (present_identity)
      list.add(identity);

    boolean present_firstExecutionRunId = true && (isSetFirstExecutionRunId());
    list.add(present_firstExecutionRunId);
    if (present_firstExecutionRunId)
      list.add(firstExecutionRunId);

    boolean present_retryPolicy = true && (isSetRetryPolicy());
    list.add(present_retryPolicy);
    if (present_retryPolicy)
      list.add(retryPolicy);

    boolean present_attempt = true && (isSetAttempt());
    list.add(present_attempt);
    if (present_attempt)
      list.add(attempt);

    boolean present_expirationTimestamp = true && (isSetExpirationTimestamp());
    list.add(present_expirationTimestamp);
    if (present_expirationTimestamp)
      list.add(expirationTimestamp);

    boolean present_cronSchedule = true && (isSetCronSchedule());
    list.add(present_cronSchedule);
    if (present_cronSchedule)
      list.add(cronSchedule);

    boolean present_firstDecisionTaskBackoffSeconds = true && (isSetFirstDecisionTaskBackoffSeconds());
    list.add(present_firstDecisionTaskBackoffSeconds);
    if (present_firstDecisionTaskBackoffSeconds)
      list.add(firstDecisionTaskBackoffSeconds);

    boolean present_memo = true && (isSetMemo());
    list.add(present_memo);
    if (present_memo)
      list.add(memo);

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetWorkflowType()).compareTo(other.isSetWorkflowType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWorkflowType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workflowType, other.workflowType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetParentWorkflowDomain()).compareTo(other.isSetParentWorkflowDomain());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetParentWorkflowDomain()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentWorkflowDomain, other.parentWorkflowDomain);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetParentWorkflowExecution()).compareTo(other.isSetParentWorkflowExecution());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetParentWorkflowExecution()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentWorkflowExecution, other.parentWorkflowExecution);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetParentInitiatedEventId()).compareTo(other.isSetParentInitiatedEventId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetParentInitiatedEventId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentInitiatedEventId, other.parentInitiatedEventId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTaskList()).compareTo(other.isSetTaskList());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTaskList()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskList, other.taskList);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetInput()).compareTo(other.isSetInput());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInput()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.input, other.input);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetExecutionStartToCloseTimeoutSeconds()).compareTo(other.isSetExecutionStartToCloseTimeoutSeconds());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetExecutionStartToCloseTimeoutSeconds()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.executionStartToCloseTimeoutSeconds, other.executionStartToCloseTimeoutSeconds);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTaskStartToCloseTimeoutSeconds()).compareTo(other.isSetTaskStartToCloseTimeoutSeconds());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTaskStartToCloseTimeoutSeconds()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskStartToCloseTimeoutSeconds, other.taskStartToCloseTimeoutSeconds);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetChildPolicy()).compareTo(other.isSetChildPolicy());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetChildPolicy()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.childPolicy, other.childPolicy);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetContinuedExecutionRunId()).compareTo(other.isSetContinuedExecutionRunId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetContinuedExecutionRunId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.continuedExecutionRunId, other.continuedExecutionRunId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetInitiator()).compareTo(other.isSetInitiator());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInitiator()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.initiator, other.initiator);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetContinuedFailureReason()).compareTo(other.isSetContinuedFailureReason());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetContinuedFailureReason()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.continuedFailureReason, other.continuedFailureReason);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetContinuedFailureDetails()).compareTo(other.isSetContinuedFailureDetails());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetContinuedFailureDetails()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.continuedFailureDetails, other.continuedFailureDetails);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLastCompletionResult()).compareTo(other.isSetLastCompletionResult());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLastCompletionResult()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastCompletionResult, other.lastCompletionResult);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOriginalExecutionRunId()).compareTo(other.isSetOriginalExecutionRunId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOriginalExecutionRunId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.originalExecutionRunId, other.originalExecutionRunId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetIdentity()).compareTo(other.isSetIdentity());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetIdentity()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.identity, other.identity);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFirstExecutionRunId()).compareTo(other.isSetFirstExecutionRunId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFirstExecutionRunId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstExecutionRunId, other.firstExecutionRunId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRetryPolicy()).compareTo(other.isSetRetryPolicy());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRetryPolicy()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.retryPolicy, other.retryPolicy);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAttempt()).compareTo(other.isSetAttempt());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAttempt()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attempt, other.attempt);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetExpirationTimestamp()).compareTo(other.isSetExpirationTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetExpirationTimestamp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.expirationTimestamp, other.expirationTimestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCronSchedule()).compareTo(other.isSetCronSchedule());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCronSchedule()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cronSchedule, other.cronSchedule);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFirstDecisionTaskBackoffSeconds()).compareTo(other.isSetFirstDecisionTaskBackoffSeconds());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFirstDecisionTaskBackoffSeconds()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstDecisionTaskBackoffSeconds, other.firstDecisionTaskBackoffSeconds);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMemo()).compareTo(other.isSetMemo());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMemo()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.memo, other.memo);
      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("WorkflowExecutionStartedEventAttributes(");
    boolean first = true;

    if (isSetWorkflowType()) {
      sb.append("workflowType:");
      if (this.workflowType == null) {
        sb.append("null");
      } else {
        sb.append(this.workflowType);
      }
      first = false;
    }
    if (isSetParentWorkflowDomain()) {
      if (!first) sb.append(", ");
      sb.append("parentWorkflowDomain:");
      if (this.parentWorkflowDomain == null) {
        sb.append("null");
      } else {
        sb.append(this.parentWorkflowDomain);
      }
      first = false;
    }
    if (isSetParentWorkflowExecution()) {
      if (!first) sb.append(", ");
      sb.append("parentWorkflowExecution:");
      if (this.parentWorkflowExecution == null) {
        sb.append("null");
      } else {
        sb.append(this.parentWorkflowExecution);
      }
      first = false;
    }
    if (isSetParentInitiatedEventId()) {
      if (!first) sb.append(", ");
      sb.append("parentInitiatedEventId:");
      sb.append(this.parentInitiatedEventId);
      first = false;
    }
    if (isSetTaskList()) {
      if (!first) sb.append(", ");
      sb.append("taskList:");
      if (this.taskList == null) {
        sb.append("null");
      } else {
        sb.append(this.taskList);
      }
      first = false;
    }
    if (isSetInput()) {
      if (!first) sb.append(", ");
      sb.append("input:");
      if (this.input == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.input, sb);
      }
      first = false;
    }
    if (isSetExecutionStartToCloseTimeoutSeconds()) {
      if (!first) sb.append(", ");
      sb.append("executionStartToCloseTimeoutSeconds:");
      sb.append(this.executionStartToCloseTimeoutSeconds);
      first = false;
    }
    if (isSetTaskStartToCloseTimeoutSeconds()) {
      if (!first) sb.append(", ");
      sb.append("taskStartToCloseTimeoutSeconds:");
      sb.append(this.taskStartToCloseTimeoutSeconds);
      first = false;
    }
    if (isSetChildPolicy()) {
      if (!first) sb.append(", ");
      sb.append("childPolicy:");
      if (this.childPolicy == null) {
        sb.append("null");
      } else {
        sb.append(this.childPolicy);
      }
      first = false;
    }
    if (isSetContinuedExecutionRunId()) {
      if (!first) sb.append(", ");
      sb.append("continuedExecutionRunId:");
      if (this.continuedExecutionRunId == null) {
        sb.append("null");
      } else {
        sb.append(this.continuedExecutionRunId);
      }
      first = false;
    }
    if (isSetInitiator()) {
      if (!first) sb.append(", ");
      sb.append("initiator:");
      if (this.initiator == null) {
        sb.append("null");
      } else {
        sb.append(this.initiator);
      }
      first = false;
    }
    if (isSetContinuedFailureReason()) {
      if (!first) sb.append(", ");
      sb.append("continuedFailureReason:");
      if (this.continuedFailureReason == null) {
        sb.append("null");
      } else {
        sb.append(this.continuedFailureReason);
      }
      first = false;
    }
    if (isSetContinuedFailureDetails()) {
      if (!first) sb.append(", ");
      sb.append("continuedFailureDetails:");
      if (this.continuedFailureDetails == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.continuedFailureDetails, sb);
      }
      first = false;
    }
    if (isSetLastCompletionResult()) {
      if (!first) sb.append(", ");
      sb.append("lastCompletionResult:");
      if (this.lastCompletionResult == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.lastCompletionResult, sb);
      }
      first = false;
    }
    if (isSetOriginalExecutionRunId()) {
      if (!first) sb.append(", ");
      sb.append("originalExecutionRunId:");
      if (this.originalExecutionRunId == null) {
        sb.append("null");
      } else {
        sb.append(this.originalExecutionRunId);
      }
      first = false;
    }
    if (isSetIdentity()) {
      if (!first) sb.append(", ");
      sb.append("identity:");
      if (this.identity == null) {
        sb.append("null");
      } else {
        sb.append(this.identity);
      }
      first = false;
    }
    if (isSetFirstExecutionRunId()) {
      if (!first) sb.append(", ");
      sb.append("firstExecutionRunId:");
      if (this.firstExecutionRunId == null) {
        sb.append("null");
      } else {
        sb.append(this.firstExecutionRunId);
      }
      first = false;
    }
    if (isSetRetryPolicy()) {
      if (!first) sb.append(", ");
      sb.append("retryPolicy:");
      if (this.retryPolicy == null) {
        sb.append("null");
      } else {
        sb.append(this.retryPolicy);
      }
      first = false;
    }
    if (isSetAttempt()) {
      if (!first) sb.append(", ");
      sb.append("attempt:");
      sb.append(this.attempt);
      first = false;
    }
    if (isSetExpirationTimestamp()) {
      if (!first) sb.append(", ");
      sb.append("expirationTimestamp:");
      sb.append(this.expirationTimestamp);
      first = false;
    }
    if (isSetCronSchedule()) {
      if (!first) sb.append(", ");
      sb.append("cronSchedule:");
      if (this.cronSchedule == null) {
        sb.append("null");
      } else {
        sb.append(this.cronSchedule);
      }
      first = false;
    }
    if (isSetFirstDecisionTaskBackoffSeconds()) {
      if (!first) sb.append(", ");
      sb.append("firstDecisionTaskBackoffSeconds:");
      sb.append(this.firstDecisionTaskBackoffSeconds);
      first = false;
    }
    if (isSetMemo()) {
      if (!first) sb.append(", ");
      sb.append("memo:");
      if (this.memo == null) {
        sb.append("null");
      } else {
        sb.append(this.memo);
      }
      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 (workflowType != null) {
      workflowType.validate();
    }
    if (parentWorkflowExecution != null) {
      parentWorkflowExecution.validate();
    }
    if (taskList != null) {
      taskList.validate();
    }
    if (memo != null) {
      memo.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 {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class WorkflowExecutionStartedEventAttributesStandardSchemeFactory implements SchemeFactory {
    public WorkflowExecutionStartedEventAttributesStandardScheme getScheme() {
      return new WorkflowExecutionStartedEventAttributesStandardScheme();
    }
  }

  private static class WorkflowExecutionStartedEventAttributesStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, WorkflowExecutionStartedEventAttributes 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 10: // WORKFLOW_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.workflowType = new WorkflowType();
              struct.workflowType.read(iprot);
              struct.setWorkflowTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // PARENT_WORKFLOW_DOMAIN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.parentWorkflowDomain = iprot.readString();
              struct.setParentWorkflowDomainIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 14: // PARENT_WORKFLOW_EXECUTION
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.parentWorkflowExecution = new WorkflowExecution();
              struct.parentWorkflowExecution.read(iprot);
              struct.setParentWorkflowExecutionIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 16: // PARENT_INITIATED_EVENT_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.parentInitiatedEventId = iprot.readI64();
              struct.setParentInitiatedEventIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 20: // TASK_LIST
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.taskList = new TaskList();
              struct.taskList.read(iprot);
              struct.setTaskListIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 30: // INPUT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.input = iprot.readBinary();
              struct.setInputIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 40: // EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.executionStartToCloseTimeoutSeconds = iprot.readI32();
              struct.setExecutionStartToCloseTimeoutSecondsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 50: // TASK_START_TO_CLOSE_TIMEOUT_SECONDS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.taskStartToCloseTimeoutSeconds = iprot.readI32();
              struct.setTaskStartToCloseTimeoutSecondsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 52: // CHILD_POLICY
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.childPolicy = com.uber.cadence.ChildPolicy.findByValue(iprot.readI32());
              struct.setChildPolicyIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 54: // CONTINUED_EXECUTION_RUN_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.continuedExecutionRunId = iprot.readString();
              struct.setContinuedExecutionRunIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 55: // INITIATOR
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.initiator = com.uber.cadence.ContinueAsNewInitiator.findByValue(iprot.readI32());
              struct.setInitiatorIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 56: // CONTINUED_FAILURE_REASON
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.continuedFailureReason = iprot.readString();
              struct.setContinuedFailureReasonIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 57: // CONTINUED_FAILURE_DETAILS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.continuedFailureDetails = iprot.readBinary();
              struct.setContinuedFailureDetailsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 58: // LAST_COMPLETION_RESULT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.lastCompletionResult = iprot.readBinary();
              struct.setLastCompletionResultIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 59: // ORIGINAL_EXECUTION_RUN_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.originalExecutionRunId = iprot.readString();
              struct.setOriginalExecutionRunIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 60: // IDENTITY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.identity = iprot.readString();
              struct.setIdentityIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 61: // FIRST_EXECUTION_RUN_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.firstExecutionRunId = iprot.readString();
              struct.setFirstExecutionRunIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 70: // RETRY_POLICY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.retryPolicy = new RetryPolicy();
              struct.retryPolicy.read(iprot);
              struct.setRetryPolicyIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 80: // ATTEMPT
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.attempt = iprot.readI32();
              struct.setAttemptIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 90: // EXPIRATION_TIMESTAMP
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.expirationTimestamp = iprot.readI64();
              struct.setExpirationTimestampIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 100: // CRON_SCHEDULE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.cronSchedule = iprot.readString();
              struct.setCronScheduleIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 110: // FIRST_DECISION_TASK_BACKOFF_SECONDS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.firstDecisionTaskBackoffSeconds = iprot.readI32();
              struct.setFirstDecisionTaskBackoffSecondsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 120: // MEMO
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.memo = new Memo();
              struct.memo.read(iprot);
              struct.setMemoIsSet(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, WorkflowExecutionStartedEventAttributes struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.workflowType != null) {
        if (struct.isSetWorkflowType()) {
          oprot.writeFieldBegin(WORKFLOW_TYPE_FIELD_DESC);
          struct.workflowType.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.parentWorkflowDomain != null) {
        if (struct.isSetParentWorkflowDomain()) {
          oprot.writeFieldBegin(PARENT_WORKFLOW_DOMAIN_FIELD_DESC);
          oprot.writeString(struct.parentWorkflowDomain);
          oprot.writeFieldEnd();
        }
      }
      if (struct.parentWorkflowExecution != null) {
        if (struct.isSetParentWorkflowExecution()) {
          oprot.writeFieldBegin(PARENT_WORKFLOW_EXECUTION_FIELD_DESC);
          struct.parentWorkflowExecution.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetParentInitiatedEventId()) {
        oprot.writeFieldBegin(PARENT_INITIATED_EVENT_ID_FIELD_DESC);
        oprot.writeI64(struct.parentInitiatedEventId);
        oprot.writeFieldEnd();
      }
      if (struct.taskList != null) {
        if (struct.isSetTaskList()) {
          oprot.writeFieldBegin(TASK_LIST_FIELD_DESC);
          struct.taskList.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.input != null) {
        if (struct.isSetInput()) {
          oprot.writeFieldBegin(INPUT_FIELD_DESC);
          oprot.writeBinary(struct.input);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetExecutionStartToCloseTimeoutSeconds()) {
        oprot.writeFieldBegin(EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS_FIELD_DESC);
        oprot.writeI32(struct.executionStartToCloseTimeoutSeconds);
        oprot.writeFieldEnd();
      }
      if (struct.isSetTaskStartToCloseTimeoutSeconds()) {
        oprot.writeFieldBegin(TASK_START_TO_CLOSE_TIMEOUT_SECONDS_FIELD_DESC);
        oprot.writeI32(struct.taskStartToCloseTimeoutSeconds);
        oprot.writeFieldEnd();
      }
      if (struct.childPolicy != null) {
        if (struct.isSetChildPolicy()) {
          oprot.writeFieldBegin(CHILD_POLICY_FIELD_DESC);
          oprot.writeI32(struct.childPolicy.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.continuedExecutionRunId != null) {
        if (struct.isSetContinuedExecutionRunId()) {
          oprot.writeFieldBegin(CONTINUED_EXECUTION_RUN_ID_FIELD_DESC);
          oprot.writeString(struct.continuedExecutionRunId);
          oprot.writeFieldEnd();
        }
      }
      if (struct.initiator != null) {
        if (struct.isSetInitiator()) {
          oprot.writeFieldBegin(INITIATOR_FIELD_DESC);
          oprot.writeI32(struct.initiator.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.continuedFailureReason != null) {
        if (struct.isSetContinuedFailureReason()) {
          oprot.writeFieldBegin(CONTINUED_FAILURE_REASON_FIELD_DESC);
          oprot.writeString(struct.continuedFailureReason);
          oprot.writeFieldEnd();
        }
      }
      if (struct.continuedFailureDetails != null) {
        if (struct.isSetContinuedFailureDetails()) {
          oprot.writeFieldBegin(CONTINUED_FAILURE_DETAILS_FIELD_DESC);
          oprot.writeBinary(struct.continuedFailureDetails);
          oprot.writeFieldEnd();
        }
      }
      if (struct.lastCompletionResult != null) {
        if (struct.isSetLastCompletionResult()) {
          oprot.writeFieldBegin(LAST_COMPLETION_RESULT_FIELD_DESC);
          oprot.writeBinary(struct.lastCompletionResult);
          oprot.writeFieldEnd();
        }
      }
      if (struct.originalExecutionRunId != null) {
        if (struct.isSetOriginalExecutionRunId()) {
          oprot.writeFieldBegin(ORIGINAL_EXECUTION_RUN_ID_FIELD_DESC);
          oprot.writeString(struct.originalExecutionRunId);
          oprot.writeFieldEnd();
        }
      }
      if (struct.identity != null) {
        if (struct.isSetIdentity()) {
          oprot.writeFieldBegin(IDENTITY_FIELD_DESC);
          oprot.writeString(struct.identity);
          oprot.writeFieldEnd();
        }
      }
      if (struct.firstExecutionRunId != null) {
        if (struct.isSetFirstExecutionRunId()) {
          oprot.writeFieldBegin(FIRST_EXECUTION_RUN_ID_FIELD_DESC);
          oprot.writeString(struct.firstExecutionRunId);
          oprot.writeFieldEnd();
        }
      }
      if (struct.retryPolicy != null) {
        if (struct.isSetRetryPolicy()) {
          oprot.writeFieldBegin(RETRY_POLICY_FIELD_DESC);
          struct.retryPolicy.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetAttempt()) {
        oprot.writeFieldBegin(ATTEMPT_FIELD_DESC);
        oprot.writeI32(struct.attempt);
        oprot.writeFieldEnd();
      }
      if (struct.isSetExpirationTimestamp()) {
        oprot.writeFieldBegin(EXPIRATION_TIMESTAMP_FIELD_DESC);
        oprot.writeI64(struct.expirationTimestamp);
        oprot.writeFieldEnd();
      }
      if (struct.cronSchedule != null) {
        if (struct.isSetCronSchedule()) {
          oprot.writeFieldBegin(CRON_SCHEDULE_FIELD_DESC);
          oprot.writeString(struct.cronSchedule);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetFirstDecisionTaskBackoffSeconds()) {
        oprot.writeFieldBegin(FIRST_DECISION_TASK_BACKOFF_SECONDS_FIELD_DESC);
        oprot.writeI32(struct.firstDecisionTaskBackoffSeconds);
        oprot.writeFieldEnd();
      }
      if (struct.memo != null) {
        if (struct.isSetMemo()) {
          oprot.writeFieldBegin(MEMO_FIELD_DESC);
          struct.memo.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class WorkflowExecutionStartedEventAttributesTupleSchemeFactory implements SchemeFactory {
    public WorkflowExecutionStartedEventAttributesTupleScheme getScheme() {
      return new WorkflowExecutionStartedEventAttributesTupleScheme();
    }
  }

  private static class WorkflowExecutionStartedEventAttributesTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, WorkflowExecutionStartedEventAttributes struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetWorkflowType()) {
        optionals.set(0);
      }
      if (struct.isSetParentWorkflowDomain()) {
        optionals.set(1);
      }
      if (struct.isSetParentWorkflowExecution()) {
        optionals.set(2);
      }
      if (struct.isSetParentInitiatedEventId()) {
        optionals.set(3);
      }
      if (struct.isSetTaskList()) {
        optionals.set(4);
      }
      if (struct.isSetInput()) {
        optionals.set(5);
      }
      if (struct.isSetExecutionStartToCloseTimeoutSeconds()) {
        optionals.set(6);
      }
      if (struct.isSetTaskStartToCloseTimeoutSeconds()) {
        optionals.set(7);
      }
      if (struct.isSetChildPolicy()) {
        optionals.set(8);
      }
      if (struct.isSetContinuedExecutionRunId()) {
        optionals.set(9);
      }
      if (struct.isSetInitiator()) {
        optionals.set(10);
      }
      if (struct.isSetContinuedFailureReason()) {
        optionals.set(11);
      }
      if (struct.isSetContinuedFailureDetails()) {
        optionals.set(12);
      }
      if (struct.isSetLastCompletionResult()) {
        optionals.set(13);
      }
      if (struct.isSetOriginalExecutionRunId()) {
        optionals.set(14);
      }
      if (struct.isSetIdentity()) {
        optionals.set(15);
      }
      if (struct.isSetFirstExecutionRunId()) {
        optionals.set(16);
      }
      if (struct.isSetRetryPolicy()) {
        optionals.set(17);
      }
      if (struct.isSetAttempt()) {
        optionals.set(18);
      }
      if (struct.isSetExpirationTimestamp()) {
        optionals.set(19);
      }
      if (struct.isSetCronSchedule()) {
        optionals.set(20);
      }
      if (struct.isSetFirstDecisionTaskBackoffSeconds()) {
        optionals.set(21);
      }
      if (struct.isSetMemo()) {
        optionals.set(22);
      }
      oprot.writeBitSet(optionals, 23);
      if (struct.isSetWorkflowType()) {
        struct.workflowType.write(oprot);
      }
      if (struct.isSetParentWorkflowDomain()) {
        oprot.writeString(struct.parentWorkflowDomain);
      }
      if (struct.isSetParentWorkflowExecution()) {
        struct.parentWorkflowExecution.write(oprot);
      }
      if (struct.isSetParentInitiatedEventId()) {
        oprot.writeI64(struct.parentInitiatedEventId);
      }
      if (struct.isSetTaskList()) {
        struct.taskList.write(oprot);
      }
      if (struct.isSetInput()) {
        oprot.writeBinary(struct.input);
      }
      if (struct.isSetExecutionStartToCloseTimeoutSeconds()) {
        oprot.writeI32(struct.executionStartToCloseTimeoutSeconds);
      }
      if (struct.isSetTaskStartToCloseTimeoutSeconds()) {
        oprot.writeI32(struct.taskStartToCloseTimeoutSeconds);
      }
      if (struct.isSetChildPolicy()) {
        oprot.writeI32(struct.childPolicy.getValue());
      }
      if (struct.isSetContinuedExecutionRunId()) {
        oprot.writeString(struct.continuedExecutionRunId);
      }
      if (struct.isSetInitiator()) {
        oprot.writeI32(struct.initiator.getValue());
      }
      if (struct.isSetContinuedFailureReason()) {
        oprot.writeString(struct.continuedFailureReason);
      }
      if (struct.isSetContinuedFailureDetails()) {
        oprot.writeBinary(struct.continuedFailureDetails);
      }
      if (struct.isSetLastCompletionResult()) {
        oprot.writeBinary(struct.lastCompletionResult);
      }
      if (struct.isSetOriginalExecutionRunId()) {
        oprot.writeString(struct.originalExecutionRunId);
      }
      if (struct.isSetIdentity()) {
        oprot.writeString(struct.identity);
      }
      if (struct.isSetFirstExecutionRunId()) {
        oprot.writeString(struct.firstExecutionRunId);
      }
      if (struct.isSetRetryPolicy()) {
        struct.retryPolicy.write(oprot);
      }
      if (struct.isSetAttempt()) {
        oprot.writeI32(struct.attempt);
      }
      if (struct.isSetExpirationTimestamp()) {
        oprot.writeI64(struct.expirationTimestamp);
      }
      if (struct.isSetCronSchedule()) {
        oprot.writeString(struct.cronSchedule);
      }
      if (struct.isSetFirstDecisionTaskBackoffSeconds()) {
        oprot.writeI32(struct.firstDecisionTaskBackoffSeconds);
      }
      if (struct.isSetMemo()) {
        struct.memo.write(oprot);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, WorkflowExecutionStartedEventAttributes struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(23);
      if (incoming.get(0)) {
        struct.workflowType = new WorkflowType();
        struct.workflowType.read(iprot);
        struct.setWorkflowTypeIsSet(true);
      }
      if (incoming.get(1)) {
        struct.parentWorkflowDomain = iprot.readString();
        struct.setParentWorkflowDomainIsSet(true);
      }
      if (incoming.get(2)) {
        struct.parentWorkflowExecution = new WorkflowExecution();
        struct.parentWorkflowExecution.read(iprot);
        struct.setParentWorkflowExecutionIsSet(true);
      }
      if (incoming.get(3)) {
        struct.parentInitiatedEventId = iprot.readI64();
        struct.setParentInitiatedEventIdIsSet(true);
      }
      if (incoming.get(4)) {
        struct.taskList = new TaskList();
        struct.taskList.read(iprot);
        struct.setTaskListIsSet(true);
      }
      if (incoming.get(5)) {
        struct.input = iprot.readBinary();
        struct.setInputIsSet(true);
      }
      if (incoming.get(6)) {
        struct.executionStartToCloseTimeoutSeconds = iprot.readI32();
        struct.setExecutionStartToCloseTimeoutSecondsIsSet(true);
      }
      if (incoming.get(7)) {
        struct.taskStartToCloseTimeoutSeconds = iprot.readI32();
        struct.setTaskStartToCloseTimeoutSecondsIsSet(true);
      }
      if (incoming.get(8)) {
        struct.childPolicy = com.uber.cadence.ChildPolicy.findByValue(iprot.readI32());
        struct.setChildPolicyIsSet(true);
      }
      if (incoming.get(9)) {
        struct.continuedExecutionRunId = iprot.readString();
        struct.setContinuedExecutionRunIdIsSet(true);
      }
      if (incoming.get(10)) {
        struct.initiator = com.uber.cadence.ContinueAsNewInitiator.findByValue(iprot.readI32());
        struct.setInitiatorIsSet(true);
      }
      if (incoming.get(11)) {
        struct.continuedFailureReason = iprot.readString();
        struct.setContinuedFailureReasonIsSet(true);
      }
      if (incoming.get(12)) {
        struct.continuedFailureDetails = iprot.readBinary();
        struct.setContinuedFailureDetailsIsSet(true);
      }
      if (incoming.get(13)) {
        struct.lastCompletionResult = iprot.readBinary();
        struct.setLastCompletionResultIsSet(true);
      }
      if (incoming.get(14)) {
        struct.originalExecutionRunId = iprot.readString();
        struct.setOriginalExecutionRunIdIsSet(true);
      }
      if (incoming.get(15)) {
        struct.identity = iprot.readString();
        struct.setIdentityIsSet(true);
      }
      if (incoming.get(16)) {
        struct.firstExecutionRunId = iprot.readString();
        struct.setFirstExecutionRunIdIsSet(true);
      }
      if (incoming.get(17)) {
        struct.retryPolicy = new RetryPolicy();
        struct.retryPolicy.read(iprot);
        struct.setRetryPolicyIsSet(true);
      }
      if (incoming.get(18)) {
        struct.attempt = iprot.readI32();
        struct.setAttemptIsSet(true);
      }
      if (incoming.get(19)) {
        struct.expirationTimestamp = iprot.readI64();
        struct.setExpirationTimestampIsSet(true);
      }
      if (incoming.get(20)) {
        struct.cronSchedule = iprot.readString();
        struct.setCronScheduleIsSet(true);
      }
      if (incoming.get(21)) {
        struct.firstDecisionTaskBackoffSeconds = iprot.readI32();
        struct.setFirstDecisionTaskBackoffSecondsIsSet(true);
      }
      if (incoming.get(22)) {
        struct.memo = new Memo();
        struct.memo.read(iprot);
        struct.setMemoIsSet(true);
      }
    }
  }

}