com.google.api.ContextKt.kt Maven / Gradle / Ivy
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/api/context.proto
// Generated files should ignore deprecation warnings
@file:Suppress("DEPRECATION")
package com.google.api;
@kotlin.jvm.JvmName("-initializecontext")
public inline fun context(block: com.google.api.ContextKt.Dsl.() -> kotlin.Unit): com.google.api.Context =
com.google.api.ContextKt.Dsl._create(com.google.api.Context.newBuilder()).apply { block() }._build()
/**
* ```
* `Context` defines which contexts an API requests.
*
* Example:
*
* context:
* rules:
* - selector: "*"
* requested:
* - google.rpc.context.ProjectContext
* - google.rpc.context.OriginContext
*
* The above specifies that all methods in the API request
* `google.rpc.context.ProjectContext` and
* `google.rpc.context.OriginContext`.
*
* Available context types are defined in package
* `google.rpc.context`.
* ```
*
* Protobuf type `google.api.Context`
*/
public object ContextKt {
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
@com.google.protobuf.kotlin.ProtoDslMarker
public class Dsl private constructor(
private val _builder: com.google.api.Context.Builder
) {
public companion object {
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _create(builder: com.google.api.Context.Builder): Dsl = Dsl(builder)
}
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _build(): com.google.api.Context = _builder.build()
/**
* An uninstantiable, behaviorless type to represent the field in
* generics.
*/
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
public class RulesProxy private constructor() : com.google.protobuf.kotlin.DslProxy()
/**
* ```
* A list of RPC context rules that apply to individual API methods.
*
* **NOTE:** All service configuration rules follow "last one wins" order.
* ```
*
* `repeated .google.api.ContextRule rules = 1;`
*/
public val rules: com.google.protobuf.kotlin.DslList
@kotlin.jvm.JvmSynthetic
get() = com.google.protobuf.kotlin.DslList(
_builder.getRulesList()
)
/**
* ```
* A list of RPC context rules that apply to individual API methods.
*
* **NOTE:** All service configuration rules follow "last one wins" order.
* ```
*
* `repeated .google.api.ContextRule rules = 1;`
* @param value The rules to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("addRules")
public fun com.google.protobuf.kotlin.DslList.add(value: com.google.api.ContextRule) {
_builder.addRules(value)
}
/**
* ```
* A list of RPC context rules that apply to individual API methods.
*
* **NOTE:** All service configuration rules follow "last one wins" order.
* ```
*
* `repeated .google.api.ContextRule rules = 1;`
* @param value The rules to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("plusAssignRules")
@Suppress("NOTHING_TO_INLINE")
public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: com.google.api.ContextRule) {
add(value)
}
/**
* ```
* A list of RPC context rules that apply to individual API methods.
*
* **NOTE:** All service configuration rules follow "last one wins" order.
* ```
*
* `repeated .google.api.ContextRule rules = 1;`
* @param values The rules to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("addAllRules")
public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) {
_builder.addAllRules(values)
}
/**
* ```
* A list of RPC context rules that apply to individual API methods.
*
* **NOTE:** All service configuration rules follow "last one wins" order.
* ```
*
* `repeated .google.api.ContextRule rules = 1;`
* @param values The rules to add.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("plusAssignAllRules")
@Suppress("NOTHING_TO_INLINE")
public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) {
addAll(values)
}
/**
* ```
* A list of RPC context rules that apply to individual API methods.
*
* **NOTE:** All service configuration rules follow "last one wins" order.
* ```
*
* `repeated .google.api.ContextRule rules = 1;`
* @param index The index to set the value at.
* @param value The rules to set.
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("setRules")
public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: com.google.api.ContextRule) {
_builder.setRules(index, value)
}
/**
* ```
* A list of RPC context rules that apply to individual API methods.
*
* **NOTE:** All service configuration rules follow "last one wins" order.
* ```
*
* `repeated .google.api.ContextRule rules = 1;`
*/
@kotlin.jvm.JvmSynthetic
@kotlin.jvm.JvmName("clearRules")
public fun com.google.protobuf.kotlin.DslList.clear() {
_builder.clearRules()
}
}
}
@kotlin.jvm.JvmSynthetic
public inline fun com.google.api.Context.copy(block: `com.google.api`.ContextKt.Dsl.() -> kotlin.Unit): com.google.api.Context =
`com.google.api`.ContextKt.Dsl._create(this.toBuilder()).apply { block() }._build()