com.authzed.api.v1.RelationshipKt.kt Maven / Gradle / Ivy
The newest version!
//Generated by the protocol buffer compiler. DO NOT EDIT!
// source: authzed/api/v1/core.proto
package com.authzed.api.v1;
@kotlin.jvm.JvmName("-initializerelationship")
public inline fun relationship(block: com.authzed.api.v1.RelationshipKt.Dsl.() -> kotlin.Unit): com.authzed.api.v1.Core.Relationship =
com.authzed.api.v1.RelationshipKt.Dsl._create(com.authzed.api.v1.Core.Relationship.newBuilder()).apply { block() }._build()
public object RelationshipKt {
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
@com.google.protobuf.kotlin.ProtoDslMarker
public class Dsl private constructor(
private val _builder: com.authzed.api.v1.Core.Relationship.Builder
) {
public companion object {
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _create(builder: com.authzed.api.v1.Core.Relationship.Builder): Dsl = Dsl(builder)
}
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _build(): com.authzed.api.v1.Core.Relationship = _builder.build()
/**
*
* resource is the resource to which the subject is related, in some manner
*
*
* .authzed.api.v1.ObjectReference resource = 1 [(.validate.rules) = { ... }
*/
public var resource: com.authzed.api.v1.Core.ObjectReference
@JvmName("getResource")
get() = _builder.getResource()
@JvmName("setResource")
set(value) {
_builder.setResource(value)
}
/**
*
* resource is the resource to which the subject is related, in some manner
*
*
* .authzed.api.v1.ObjectReference resource = 1 [(.validate.rules) = { ... }
*/
public fun clearResource() {
_builder.clearResource()
}
/**
*
* resource is the resource to which the subject is related, in some manner
*
*
* .authzed.api.v1.ObjectReference resource = 1 [(.validate.rules) = { ... }
* @return Whether the resource field is set.
*/
public fun hasResource(): kotlin.Boolean {
return _builder.hasResource()
}
/**
*
* relation is how the resource and subject are related.
*
*
* string relation = 2 [(.validate.rules) = { ... }
*/
public var relation: kotlin.String
@JvmName("getRelation")
get() = _builder.getRelation()
@JvmName("setRelation")
set(value) {
_builder.setRelation(value)
}
/**
*
* relation is how the resource and subject are related.
*
*
* string relation = 2 [(.validate.rules) = { ... }
*/
public fun clearRelation() {
_builder.clearRelation()
}
/**
*
* subject is the subject to which the resource is related, in some manner.
*
*
* .authzed.api.v1.SubjectReference subject = 3 [(.validate.rules) = { ... }
*/
public var subject: com.authzed.api.v1.Core.SubjectReference
@JvmName("getSubject")
get() = _builder.getSubject()
@JvmName("setSubject")
set(value) {
_builder.setSubject(value)
}
/**
*
* subject is the subject to which the resource is related, in some manner.
*
*
* .authzed.api.v1.SubjectReference subject = 3 [(.validate.rules) = { ... }
*/
public fun clearSubject() {
_builder.clearSubject()
}
/**
*
* subject is the subject to which the resource is related, in some manner.
*
*
* .authzed.api.v1.SubjectReference subject = 3 [(.validate.rules) = { ... }
* @return Whether the subject field is set.
*/
public fun hasSubject(): kotlin.Boolean {
return _builder.hasSubject()
}
/**
*
* optional_caveat is a reference to a the caveat that must be enforced over the relationship
*
*
* .authzed.api.v1.ContextualizedCaveat optional_caveat = 4 [(.validate.rules) = { ... }
*/
public var optionalCaveat: com.authzed.api.v1.Core.ContextualizedCaveat
@JvmName("getOptionalCaveat")
get() = _builder.getOptionalCaveat()
@JvmName("setOptionalCaveat")
set(value) {
_builder.setOptionalCaveat(value)
}
/**
*
* optional_caveat is a reference to a the caveat that must be enforced over the relationship
*
*
* .authzed.api.v1.ContextualizedCaveat optional_caveat = 4 [(.validate.rules) = { ... }
*/
public fun clearOptionalCaveat() {
_builder.clearOptionalCaveat()
}
/**
*
* optional_caveat is a reference to a the caveat that must be enforced over the relationship
*
*
* .authzed.api.v1.ContextualizedCaveat optional_caveat = 4 [(.validate.rules) = { ... }
* @return Whether the optionalCaveat field is set.
*/
public fun hasOptionalCaveat(): kotlin.Boolean {
return _builder.hasOptionalCaveat()
}
}
}
@kotlin.jvm.JvmSynthetic
public inline fun com.authzed.api.v1.Core.Relationship.copy(block: com.authzed.api.v1.RelationshipKt.Dsl.() -> kotlin.Unit): com.authzed.api.v1.Core.Relationship =
com.authzed.api.v1.RelationshipKt.Dsl._create(this.toBuilder()).apply { block() }._build()
public val com.authzed.api.v1.Core.RelationshipOrBuilder.resourceOrNull: com.authzed.api.v1.Core.ObjectReference?
get() = if (hasResource()) getResource() else null
public val com.authzed.api.v1.Core.RelationshipOrBuilder.subjectOrNull: com.authzed.api.v1.Core.SubjectReference?
get() = if (hasSubject()) getSubject() else null
public val com.authzed.api.v1.Core.RelationshipOrBuilder.optionalCaveatOrNull: com.authzed.api.v1.Core.ContextualizedCaveat?
get() = if (hasOptionalCaveat()) getOptionalCaveat() else null
© 2015 - 2025 Weber Informatics LLC | Privacy Policy