com.google.api.MonitoringKt.kt Maven / Gradle / Ivy
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/api/monitoring.proto
// Generated files should ignore deprecation warnings
@file:Suppress("DEPRECATION")
package com.google.api;
@kotlin.jvm.JvmName("-initializemonitoring")
public inline fun monitoring(block: com.google.api.MonitoringKt.Dsl.() -> kotlin.Unit): com.google.api.Monitoring =
com.google.api.MonitoringKt.Dsl._create(com.google.api.Monitoring.newBuilder()).apply { block() }._build()
/**
* ```
* Monitoring configuration of the service.
*
* The example below shows how to configure monitored resources and metrics
* for monitoring. In the example, a monitored resource and two metrics are
* defined. The `library.googleapis.com/book/returned_count` metric is sent
* to both producer and consumer projects, whereas the
* `library.googleapis.com/book/overdue_count` metric is only sent to the
* consumer project.
*
* monitored_resources:
* - type: library.googleapis.com/branch
* labels:
* - key: /city
* description: The city where the library branch is located in.
* - key: /name
* description: The name of the branch.
* metrics:
* - name: library.googleapis.com/book/returned_count
* metric_kind: DELTA
* value_type: INT64
* labels:
* - key: /customer_id
* - name: library.googleapis.com/book/overdue_count
* metric_kind: GAUGE
* value_type: INT64
* labels:
* - key: /customer_id
* monitoring:
* producer_destinations:
* - monitored_resource: library.googleapis.com/branch
* metrics:
* - library.googleapis.com/book/returned_count
* consumer_destinations:
* - monitored_resource: library.googleapis.com/branch
* metrics:
* - library.googleapis.com/book/returned_count
* - library.googleapis.com/book/overdue_count
* ```
*
* Protobuf type `google.api.Monitoring`
*/
public object MonitoringKt {
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
@com.google.protobuf.kotlin.ProtoDslMarker
public class Dsl private constructor(
private val _builder: com.google.api.Monitoring.Builder
) {
public companion object {
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _create(builder: com.google.api.Monitoring.Builder): Dsl = Dsl(builder)
}
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _build(): com.google.api.Monitoring = _builder.build()
/**
* An uninstantiable, behaviorless type to represent the field in
* generics.
*/
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
public class ProducerDestinationsProxy private constructor() : com.google.protobuf.kotlin.DslProxy()
/**
* ```
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
* ```
*
* `repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;`
*/
public val producerDestinations: com.google.protobuf.kotlin.DslList
@kotlin.jvm.JvmSynthetic
get() = com.google.protobuf.kotlin.DslList(
_builder.getProducerDestinationsList()
)
/**
* ```
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
* ```
*
* `repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;`
* @param value The producerDestinations to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("addProducerDestinations")
public fun com.google.protobuf.kotlin.DslList.add(value: com.google.api.Monitoring.MonitoringDestination) {
_builder.addProducerDestinations(value)
}
/**
* ```
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
* ```
*
* `repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;`
* @param value The producerDestinations to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("plusAssignProducerDestinations")
@Suppress("NOTHING_TO_INLINE")
public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: com.google.api.Monitoring.MonitoringDestination) {
add(value)
}
/**
* ```
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
* ```
*
* `repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;`
* @param values The producerDestinations to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("addAllProducerDestinations")
public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) {
_builder.addAllProducerDestinations(values)
}
/**
* ```
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
* ```
*
* `repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;`
* @param values The producerDestinations to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("plusAssignAllProducerDestinations")
@Suppress("NOTHING_TO_INLINE")
public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) {
addAll(values)
}
/**
* ```
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
* ```
*
* `repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;`
* @param index The index to set the value at.
* @param value The producerDestinations to set.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("setProducerDestinations")
public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: com.google.api.Monitoring.MonitoringDestination) {
_builder.setProducerDestinations(index, value)
}
/**
* ```
* Monitoring configurations for sending metrics to the producer project.
* There can be multiple producer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one producer destination.
* ```
*
* `repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;`
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("clearProducerDestinations")
public fun com.google.protobuf.kotlin.DslList.clear() {
_builder.clearProducerDestinations()
}
/**
* An uninstantiable, behaviorless type to represent the field in
* generics.
*/
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
public class ConsumerDestinationsProxy private constructor() : com.google.protobuf.kotlin.DslProxy()
/**
* ```
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
* ```
*
* `repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;`
*/
public val consumerDestinations: com.google.protobuf.kotlin.DslList
@kotlin.jvm.JvmSynthetic
get() = com.google.protobuf.kotlin.DslList(
_builder.getConsumerDestinationsList()
)
/**
* ```
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
* ```
*
* `repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;`
* @param value The consumerDestinations to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("addConsumerDestinations")
public fun com.google.protobuf.kotlin.DslList.add(value: com.google.api.Monitoring.MonitoringDestination) {
_builder.addConsumerDestinations(value)
}
/**
* ```
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
* ```
*
* `repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;`
* @param value The consumerDestinations to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("plusAssignConsumerDestinations")
@Suppress("NOTHING_TO_INLINE")
public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: com.google.api.Monitoring.MonitoringDestination) {
add(value)
}
/**
* ```
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
* ```
*
* `repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;`
* @param values The consumerDestinations to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("addAllConsumerDestinations")
public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) {
_builder.addAllConsumerDestinations(values)
}
/**
* ```
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
* ```
*
* `repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;`
* @param values The consumerDestinations to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("plusAssignAllConsumerDestinations")
@Suppress("NOTHING_TO_INLINE")
public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) {
addAll(values)
}
/**
* ```
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
* ```
*
* `repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;`
* @param index The index to set the value at.
* @param value The consumerDestinations to set.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("setConsumerDestinations")
public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: com.google.api.Monitoring.MonitoringDestination) {
_builder.setConsumerDestinations(index, value)
}
/**
* ```
* Monitoring configurations for sending metrics to the consumer project.
* There can be multiple consumer destinations, each one must have a
* different monitored resource type. A metric can be used in at most
* one consumer destination.
* ```
*
* `repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;`
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("clearConsumerDestinations")
public fun com.google.protobuf.kotlin.DslList.clear() {
_builder.clearConsumerDestinations()
}
}
@kotlin.jvm.JvmName("-initializemonitoringDestination")
public inline fun monitoringDestination(block: com.google.api.MonitoringKt.MonitoringDestinationKt.Dsl.() -> kotlin.Unit): com.google.api.Monitoring.MonitoringDestination =
com.google.api.MonitoringKt.MonitoringDestinationKt.Dsl._create(com.google.api.Monitoring.MonitoringDestination.newBuilder()).apply { block() }._build()
/**
* ```
* Configuration of a specific monitoring destination (the producer project
* or the consumer project).
* ```
*
* Protobuf type `google.api.Monitoring.MonitoringDestination`
*/
public object MonitoringDestinationKt {
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
@com.google.protobuf.kotlin.ProtoDslMarker
public class Dsl private constructor(
private val _builder: com.google.api.Monitoring.MonitoringDestination.Builder
) {
public companion object {
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _create(builder: com.google.api.Monitoring.MonitoringDestination.Builder): Dsl = Dsl(builder)
}
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _build(): com.google.api.Monitoring.MonitoringDestination = _builder.build()
/**
* ```
* The monitored resource type. The type must be defined in
* [Service.monitored_resources][google.api.Service.monitored_resources] section.
* ```
*
* `string monitored_resource = 1;`
*/
public var monitoredResource: kotlin.String
@JvmName("getMonitoredResource")
get() = _builder.getMonitoredResource()
@JvmName("setMonitoredResource")
set(value) {
_builder.setMonitoredResource(value)
}
/**
* ```
* The monitored resource type. The type must be defined in
* [Service.monitored_resources][google.api.Service.monitored_resources] section.
* ```
*
* `string monitored_resource = 1;`
*/
public fun clearMonitoredResource() {
_builder.clearMonitoredResource()
}
/**
* An uninstantiable, behaviorless type to represent the field in
* generics.
*/
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
public class MetricsProxy private constructor() : com.google.protobuf.kotlin.DslProxy()
/**
* ```
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
* ```
*
* `repeated string metrics = 2;`
* @return A list containing the metrics.
*/
public val metrics: com.google.protobuf.kotlin.DslList
@kotlin.jvm.JvmSynthetic
get() = com.google.protobuf.kotlin.DslList(
_builder.getMetricsList()
)
/**
* ```
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
* ```
*
* `repeated string metrics = 2;`
* @param value The metrics to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("addMetrics")
public fun com.google.protobuf.kotlin.DslList.add(value: kotlin.String) {
_builder.addMetrics(value)
}
/**
* ```
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
* ```
*
* `repeated string metrics = 2;`
* @param value The metrics to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("plusAssignMetrics")
@Suppress("NOTHING_TO_INLINE")
public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: kotlin.String) {
add(value)
}
/**
* ```
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
* ```
*
* `repeated string metrics = 2;`
* @param values The metrics to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("addAllMetrics")
public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) {
_builder.addAllMetrics(values)
}
/**
* ```
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
* ```
*
* `repeated string metrics = 2;`
* @param values The metrics to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("plusAssignAllMetrics")
@Suppress("NOTHING_TO_INLINE")
public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) {
addAll(values)
}
/**
* ```
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
* ```
*
* `repeated string metrics = 2;`
* @param index The index to set the value at.
* @param value The metrics to set.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("setMetrics")
public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: kotlin.String) {
_builder.setMetrics(index, value)
}/**
* ```
* Names of the metrics to report to this monitoring destination.
* Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
* ```
*
* `repeated string metrics = 2;`
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("clearMetrics")
public fun com.google.protobuf.kotlin.DslList.clear() {
_builder.clearMetrics()
}}
}
}
@kotlin.jvm.JvmSynthetic
public inline fun com.google.api.Monitoring.copy(block: `com.google.api`.MonitoringKt.Dsl.() -> kotlin.Unit): com.google.api.Monitoring =
`com.google.api`.MonitoringKt.Dsl._create(this.toBuilder()).apply { block() }._build()
@kotlin.jvm.JvmSynthetic
public inline fun com.google.api.Monitoring.MonitoringDestination.copy(block: `com.google.api`.MonitoringKt.MonitoringDestinationKt.Dsl.() -> kotlin.Unit): com.google.api.Monitoring.MonitoringDestination =
`com.google.api`.MonitoringKt.MonitoringDestinationKt.Dsl._create(this.toBuilder()).apply { block() }._build()