com.google.api.AuthRequirementKt.kt Maven / Gradle / Ivy
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/api/auth.proto
// Generated files should ignore deprecation warnings
@file:Suppress("DEPRECATION")
package com.google.api;
@kotlin.jvm.JvmName("-initializeauthRequirement")
public inline fun authRequirement(block: com.google.api.AuthRequirementKt.Dsl.() -> kotlin.Unit): com.google.api.AuthRequirement =
com.google.api.AuthRequirementKt.Dsl._create(com.google.api.AuthRequirement.newBuilder()).apply { block() }._build()
/**
* ```
* User-defined authentication requirements, including support for
* [JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).
* ```
*
* Protobuf type `google.api.AuthRequirement`
*/
public object AuthRequirementKt {
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
@com.google.protobuf.kotlin.ProtoDslMarker
public class Dsl private constructor(
private val _builder: com.google.api.AuthRequirement.Builder
) {
public companion object {
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _create(builder: com.google.api.AuthRequirement.Builder): Dsl = Dsl(builder)
}
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _build(): com.google.api.AuthRequirement = _builder.build()
/**
* ```
* [id][google.api.AuthProvider.id] from authentication provider.
*
* Example:
*
* provider_id: bookstore_auth
* ```
*
* `string provider_id = 1;`
*/
public var providerId: kotlin.String
@JvmName("getProviderId")
get() = _builder.getProviderId()
@JvmName("setProviderId")
set(value) {
_builder.setProviderId(value)
}
/**
* ```
* [id][google.api.AuthProvider.id] from authentication provider.
*
* Example:
*
* provider_id: bookstore_auth
* ```
*
* `string provider_id = 1;`
*/
public fun clearProviderId() {
_builder.clearProviderId()
}
/**
* ```
* NOTE: This will be deprecated soon, once AuthProvider.audiences is
* implemented and accepted in all the runtime components.
*
* The list of JWT
* [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
* that are allowed to access. A JWT containing any of these audiences will
* be accepted. When this setting is absent, only JWTs with audience
* "https://[Service_name][google.api.Service.name]/[API_name][google.protobuf.Api.name]"
* will be accepted. For example, if no audiences are in the setting,
* LibraryService API will only accept JWTs with the following audience
* "https://library-example.googleapis.com/google.example.library.v1.LibraryService".
*
* Example:
*
* audiences: bookstore_android.apps.googleusercontent.com,
* bookstore_web.apps.googleusercontent.com
* ```
*
* `string audiences = 2;`
*/
public var audiences: kotlin.String
@JvmName("getAudiences")
get() = _builder.getAudiences()
@JvmName("setAudiences")
set(value) {
_builder.setAudiences(value)
}
/**
* ```
* NOTE: This will be deprecated soon, once AuthProvider.audiences is
* implemented and accepted in all the runtime components.
*
* The list of JWT
* [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
* that are allowed to access. A JWT containing any of these audiences will
* be accepted. When this setting is absent, only JWTs with audience
* "https://[Service_name][google.api.Service.name]/[API_name][google.protobuf.Api.name]"
* will be accepted. For example, if no audiences are in the setting,
* LibraryService API will only accept JWTs with the following audience
* "https://library-example.googleapis.com/google.example.library.v1.LibraryService".
*
* Example:
*
* audiences: bookstore_android.apps.googleusercontent.com,
* bookstore_web.apps.googleusercontent.com
* ```
*
* `string audiences = 2;`
*/
public fun clearAudiences() {
_builder.clearAudiences()
}
}
}
@kotlin.jvm.JvmSynthetic
public inline fun com.google.api.AuthRequirement.copy(block: `com.google.api`.AuthRequirementKt.Dsl.() -> kotlin.Unit): com.google.api.AuthRequirement =
`com.google.api`.AuthRequirementKt.Dsl._create(this.toBuilder()).apply { block() }._build()