public DomainDetail unmarshall(JsonUnmarshallerContext context) throws Exception {
    DomainDetail domainDetail = new DomainDetail();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.currentToken;
    if (token == null) token = context.nextToken();

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("domainInfo", targetDepth)) {
          context.nextToken();
          domainDetail.setDomainInfo(DomainInfoJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("configuration", targetDepth)) {
          context.nextToken();
          domainDetail.setConfiguration(
              DomainConfigurationJsonUnmarshaller.getInstance().unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }

      token = context.nextToken();
    }

    return domainDetail;
  }
  public CancelWorkflowExecutionDecisionAttributes unmarshall(JsonUnmarshallerContext context)
      throws Exception {
    CancelWorkflowExecutionDecisionAttributes cancelWorkflowExecutionDecisionAttributes =
        new CancelWorkflowExecutionDecisionAttributes();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("details", targetDepth)) {
          context.nextToken();
          cancelWorkflowExecutionDecisionAttributes.setDetails(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }
      token = context.nextToken();
    }

    return cancelWorkflowExecutionDecisionAttributes;
  }
  public ActivityType unmarshall(JsonUnmarshallerContext context) throws Exception {
    ActivityType activityType = new ActivityType();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.currentToken;
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("name", targetDepth)) {
          context.nextToken();
          activityType.setName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("version", targetDepth)) {
          context.nextToken();
          activityType.setVersion(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }

      token = context.nextToken();
    }

    return activityType;
  }
  public DecisionTask unmarshall(JsonUnmarshallerContext context) throws Exception {
    DecisionTask decisionTask = new DecisionTask();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.currentToken;
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("taskToken", targetDepth)) {
          context.nextToken();
          decisionTask.setTaskToken(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("startedEventId", targetDepth)) {
          context.nextToken();
          decisionTask.setStartedEventId(LongJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("workflowExecution", targetDepth)) {
          context.nextToken();
          decisionTask.setWorkflowExecution(
              WorkflowExecutionJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("workflowType", targetDepth)) {
          context.nextToken();
          decisionTask.setWorkflowType(
              WorkflowTypeJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("events", targetDepth)) {
          decisionTask.setEvents(
              new ListUnmarshaller<HistoryEvent>(HistoryEventJsonUnmarshaller.getInstance())
                  .unmarshall(context));
        }
        if (context.testExpression("nextPageToken", targetDepth)) {
          context.nextToken();
          decisionTask.setNextPageToken(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("previousStartedEventId", targetDepth)) {
          context.nextToken();
          decisionTask.setPreviousStartedEventId(
              LongJsonUnmarshaller.getInstance().unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }

      token = context.nextToken();
    }

    return decisionTask;
  }
  public ActivityTypeConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {
    ActivityTypeConfiguration activityTypeConfiguration = new ActivityTypeConfiguration();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("defaultTaskStartToCloseTimeout", targetDepth)) {
          context.nextToken();
          activityTypeConfiguration.setDefaultTaskStartToCloseTimeout(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("defaultTaskHeartbeatTimeout", targetDepth)) {
          context.nextToken();
          activityTypeConfiguration.setDefaultTaskHeartbeatTimeout(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("defaultTaskList", targetDepth)) {
          context.nextToken();
          activityTypeConfiguration.setDefaultTaskList(
              TaskListJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("defaultTaskPriority", targetDepth)) {
          context.nextToken();
          activityTypeConfiguration.setDefaultTaskPriority(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("defaultTaskScheduleToStartTimeout", targetDepth)) {
          context.nextToken();
          activityTypeConfiguration.setDefaultTaskScheduleToStartTimeout(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("defaultTaskScheduleToCloseTimeout", targetDepth)) {
          context.nextToken();
          activityTypeConfiguration.setDefaultTaskScheduleToCloseTimeout(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }
      token = context.nextToken();
    }

    return activityTypeConfiguration;
  }
  public ActivityTask unmarshall(JsonUnmarshallerContext context) throws Exception {
    ActivityTask activityTask = new ActivityTask();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.currentToken;
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("taskToken", targetDepth)) {
          context.nextToken();
          activityTask.setTaskToken(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("activityId", targetDepth)) {
          context.nextToken();
          activityTask.setActivityId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("startedEventId", targetDepth)) {
          context.nextToken();
          activityTask.setStartedEventId(LongJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("workflowExecution", targetDepth)) {
          context.nextToken();
          activityTask.setWorkflowExecution(
              WorkflowExecutionJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("activityType", targetDepth)) {
          context.nextToken();
          activityTask.setActivityType(
              ActivityTypeJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("input", targetDepth)) {
          context.nextToken();
          activityTask.setInput(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }

      token = context.nextToken();
    }

    return activityTask;
  }
  public WorkflowExecutionDetail unmarshall(JsonUnmarshallerContext context) throws Exception {
    WorkflowExecutionDetail workflowExecutionDetail = new WorkflowExecutionDetail();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("executionInfo", targetDepth)) {
          context.nextToken();
          workflowExecutionDetail.setExecutionInfo(
              WorkflowExecutionInfoJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("executionConfiguration", targetDepth)) {
          context.nextToken();
          workflowExecutionDetail.setExecutionConfiguration(
              WorkflowExecutionConfigurationJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("openCounts", targetDepth)) {
          context.nextToken();
          workflowExecutionDetail.setOpenCounts(
              WorkflowExecutionOpenCountsJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("latestActivityTaskTimestamp", targetDepth)) {
          context.nextToken();
          workflowExecutionDetail.setLatestActivityTaskTimestamp(
              DateJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("latestExecutionContext", targetDepth)) {
          context.nextToken();
          workflowExecutionDetail.setLatestExecutionContext(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }

      token = context.nextToken();
    }

    return workflowExecutionDetail;
  }
  public ScheduleActivityTaskFailedEventAttributes unmarshall(JsonUnmarshallerContext context)
      throws Exception {
    ScheduleActivityTaskFailedEventAttributes scheduleActivityTaskFailedEventAttributes =
        new ScheduleActivityTaskFailedEventAttributes();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.currentToken;
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("activityType", targetDepth)) {
          context.nextToken();
          scheduleActivityTaskFailedEventAttributes.setActivityType(
              ActivityTypeJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("activityId", targetDepth)) {
          context.nextToken();
          scheduleActivityTaskFailedEventAttributes.setActivityId(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("cause", targetDepth)) {
          context.nextToken();
          scheduleActivityTaskFailedEventAttributes.setCause(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("decisionTaskCompletedEventId", targetDepth)) {
          context.nextToken();
          scheduleActivityTaskFailedEventAttributes.setDecisionTaskCompletedEventId(
              LongJsonUnmarshaller.getInstance().unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }

      token = context.nextToken();
    }

    return scheduleActivityTaskFailedEventAttributes;
  }
  public ExternalWorkflowExecutionSignaledEventAttributes unmarshall(
      JsonUnmarshallerContext context) throws Exception {
    ExternalWorkflowExecutionSignaledEventAttributes
        externalWorkflowExecutionSignaledEventAttributes =
            new ExternalWorkflowExecutionSignaledEventAttributes();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("workflowExecution", targetDepth)) {
          context.nextToken();
          externalWorkflowExecutionSignaledEventAttributes.setWorkflowExecution(
              WorkflowExecutionJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("initiatedEventId", targetDepth)) {
          context.nextToken();
          externalWorkflowExecutionSignaledEventAttributes.setInitiatedEventId(
              context.getUnmarshaller(Long.class).unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }
      token = context.nextToken();
    }

    return externalWorkflowExecutionSignaledEventAttributes;
  }
  public DomainInfo unmarshall(JsonUnmarshallerContext context) throws Exception {
    DomainInfo domainInfo = new DomainInfo();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("name", targetDepth)) {
          context.nextToken();
          domainInfo.setName(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("status", targetDepth)) {
          context.nextToken();
          domainInfo.setStatus(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("description", targetDepth)) {
          context.nextToken();
          domainInfo.setDescription(context.getUnmarshaller(String.class).unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }
      token = context.nextToken();
    }

    return domainInfo;
  }