// generated by tscfg 0.8.0 on Tue Apr 18 14:30:56 PDT 2017
// source: etc/config/config.conf

package com.sudothought.common;

public class ConfigVals {
  public final ConfigVals.Agent agent;
  public final ConfigVals.Proxy proxy;
  public ConfigVals(com.typesafe.config.Config c) {
    this.agent = new ConfigVals.Agent(c.getConfig("agent"));
    this.proxy = new ConfigVals.Proxy(c.getConfig("proxy"));
  }

  public static class Agent {
    public final Agent.Grpc                            grpc;
    public final Agent.Metrics                         metrics;
    public final java.util.List<Agent.PathConfigs$Elm> pathConfigs;
    public final Agent.Scrape                          scrape;
    public final Agent.Zipkin                          zipkin;
    public Agent(com.typesafe.config.Config c) {
      this.grpc = new Agent.Grpc(c.getConfig("grpc"));
      this.metrics = new Agent.Metrics(c.getConfig("metrics"));
      this.pathConfigs = $_LAgent_PathConfigs$Elm(c.getList("pathConfigs"));
      this.scrape = new Agent.Scrape(c.getConfig("scrape"));
      this.zipkin = new Agent.Zipkin(c.getConfig("zipkin"));
    }

    private static java.util.List<Agent.PathConfigs$Elm> $_LAgent_PathConfigs$Elm(com.typesafe.config.ConfigList cl) {
      java.util.ArrayList<Agent.PathConfigs$Elm> al = new java.util.ArrayList<>();
      for (com.typesafe.config.ConfigValue cv : cl) {
        al.add(new Agent.PathConfigs$Elm(((com.typesafe.config.ConfigObject) cv).toConfig()));
      }
      return java.util.Collections.unmodifiableList(al);
    }

    public static class Grpc {
      public final boolean          allMetrics;
      public final java.lang.String hostname;
      public final boolean          metricsEnabled;
      public final int              port;
      public final int              reconectPauseSecs;

      public Grpc(com.typesafe.config.Config c) {
        this.allMetrics = !c.hasPathOrNull("allMetrics") || c.getBoolean("allMetrics");
        this.hostname = c.hasPathOrNull("hostname") ? c.getString("hostname") : "localhost";
        this.metricsEnabled = !c.hasPathOrNull("metricsEnabled") || c.getBoolean("metricsEnabled");
        this.port = c.hasPathOrNull("port") ? c.getInt("port") : 50051;
        this.reconectPauseSecs = c.hasPathOrNull("reconectPauseSecs") ? c.getInt("reconectPauseSecs") : 3;
      }
    }

    public static class Metrics {
      public final boolean          enabled;
      public final java.lang.String path;
      public final int              port;

      public Metrics(com.typesafe.config.Config c) {
        this.enabled = !c.hasPathOrNull("enabled") || c.getBoolean("enabled");
        this.path = c.hasPathOrNull("path") ? c.getString("path") : "metrics";
        this.port = c.hasPathOrNull("port") ? c.getInt("port") : 8083;
      }
    }

    public static class PathConfigs$Elm {
      public final java.lang.String name;
      public final java.lang.String path;
      public final java.lang.String url;

      public PathConfigs$Elm(com.typesafe.config.Config c) {
        this.name = c.getString("name");
        this.path = c.getString("path");
        this.url = c.getString("url");
      }
    }

    public static class Scrape {
      public final boolean metricsEnabled;
      public final int     queueSize;

      public Scrape(com.typesafe.config.Config c) {
        this.metricsEnabled = !c.hasPathOrNull("metricsEnabled") || c.getBoolean("metricsEnabled");
        this.queueSize = c.hasPathOrNull("queueSize") ? c.getInt("queueSize") : 128;
      }
    }

    public static class Zipkin {
      public final boolean          enabled;
      public final java.lang.String hostname;
      public final java.lang.String path;
      public final int              port;
      public final java.lang.String serviceName;

      public Zipkin(com.typesafe.config.Config c) {
        this.enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled");
        this.hostname = c.hasPathOrNull("hostname") ? c.getString("hostname") : "localhost";
        this.path = c.hasPathOrNull("path") ? c.getString("path") : "api/v1/spans";
        this.port = c.hasPathOrNull("port") ? c.getInt("port") : 9411;
        this.serviceName = c.hasPathOrNull("serviceName") ? c.getString("serviceName") : "prometheus-agent";
      }
    }
  }

  public static class Proxy {
    public final Proxy.Grpc2    grpc;
    public final Proxy.Http     http;
    public final Proxy.Metrics2 metrics;
    public final Proxy.Zipkin2  zipkin;
    public Proxy(com.typesafe.config.Config c) {
      this.grpc = new Proxy.Grpc2(c.getConfig("grpc"));
      this.http = new Proxy.Http(c.getConfig("http"));
      this.metrics = new Proxy.Metrics2(c.getConfig("metrics"));
      this.zipkin = new Proxy.Zipkin2(c.getConfig("zipkin"));
    }

    public static class Grpc2 {
      public final boolean allMetrics;
      public final boolean metricsEnabled;
      public final int port;

      public Grpc2(com.typesafe.config.Config c) {
        this.allMetrics = !c.hasPathOrNull("allMetrics") || c.getBoolean("allMetrics");
        this.metricsEnabled = !c.hasPathOrNull("metricsEnabled") || c.getBoolean("metricsEnabled");
        this.port = c.hasPathOrNull("port") ? c.getInt("port") : 50051;
      }
    }

    public static class Http {
      public final int port;

      public Http(com.typesafe.config.Config c) {
        this.port = c.hasPathOrNull("port") ? c.getInt("port") : 8080;
      }
    }

    public static class Metrics2 {
      public final boolean          enabled;
      public final java.lang.String path;
      public final int              port;

      public Metrics2(com.typesafe.config.Config c) {
        this.enabled = !c.hasPathOrNull("enabled") || c.getBoolean("enabled");
        this.path = c.hasPathOrNull("path") ? c.getString("path") : "metrics";
        this.port = c.hasPathOrNull("port") ? c.getInt("port") : 8082;
      }
    }

    public static class Zipkin2 {
      public final boolean          enabled;
      public final java.lang.String hostname;
      public final java.lang.String path;
      public final int              port;
      public final java.lang.String serviceName;

      public Zipkin2(com.typesafe.config.Config c) {
        this.enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled");
        this.hostname = c.hasPathOrNull("hostname") ? c.getString("hostname") : "localhost";
        this.path = c.hasPathOrNull("path") ? c.getString("path") : "api/v1/spans";
        this.port = c.hasPathOrNull("port") ? c.getInt("port") : 9411;
        this.serviceName = c.hasPathOrNull("serviceName") ? c.getString("serviceName") : "prometheus-proxy";
      }
    }
  }
}
      

@@ -42,13 +42,13 @@
  14:
-30:56
+43:37
  PDT

Add support for typesafe config files