com.google.api.UsageRuleKt.kt Maven / Gradle / Ivy
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/api/usage.proto
// Generated files should ignore deprecation warnings
@file:Suppress("DEPRECATION")
package com.google.api;
@kotlin.jvm.JvmName("-initializeusageRule")
public inline fun usageRule(block: com.google.api.UsageRuleKt.Dsl.() -> kotlin.Unit): com.google.api.UsageRule =
com.google.api.UsageRuleKt.Dsl._create(com.google.api.UsageRule.newBuilder()).apply { block() }._build()
/**
* ```
* Usage configuration rules for the service.
*
* NOTE: Under development.
*
*
* Use this rule to configure unregistered calls for the service. Unregistered
* calls are calls that do not contain consumer project identity.
* (Example: calls that do not contain an API key).
* By default, API methods do not allow unregistered calls, and each method call
* must be identified by a consumer project identity. Use this rule to
* allow/disallow unregistered calls.
*
* Example of an API that wants to allow unregistered calls for entire service.
*
* usage:
* rules:
* - selector: "*"
* allow_unregistered_calls: true
*
* Example of a method that wants to allow unregistered calls.
*
* usage:
* rules:
* - selector: "google.example.library.v1.LibraryService.CreateBook"
* allow_unregistered_calls: true
* ```
*
* Protobuf type `google.api.UsageRule`
*/
public object UsageRuleKt {
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
@com.google.protobuf.kotlin.ProtoDslMarker
public class Dsl private constructor(
private val _builder: com.google.api.UsageRule.Builder
) {
public companion object {
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _create(builder: com.google.api.UsageRule.Builder): Dsl = Dsl(builder)
}
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _build(): com.google.api.UsageRule = _builder.build()
/**
* ```
* Selects the methods to which this rule applies. Use '*' to indicate all
* methods in all APIs.
*
* 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. Use '*' to indicate all
* methods in all APIs.
*
* Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
* ```
*
* `string selector = 1;`
*/
public fun clearSelector() {
_builder.clearSelector()
}
/**
* ```
* If true, the selected method allows unregistered calls, e.g. calls
* that don't identify any user or application.
* ```
*
* `bool allow_unregistered_calls = 2;`
*/
public var allowUnregisteredCalls: kotlin.Boolean
@JvmName("getAllowUnregisteredCalls")
get() = _builder.getAllowUnregisteredCalls()
@JvmName("setAllowUnregisteredCalls")
set(value) {
_builder.setAllowUnregisteredCalls(value)
}
/**
* ```
* If true, the selected method allows unregistered calls, e.g. calls
* that don't identify any user or application.
* ```
*
* `bool allow_unregistered_calls = 2;`
*/
public fun clearAllowUnregisteredCalls() {
_builder.clearAllowUnregisteredCalls()
}
/**
* ```
* If true, the selected method should skip service control and the control
* plane features, such as quota and billing, will not be available.
* This flag is used by Google Cloud Endpoints to bypass checks for internal
* methods, such as service health check methods.
* ```
*
* `bool skip_service_control = 3;`
*/
public var skipServiceControl: kotlin.Boolean
@JvmName("getSkipServiceControl")
get() = _builder.getSkipServiceControl()
@JvmName("setSkipServiceControl")
set(value) {
_builder.setSkipServiceControl(value)
}
/**
* ```
* If true, the selected method should skip service control and the control
* plane features, such as quota and billing, will not be available.
* This flag is used by Google Cloud Endpoints to bypass checks for internal
* methods, such as service health check methods.
* ```
*
* `bool skip_service_control = 3;`
*/
public fun clearSkipServiceControl() {
_builder.clearSkipServiceControl()
}
}
}
@kotlin.jvm.JvmSynthetic
public inline fun com.google.api.UsageRule.copy(block: `com.google.api`.UsageRuleKt.Dsl.() -> kotlin.Unit): com.google.api.UsageRule =
`com.google.api`.UsageRuleKt.Dsl._create(this.toBuilder()).apply { block() }._build()