static External fromYamlMap()

in src/main/java/com/google/cloud/run/kafkascaler/scalingconfig/External.java [31:45]


  static External fromYamlMap(Map<String, Object> input, String resourcePath) {
    External.Builder builder = new AutoValue_External.Builder();

    Validation.checkKeyExists(input, "metric", resourcePath);
    Validation.checkKeyExists(input, "target", resourcePath);

    return builder
        .metric(
            MetricName.fromYamlMap(
                (Map<String, Object>) input.get("metric"), resourcePath + ".metric"))
        .target(
            MetricTarget.fromYamlMap(
                (Map<String, Object>) input.get("target"), resourcePath + ".target"))
        .build();
  }