com.google.api.SystemParametersKt.kt Maven / Gradle / Ivy
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/api/system_parameter.proto
// Generated files should ignore deprecation warnings
@file:Suppress("DEPRECATION")
package com.google.api;
@kotlin.jvm.JvmName("-initializesystemParameters")
public inline fun systemParameters(block: com.google.api.SystemParametersKt.Dsl.() -> kotlin.Unit): com.google.api.SystemParameters =
com.google.api.SystemParametersKt.Dsl._create(com.google.api.SystemParameters.newBuilder()).apply { block() }._build()
/**
* ```
* ### System parameter configuration
*
* A system parameter is a special kind of parameter defined by the API
* system, not by an individual API. It is typically mapped to an HTTP header
* and/or a URL query parameter. This configuration specifies which methods
* change the names of the system parameters.
* ```
*
* Protobuf type `google.api.SystemParameters`
*/
public object SystemParametersKt {
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
@com.google.protobuf.kotlin.ProtoDslMarker
public class Dsl private constructor(
private val _builder: com.google.api.SystemParameters.Builder
) {
public companion object {
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _create(builder: com.google.api.SystemParameters.Builder): Dsl = Dsl(builder)
}
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _build(): com.google.api.SystemParameters = _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()
/**
* ```
* Define system parameters.
*
* The parameters defined here will override the default parameters
* implemented by the system. If this field is missing from the service
* config, default system parameters will be used. Default system parameters
* and names is implementation-dependent.
*
* Example: define api key for all methods
*
* system_parameters
* rules:
* - selector: "*"
* parameters:
* - name: api_key
* url_query_parameter: api_key
*
*
* Example: define 2 api key names for a specific method.
*
* system_parameters
* rules:
* - selector: "/ListShelves"
* parameters:
* - name: api_key
* http_header: Api-Key1
* - name: api_key
* http_header: Api-Key2
*
* **NOTE:** All service configuration rules follow "last one wins" order.
* ```
*
* `repeated .google.api.SystemParameterRule rules = 1;`
*/
public val rules: com.google.protobuf.kotlin.DslList
@kotlin.jvm.JvmSynthetic
get() = com.google.protobuf.kotlin.DslList(
_builder.getRulesList()
)
/**
* ```
* Define system parameters.
*
* The parameters defined here will override the default parameters
* implemented by the system. If this field is missing from the service
* config, default system parameters will be used. Default system parameters
* and names is implementation-dependent.
*
* Example: define api key for all methods
*
* system_parameters
* rules:
* - selector: "*"
* parameters:
* - name: api_key
* url_query_parameter: api_key
*
*
* Example: define 2 api key names for a specific method.
*
* system_parameters
* rules:
* - selector: "/ListShelves"
* parameters:
* - name: api_key
* http_header: Api-Key1
* - name: api_key
* http_header: Api-Key2
*
* **NOTE:** All service configuration rules follow "last one wins" order.
* ```
*
* `repeated .google.api.SystemParameterRule 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.SystemParameterRule) {
_builder.addRules(value)
}
/**
* ```
* Define system parameters.
*
* The parameters defined here will override the default parameters
* implemented by the system. If this field is missing from the service
* config, default system parameters will be used. Default system parameters
* and names is implementation-dependent.
*
* Example: define api key for all methods
*
* system_parameters
* rules:
* - selector: "*"
* parameters:
* - name: api_key
* url_query_parameter: api_key
*
*
* Example: define 2 api key names for a specific method.
*
* system_parameters
* rules:
* - selector: "/ListShelves"
* parameters:
* - name: api_key
* http_header: Api-Key1
* - name: api_key
* http_header: Api-Key2
*
* **NOTE:** All service configuration rules follow "last one wins" order.
* ```
*
* `repeated .google.api.SystemParameterRule 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.SystemParameterRule) {
add(value)
}
/**
* ```
* Define system parameters.
*
* The parameters defined here will override the default parameters
* implemented by the system. If this field is missing from the service
* config, default system parameters will be used. Default system parameters
* and names is implementation-dependent.
*
* Example: define api key for all methods
*
* system_parameters
* rules:
* - selector: "*"
* parameters:
* - name: api_key
* url_query_parameter: api_key
*
*
* Example: define 2 api key names for a specific method.
*
* system_parameters
* rules:
* - selector: "/ListShelves"
* parameters:
* - name: api_key
* http_header: Api-Key1
* - name: api_key
* http_header: Api-Key2
*
* **NOTE:** All service configuration rules follow "last one wins" order.
* ```
*
* `repeated .google.api.SystemParameterRule 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)
}
/**
* ```
* Define system parameters.
*
* The parameters defined here will override the default parameters
* implemented by the system. If this field is missing from the service
* config, default system parameters will be used. Default system parameters
* and names is implementation-dependent.
*
* Example: define api key for all methods
*
* system_parameters
* rules:
* - selector: "*"
* parameters:
* - name: api_key
* url_query_parameter: api_key
*
*
* Example: define 2 api key names for a specific method.
*
* system_parameters
* rules:
* - selector: "/ListShelves"
* parameters:
* - name: api_key
* http_header: Api-Key1
* - name: api_key
* http_header: Api-Key2
*
* **NOTE:** All service configuration rules follow "last one wins" order.
* ```
*
* `repeated .google.api.SystemParameterRule 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)
}
/**
* ```
* Define system parameters.
*
* The parameters defined here will override the default parameters
* implemented by the system. If this field is missing from the service
* config, default system parameters will be used. Default system parameters
* and names is implementation-dependent.
*
* Example: define api key for all methods
*
* system_parameters
* rules:
* - selector: "*"
* parameters:
* - name: api_key
* url_query_parameter: api_key
*
*
* Example: define 2 api key names for a specific method.
*
* system_parameters
* rules:
* - selector: "/ListShelves"
* parameters:
* - name: api_key
* http_header: Api-Key1
* - name: api_key
* http_header: Api-Key2
*
* **NOTE:** All service configuration rules follow "last one wins" order.
* ```
*
* `repeated .google.api.SystemParameterRule 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.SystemParameterRule) {
_builder.setRules(index, value)
}
/**
* ```
* Define system parameters.
*
* The parameters defined here will override the default parameters
* implemented by the system. If this field is missing from the service
* config, default system parameters will be used. Default system parameters
* and names is implementation-dependent.
*
* Example: define api key for all methods
*
* system_parameters
* rules:
* - selector: "*"
* parameters:
* - name: api_key
* url_query_parameter: api_key
*
*
* Example: define 2 api key names for a specific method.
*
* system_parameters
* rules:
* - selector: "/ListShelves"
* parameters:
* - name: api_key
* http_header: Api-Key1
* - name: api_key
* http_header: Api-Key2
*
* **NOTE:** All service configuration rules follow "last one wins" order.
* ```
*
* `repeated .google.api.SystemParameterRule 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.SystemParameters.copy(block: `com.google.api`.SystemParametersKt.Dsl.() -> kotlin.Unit): com.google.api.SystemParameters =
`com.google.api`.SystemParametersKt.Dsl._create(this.toBuilder()).apply { block() }._build()