public Policy unmarshall(JsonUnmarshallerContext context) throws Exception {
    Policy policy = new Policy();

    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("policyName", targetDepth)) {
          context.nextToken();
          policy.setPolicyName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("policyArn", targetDepth)) {
          context.nextToken();
          policy.setPolicyArn(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 policy;
  }
  public ListPolicyVersionsResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    ListPolicyVersionsResult listPolicyVersionsResult = new ListPolicyVersionsResult();

    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("policyVersions", targetDepth)) {
          context.nextToken();
          listPolicyVersionsResult.setPolicyVersions(
              new ListUnmarshaller<PolicyVersion>(PolicyVersionJsonUnmarshaller.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 listPolicyVersionsResult;
  }
  public CreateCertificateFromCsrResult unmarshall(JsonUnmarshallerContext context)
      throws Exception {
    CreateCertificateFromCsrResult createCertificateFromCsrResult =
        new CreateCertificateFromCsrResult();

    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("certificateArn", targetDepth)) {
          context.nextToken();
          createCertificateFromCsrResult.setCertificateArn(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("certificateId", targetDepth)) {
          context.nextToken();
          createCertificateFromCsrResult.setCertificateId(
              StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("certificatePem", targetDepth)) {
          context.nextToken();
          createCertificateFromCsrResult.setCertificatePem(
              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 createCertificateFromCsrResult;
  }
  public KinesisAction unmarshall(JsonUnmarshallerContext context) throws Exception {
    KinesisAction kinesisAction = new KinesisAction();

    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("roleArn", targetDepth)) {
          context.nextToken();
          kinesisAction.setRoleArn(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("streamName", targetDepth)) {
          context.nextToken();
          kinesisAction.setStreamName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("partitionKey", targetDepth)) {
          context.nextToken();
          kinesisAction.setPartitionKey(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 kinesisAction;
  }
  public SnsAction unmarshall(JsonUnmarshallerContext context) throws Exception {
    SnsAction snsAction = new SnsAction();

    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("targetArn", targetDepth)) {
          context.nextToken();
          snsAction.setTargetArn(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("roleArn", targetDepth)) {
          context.nextToken();
          snsAction.setRoleArn(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("messageFormat", targetDepth)) {
          context.nextToken();
          snsAction.setMessageFormat(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 snsAction;
  }
  public ThingAttribute unmarshall(JsonUnmarshallerContext context) throws Exception {
    ThingAttribute thingAttribute = new ThingAttribute();

    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("thingName", targetDepth)) {
          context.nextToken();
          thingAttribute.setThingName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("attributes", targetDepth)) {
          context.nextToken();
          thingAttribute.setAttributes(
              new MapUnmarshaller<String, String>(
                      StringJsonUnmarshaller.getInstance(), 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 thingAttribute;
  }
  public CreateThingTypeResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    CreateThingTypeResult createThingTypeResult = new CreateThingTypeResult();

    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("thingTypeName", targetDepth)) {
          context.nextToken();
          createThingTypeResult.setThingTypeName(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("thingTypeArn", targetDepth)) {
          context.nextToken();
          createThingTypeResult.setThingTypeArn(
              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 createThingTypeResult;
  }
  public TopicRulePayload unmarshall(JsonUnmarshallerContext context) throws Exception {
    TopicRulePayload topicRulePayload = new TopicRulePayload();

    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("sql", targetDepth)) {
          context.nextToken();
          topicRulePayload.setSql(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("description", targetDepth)) {
          context.nextToken();
          topicRulePayload.setDescription(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("actions", targetDepth)) {
          context.nextToken();
          topicRulePayload.setActions(
              new ListUnmarshaller<Action>(ActionJsonUnmarshaller.getInstance())
                  .unmarshall(context));
        }
        if (context.testExpression("ruleDisabled", targetDepth)) {
          context.nextToken();
          topicRulePayload.setRuleDisabled(
              BooleanJsonUnmarshaller.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 topicRulePayload;
  }