public VaultAccessPolicy unmarshall(JsonUnmarshallerContext context) throws Exception {
    VaultAccessPolicy vaultAccessPolicy = new VaultAccessPolicy();

    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("Policy", targetDepth)) {
          context.nextToken();
          vaultAccessPolicy.setPolicy(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 vaultAccessPolicy;
  }
  public CreateVaultResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    CreateVaultResult createVaultResult = new CreateVaultResult();

    if (context.isStartOfDocument()) {
      if (context.getHeader("Location") != null)
        createVaultResult.setLocation(context.getHeader("Location"));
    }

    return createVaultResult;
  }
  public CompleteMultipartUploadResult unmarshall(JsonUnmarshallerContext context)
      throws Exception {
    CompleteMultipartUploadResult completeMultipartUploadResult =
        new CompleteMultipartUploadResult();

    if (context.isStartOfDocument()) {
      if (context.getHeader("Location") != null) {
        context.setCurrentHeader("Location");
        completeMultipartUploadResult.setLocation(
            StringJsonUnmarshaller.getInstance().unmarshall(context));
      }

      if (context.getHeader("x-amz-sha256-tree-hash") != null) {
        context.setCurrentHeader("x-amz-sha256-tree-hash");
        completeMultipartUploadResult.setChecksum(
            StringJsonUnmarshaller.getInstance().unmarshall(context));
      }

      if (context.getHeader("x-amz-archive-id") != null) {
        context.setCurrentHeader("x-amz-archive-id");
        completeMultipartUploadResult.setArchiveId(
            StringJsonUnmarshaller.getInstance().unmarshall(context));
      }
    }

    return completeMultipartUploadResult;
  }
  public InitiateJobResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    InitiateJobResult initiateJobResult = new InitiateJobResult();

    if (context.isStartOfDocument()) {
      if (context.getHeader("Location") != null) {
        context.setCurrentHeader("Location");
        initiateJobResult.setLocation(context.getUnmarshaller(String.class).unmarshall(context));
      }
      if (context.getHeader("x-amz-job-id") != null) {
        context.setCurrentHeader("x-amz-job-id");
        initiateJobResult.setJobId(context.getUnmarshaller(String.class).unmarshall(context));
      }
    }

    return initiateJobResult;
  }
  public ListPartsResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    ListPartsResult listPartsResult = new ListPartsResult();

    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("MultipartUploadId", targetDepth)) {
          context.nextToken();
          listPartsResult.setMultipartUploadId(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("VaultARN", targetDepth)) {
          context.nextToken();
          listPartsResult.setVaultARN(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("ArchiveDescription", targetDepth)) {
          context.nextToken();
          listPartsResult.setArchiveDescription(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("PartSizeInBytes", targetDepth)) {
          context.nextToken();
          listPartsResult.setPartSizeInBytes(
              LongJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("CreationDate", targetDepth)) {
          context.nextToken();
          listPartsResult.setCreationDate(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("Parts", targetDepth)) {
          context.nextToken();
          listPartsResult.setParts(
              new ListUnmarshaller<PartListElement>(PartListElementJsonUnmarshaller.getInstance())
                  .unmarshall(context));
        }
        if (context.testExpression("Marker", targetDepth)) {
          context.nextToken();
          listPartsResult.setMarker(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 listPartsResult;
  }
  public DataRetrievalRule unmarshall(JsonUnmarshallerContext context) throws Exception {
    DataRetrievalRule dataRetrievalRule = new DataRetrievalRule();

    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("Strategy", targetDepth)) {
          context.nextToken();
          dataRetrievalRule.setStrategy(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("BytesPerHour", targetDepth)) {
          context.nextToken();
          dataRetrievalRule.setBytesPerHour(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 dataRetrievalRule;
  }
  public GetJobOutputResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    GetJobOutputResult getJobOutputResult = new GetJobOutputResult();

    if (context.isStartOfDocument()) {
      if (context.getHeader("x-amz-sha256-tree-hash") != null)
        getJobOutputResult.setChecksum(context.getHeader("x-amz-sha256-tree-hash"));
      if (context.getHeader("Content-Range") != null)
        getJobOutputResult.setContentRange(context.getHeader("Content-Range"));
      if (context.getHeader("Accept-Ranges") != null)
        getJobOutputResult.setAcceptRanges(context.getHeader("Accept-Ranges"));
      if (context.getHeader("Content-Type") != null)
        getJobOutputResult.setContentType(context.getHeader("Content-Type"));
      if (context.getHeader("x-amz-archive-description") != null)
        getJobOutputResult.setArchiveDescription(context.getHeader("x-amz-archive-description"));
    }

    getJobOutputResult.setStatus(context.getHttpResponse().getStatusCode());
    getJobOutputResult.setBody(
        new LengthCheckInputStream(
            context.getHttpResponse().getContent(),
            Long.parseLong(context.getHeader("Content-Length")),
            INCLUDE_SKIPPED_BYTES));

    return getJobOutputResult;
  }
  public GlacierJobDescription unmarshall(JsonUnmarshallerContext context) throws Exception {
    GlacierJobDescription glacierJobDescription = new GlacierJobDescription();

    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("JobId", targetDepth)) {
          context.nextToken();
          glacierJobDescription.setJobId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("JobDescription", targetDepth)) {
          context.nextToken();
          glacierJobDescription.setJobDescription(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("Action", targetDepth)) {
          context.nextToken();
          glacierJobDescription.setAction(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("ArchiveId", targetDepth)) {
          context.nextToken();
          glacierJobDescription.setArchiveId(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("VaultARN", targetDepth)) {
          context.nextToken();
          glacierJobDescription.setVaultARN(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("CreationDate", targetDepth)) {
          context.nextToken();
          glacierJobDescription.setCreationDate(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("Completed", targetDepth)) {
          context.nextToken();
          glacierJobDescription.setCompleted(
              BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("StatusCode", targetDepth)) {
          context.nextToken();
          glacierJobDescription.setStatusCode(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("StatusMessage", targetDepth)) {
          context.nextToken();
          glacierJobDescription.setStatusMessage(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("ArchiveSizeInBytes", targetDepth)) {
          context.nextToken();
          glacierJobDescription.setArchiveSizeInBytes(
              LongJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("InventorySizeInBytes", targetDepth)) {
          context.nextToken();
          glacierJobDescription.setInventorySizeInBytes(
              LongJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("SNSTopic", targetDepth)) {
          context.nextToken();
          glacierJobDescription.setSNSTopic(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("CompletionDate", targetDepth)) {
          context.nextToken();
          glacierJobDescription.setCompletionDate(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("SHA256TreeHash", targetDepth)) {
          context.nextToken();
          glacierJobDescription.setSHA256TreeHash(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("ArchiveSHA256TreeHash", targetDepth)) {
          context.nextToken();
          glacierJobDescription.setArchiveSHA256TreeHash(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("RetrievalByteRange", targetDepth)) {
          context.nextToken();
          glacierJobDescription.setRetrievalByteRange(
              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 glacierJobDescription;
  }