use of com.google.api.server.spi.config.ApiLimitMetric in project endpoints-java by cloudendpoints.
the class ApiAnnotationConfig method setApiLimitMetrics.
public void setApiLimitMetrics(ApiLimitMetric[] apiLimitMetrics) {
ImmutableList.Builder<ApiLimitMetricConfig> metricConfigs = ImmutableList.builder();
if (apiLimitMetrics != null && apiLimitMetrics.length > 0) {
for (ApiLimitMetric metric : apiLimitMetrics) {
metricConfigs.add(ApiLimitMetricConfig.builder().setName(metric.name()).setDisplayName(metric.displayName()).setLimit(metric.limit()).build());
}
}
config.setApiLimitMetrics(metricConfigs.build());
}
Aggregations