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;
  }
 /**
  * The parameters required for creating a global secondary index on an existing table:
  *
  * <ul>
  *   <li>
  *       <p><code>IndexName </code>
  *   <li>
  *       <p><code>KeySchema </code>
  *   <li>
  *       <p><code>AttributeDefinitions </code>
  *   <li>
  *       <p><code>Projection </code>
  *   <li>
  *       <p><code>ProvisionedThroughput </code>
  * </ul>
  *
  * @param create The parameters required for creating a global secondary index on an existing
  *     table:
  *     <ul>
  *       <li>
  *           <p><code>IndexName </code>
  *       <li>
  *           <p><code>KeySchema </code>
  *       <li>
  *           <p><code>AttributeDefinitions </code>
  *       <li>
  *           <p><code>Projection </code>
  *       <li>
  *           <p><code>ProvisionedThroughput </code>
  * @return Returns a reference to this object so that method calls can be chained together.
  */
 public GlobalSecondaryIndexUpdate withCreate(CreateGlobalSecondaryIndexAction create) {
   setCreate(create);
   return this;
 }