public MethodSetting unmarshall(JsonUnmarshallerContext context) throws Exception {
    MethodSetting methodSetting = new MethodSetting();

    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("metricsEnabled", targetDepth)) {
          context.nextToken();
          methodSetting.setMetricsEnabled(
              BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("loggingLevel", targetDepth)) {
          context.nextToken();
          methodSetting.setLoggingLevel(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("dataTraceEnabled", targetDepth)) {
          context.nextToken();
          methodSetting.setDataTraceEnabled(
              BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("throttlingBurstLimit", targetDepth)) {
          context.nextToken();
          methodSetting.setThrottlingBurstLimit(
              IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("throttlingRateLimit", targetDepth)) {
          context.nextToken();
          methodSetting.setThrottlingRateLimit(
              DoubleJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("cachingEnabled", targetDepth)) {
          context.nextToken();
          methodSetting.setCachingEnabled(
              BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("cacheTtlInSeconds", targetDepth)) {
          context.nextToken();
          methodSetting.setCacheTtlInSeconds(
              IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("cacheDataEncrypted", targetDepth)) {
          context.nextToken();
          methodSetting.setCacheDataEncrypted(
              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 methodSetting;
  }