com.google.api.MetricRuleKt.kt Maven / Gradle / Ivy
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/api/quota.proto
// Generated files should ignore deprecation warnings
@file:Suppress("DEPRECATION")
package com.google.api;
@kotlin.jvm.JvmName("-initializemetricRule")
public inline fun metricRule(block: com.google.api.MetricRuleKt.Dsl.() -> kotlin.Unit): com.google.api.MetricRule =
com.google.api.MetricRuleKt.Dsl._create(com.google.api.MetricRule.newBuilder()).apply { block() }._build()
/**
* ```
* Bind API methods to metrics. Binding a method to a metric causes that
* metric's configured quota, billing, and monitoring behaviors to apply to the
* method call.
*
* Used by metric-based quotas only.
* ```
*
* Protobuf type `google.api.MetricRule`
*/
public object MetricRuleKt {
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
@com.google.protobuf.kotlin.ProtoDslMarker
public class Dsl private constructor(
private val _builder: com.google.api.MetricRule.Builder
) {
public companion object {
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _create(builder: com.google.api.MetricRule.Builder): Dsl = Dsl(builder)
}
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _build(): com.google.api.MetricRule = _builder.build()
/**
* ```
* Selects the methods to which this rule applies.
*
* Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
* ```
*
* `string selector = 1;`
*/
public var selector: kotlin.String
@JvmName("getSelector")
get() = _builder.getSelector()
@JvmName("setSelector")
set(value) {
_builder.setSelector(value)
}
/**
* ```
* Selects the methods to which this rule applies.
*
* Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
* ```
*
* `string selector = 1;`
*/
public fun clearSelector() {
_builder.clearSelector()
}
/**
* An uninstantiable, behaviorless type to represent the field in
* generics.
*/
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
public class MetricCostsProxy private constructor() : com.google.protobuf.kotlin.DslProxy()
/**
* ```
* Metrics to update when the selected methods are called, and the associated
* cost applied to each metric.
*
* The key of the map is the metric name, and the values are the amount
* increased for the metric against which the quota limits are defined.
* The value must not be negative.
* ```
*
* `map metric_costs = 2;`
*/
public val metricCosts: com.google.protobuf.kotlin.DslMap
@kotlin.jvm.JvmSynthetic
@JvmName("getMetricCostsMap")
get() = com.google.protobuf.kotlin.DslMap(
_builder.getMetricCostsMap()
)
/**
* ```
* Metrics to update when the selected methods are called, and the associated
* cost applied to each metric.
*
* The key of the map is the metric name, and the values are the amount
* increased for the metric against which the quota limits are defined.
* The value must not be negative.
* ```
*
* `map metric_costs = 2;`
*/
@JvmName("putMetricCosts")
public fun com.google.protobuf.kotlin.DslMap
.put(key: kotlin.String, value: kotlin.Long) {
_builder.putMetricCosts(key, value)
}
/**
* ```
* Metrics to update when the selected methods are called, and the associated
* cost applied to each metric.
*
* The key of the map is the metric name, and the values are the amount
* increased for the metric against which the quota limits are defined.
* The value must not be negative.
* ```
*
* `map metric_costs = 2;`
*/
@kotlin.jvm.JvmSynthetic
@JvmName("setMetricCosts")
@Suppress("NOTHING_TO_INLINE")
public inline operator fun com.google.protobuf.kotlin.DslMap
.set(key: kotlin.String, value: kotlin.Long) {
put(key, value)
}
/**
* ```
* Metrics to update when the selected methods are called, and the associated
* cost applied to each metric.
*
* The key of the map is the metric name, and the values are the amount
* increased for the metric against which the quota limits are defined.
* The value must not be negative.
* ```
*
* `map metric_costs = 2;`
*/
@kotlin.jvm.JvmSynthetic
@JvmName("removeMetricCosts")
public fun com.google.protobuf.kotlin.DslMap
.remove(key: kotlin.String) {
_builder.removeMetricCosts(key)
}
/**
* ```
* Metrics to update when the selected methods are called, and the associated
* cost applied to each metric.
*
* The key of the map is the metric name, and the values are the amount
* increased for the metric against which the quota limits are defined.
* The value must not be negative.
* ```
*
* `map metric_costs = 2;`
*/
@kotlin.jvm.JvmSynthetic
@JvmName("putAllMetricCosts")
public fun com.google.protobuf.kotlin.DslMap
.putAll(map: kotlin.collections.Map) {
_builder.putAllMetricCosts(map)
}
/**
* ```
* Metrics to update when the selected methods are called, and the associated
* cost applied to each metric.
*
* The key of the map is the metric name, and the values are the amount
* increased for the metric against which the quota limits are defined.
* The value must not be negative.
* ```
*
* `map metric_costs = 2;`
*/
@kotlin.jvm.JvmSynthetic
@JvmName("clearMetricCosts")
public fun com.google.protobuf.kotlin.DslMap
.clear() {
_builder.clearMetricCosts()
}
}
}
@kotlin.jvm.JvmSynthetic
public inline fun com.google.api.MetricRule.copy(block: `com.google.api`.MetricRuleKt.Dsl.() -> kotlin.Unit): com.google.api.MetricRule =
`com.google.api`.MetricRuleKt.Dsl._create(this.toBuilder()).apply { block() }._build()