public GlobalSecondaryIndexUpdate unmarshall(JsonUnmarshallerContext context) throws Exception {
    GlobalSecondaryIndexUpdate globalSecondaryIndexUpdate = new GlobalSecondaryIndexUpdate();

    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("Update", targetDepth)) {
          context.nextToken();
          globalSecondaryIndexUpdate.setUpdate(
              UpdateGlobalSecondaryIndexActionJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("Create", targetDepth)) {
          context.nextToken();
          globalSecondaryIndexUpdate.setCreate(
              CreateGlobalSecondaryIndexActionJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("Delete", targetDepth)) {
          context.nextToken();
          globalSecondaryIndexUpdate.setDelete(
              DeleteGlobalSecondaryIndexActionJsonUnmarshaller.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 globalSecondaryIndexUpdate;
  }
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

    if (obj instanceof GlobalSecondaryIndexUpdate == false) return false;
    GlobalSecondaryIndexUpdate other = (GlobalSecondaryIndexUpdate) obj;
    if (other.getUpdate() == null ^ this.getUpdate() == null) return false;
    if (other.getUpdate() != null && other.getUpdate().equals(this.getUpdate()) == false)
      return false;
    if (other.getCreate() == null ^ this.getCreate() == null) return false;
    if (other.getCreate() != null && other.getCreate().equals(this.getCreate()) == false)
      return false;
    if (other.getDelete() == null ^ this.getDelete() == null) return false;
    if (other.getDelete() != null && other.getDelete().equals(this.getDelete()) == false)
      return false;
    return true;
  }