All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.api.ResourceDescriptorKt.kt Maven / Gradle / Ivy

// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/api/resource.proto

// Generated files should ignore deprecation warnings
@file:Suppress("DEPRECATION")
package com.google.api;

@kotlin.jvm.JvmName("-initializeresourceDescriptor")
public inline fun resourceDescriptor(block: com.google.api.ResourceDescriptorKt.Dsl.() -> kotlin.Unit): com.google.api.ResourceDescriptor =
  com.google.api.ResourceDescriptorKt.Dsl._create(com.google.api.ResourceDescriptor.newBuilder()).apply { block() }._build()
/**
 * ```
 * A simple descriptor of a resource type.
 *
 * ResourceDescriptor annotates a resource message (either by means of a
 * protobuf annotation or use in the service config), and associates the
 * resource's schema, the resource type, and the pattern of the resource name.
 *
 * Example:
 *
 *     message Topic {
 *       // Indicates this message defines a resource schema.
 *       // Declares the resource type in the format of {service}/{kind}.
 *       // For Kubernetes resources, the format is {api group}/{kind}.
 *       option (google.api.resource) = {
 *         type: "pubsub.googleapis.com/Topic"
 *         name_descriptor: {
 *           pattern: "projects/{project}/topics/{topic}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Project"
 *           parent_name_extractor: "projects/{project}"
 *         }
 *       };
 *     }
 *
 * The ResourceDescriptor Yaml config will look like:
 *
 *     resources:
 *     - type: "pubsub.googleapis.com/Topic"
 *       name_descriptor:
 *         - pattern: "projects/{project}/topics/{topic}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Project"
 *           parent_name_extractor: "projects/{project}"
 *
 * Sometimes, resources have multiple patterns, typically because they can
 * live under multiple parents.
 *
 * Example:
 *
 *     message LogEntry {
 *       option (google.api.resource) = {
 *         type: "logging.googleapis.com/LogEntry"
 *         name_descriptor: {
 *           pattern: "projects/{project}/logs/{log}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Project"
 *           parent_name_extractor: "projects/{project}"
 *         }
 *         name_descriptor: {
 *           pattern: "folders/{folder}/logs/{log}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Folder"
 *           parent_name_extractor: "folders/{folder}"
 *         }
 *         name_descriptor: {
 *           pattern: "organizations/{organization}/logs/{log}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Organization"
 *           parent_name_extractor: "organizations/{organization}"
 *         }
 *         name_descriptor: {
 *           pattern: "billingAccounts/{billing_account}/logs/{log}"
 *           parent_type: "billing.googleapis.com/BillingAccount"
 *           parent_name_extractor: "billingAccounts/{billing_account}"
 *         }
 *       };
 *     }
 *
 * The ResourceDescriptor Yaml config will look like:
 *
 *     resources:
 *     - type: 'logging.googleapis.com/LogEntry'
 *       name_descriptor:
 *         - pattern: "projects/{project}/logs/{log}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Project"
 *           parent_name_extractor: "projects/{project}"
 *         - pattern: "folders/{folder}/logs/{log}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Folder"
 *           parent_name_extractor: "folders/{folder}"
 *         - pattern: "organizations/{organization}/logs/{log}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Organization"
 *           parent_name_extractor: "organizations/{organization}"
 *         - pattern: "billingAccounts/{billing_account}/logs/{log}"
 *           parent_type: "billing.googleapis.com/BillingAccount"
 *           parent_name_extractor: "billingAccounts/{billing_account}"
 *
 * For flexible resources, the resource name doesn't contain parent names, but
 * the resource itself has parents for policy evaluation.
 *
 * Example:
 *
 *     message Shelf {
 *       option (google.api.resource) = {
 *         type: "library.googleapis.com/Shelf"
 *         name_descriptor: {
 *           pattern: "shelves/{shelf}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Project"
 *         }
 *         name_descriptor: {
 *           pattern: "shelves/{shelf}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Folder"
 *         }
 *       };
 *     }
 *
 * The ResourceDescriptor Yaml config will look like:
 *
 *     resources:
 *     - type: 'library.googleapis.com/Shelf'
 *       name_descriptor:
 *         - pattern: "shelves/{shelf}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Project"
 *         - pattern: "shelves/{shelf}"
 *           parent_type: "cloudresourcemanager.googleapis.com/Folder"
 * ```
 *
 * Protobuf type `google.api.ResourceDescriptor`
 */
public object ResourceDescriptorKt {
  @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
  @com.google.protobuf.kotlin.ProtoDslMarker
  public class Dsl private constructor(
    private val _builder: com.google.api.ResourceDescriptor.Builder
  ) {
    public companion object {
      @kotlin.jvm.JvmSynthetic
      @kotlin.PublishedApi
      internal fun _create(builder: com.google.api.ResourceDescriptor.Builder): Dsl = Dsl(builder)
    }

    @kotlin.jvm.JvmSynthetic
    @kotlin.PublishedApi
    internal fun _build(): com.google.api.ResourceDescriptor = _builder.build()

    /**
     * ```
     * The resource type. It must be in the format of
     * {service_name}/{resource_type_kind}. The `resource_type_kind` must be
     * singular and must not include version numbers.
     *
     * Example: `storage.googleapis.com/Bucket`
     *
     * The value of the resource_type_kind must follow the regular expression
     * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
     * should use PascalCase (UpperCamelCase). The maximum number of
     * characters allowed for the `resource_type_kind` is 100.
     * ```
     *
     * `string type = 1;`
     */
    public var type: kotlin.String
      @JvmName("getType")
      get() = _builder.getType()
      @JvmName("setType")
      set(value) {
        _builder.setType(value)
      }
    /**
     * ```
     * The resource type. It must be in the format of
     * {service_name}/{resource_type_kind}. The `resource_type_kind` must be
     * singular and must not include version numbers.
     *
     * Example: `storage.googleapis.com/Bucket`
     *
     * The value of the resource_type_kind must follow the regular expression
     * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
     * should use PascalCase (UpperCamelCase). The maximum number of
     * characters allowed for the `resource_type_kind` is 100.
     * ```
     *
     * `string type = 1;`
     */
    public fun clearType() {
      _builder.clearType()
    }

    /**
     * An uninstantiable, behaviorless type to represent the field in
     * generics.
     */
    @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
    public class PatternProxy private constructor() : com.google.protobuf.kotlin.DslProxy()
    /**
     * ```
     * Optional. The relative resource name pattern associated with this resource
     * type. The DNS prefix of the full resource name shouldn't be specified here.
     *
     * The path pattern must follow the syntax, which aligns with HTTP binding
     * syntax:
     *
     *     Template = Segment { "/" Segment } ;
     *     Segment = LITERAL | Variable ;
     *     Variable = "{" LITERAL "}" ;
     *
     * Examples:
     *
     *     - "projects/{project}/topics/{topic}"
     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
     *
     * The components in braces correspond to the IDs for each resource in the
     * hierarchy. It is expected that, if multiple patterns are provided,
     * the same component name (e.g. "project") refers to IDs of the same
     * type of resource.
     * ```
     *
     * `repeated string pattern = 2;`
     * @return A list containing the pattern.
     */
    public val pattern: com.google.protobuf.kotlin.DslList
      @kotlin.jvm.JvmSynthetic
      get() = com.google.protobuf.kotlin.DslList(
        _builder.getPatternList()
      )
    /**
     * ```
     * Optional. The relative resource name pattern associated with this resource
     * type. The DNS prefix of the full resource name shouldn't be specified here.
     *
     * The path pattern must follow the syntax, which aligns with HTTP binding
     * syntax:
     *
     *     Template = Segment { "/" Segment } ;
     *     Segment = LITERAL | Variable ;
     *     Variable = "{" LITERAL "}" ;
     *
     * Examples:
     *
     *     - "projects/{project}/topics/{topic}"
     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
     *
     * The components in braces correspond to the IDs for each resource in the
     * hierarchy. It is expected that, if multiple patterns are provided,
     * the same component name (e.g. "project") refers to IDs of the same
     * type of resource.
     * ```
     *
     * `repeated string pattern = 2;`
     * @param value The pattern to add.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("addPattern")
    public fun com.google.protobuf.kotlin.DslList.add(value: kotlin.String) {
      _builder.addPattern(value)
    }
    /**
     * ```
     * Optional. The relative resource name pattern associated with this resource
     * type. The DNS prefix of the full resource name shouldn't be specified here.
     *
     * The path pattern must follow the syntax, which aligns with HTTP binding
     * syntax:
     *
     *     Template = Segment { "/" Segment } ;
     *     Segment = LITERAL | Variable ;
     *     Variable = "{" LITERAL "}" ;
     *
     * Examples:
     *
     *     - "projects/{project}/topics/{topic}"
     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
     *
     * The components in braces correspond to the IDs for each resource in the
     * hierarchy. It is expected that, if multiple patterns are provided,
     * the same component name (e.g. "project") refers to IDs of the same
     * type of resource.
     * ```
     *
     * `repeated string pattern = 2;`
     * @param value The pattern to add.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("plusAssignPattern")
    @Suppress("NOTHING_TO_INLINE")
    public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: kotlin.String) {
      add(value)
    }
    /**
     * ```
     * Optional. The relative resource name pattern associated with this resource
     * type. The DNS prefix of the full resource name shouldn't be specified here.
     *
     * The path pattern must follow the syntax, which aligns with HTTP binding
     * syntax:
     *
     *     Template = Segment { "/" Segment } ;
     *     Segment = LITERAL | Variable ;
     *     Variable = "{" LITERAL "}" ;
     *
     * Examples:
     *
     *     - "projects/{project}/topics/{topic}"
     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
     *
     * The components in braces correspond to the IDs for each resource in the
     * hierarchy. It is expected that, if multiple patterns are provided,
     * the same component name (e.g. "project") refers to IDs of the same
     * type of resource.
     * ```
     *
     * `repeated string pattern = 2;`
     * @param values The pattern to add.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("addAllPattern")
    public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) {
      _builder.addAllPattern(values)
    }
    /**
     * ```
     * Optional. The relative resource name pattern associated with this resource
     * type. The DNS prefix of the full resource name shouldn't be specified here.
     *
     * The path pattern must follow the syntax, which aligns with HTTP binding
     * syntax:
     *
     *     Template = Segment { "/" Segment } ;
     *     Segment = LITERAL | Variable ;
     *     Variable = "{" LITERAL "}" ;
     *
     * Examples:
     *
     *     - "projects/{project}/topics/{topic}"
     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
     *
     * The components in braces correspond to the IDs for each resource in the
     * hierarchy. It is expected that, if multiple patterns are provided,
     * the same component name (e.g. "project") refers to IDs of the same
     * type of resource.
     * ```
     *
     * `repeated string pattern = 2;`
     * @param values The pattern to add.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("plusAssignAllPattern")
    @Suppress("NOTHING_TO_INLINE")
    public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) {
      addAll(values)
    }
    /**
     * ```
     * Optional. The relative resource name pattern associated with this resource
     * type. The DNS prefix of the full resource name shouldn't be specified here.
     *
     * The path pattern must follow the syntax, which aligns with HTTP binding
     * syntax:
     *
     *     Template = Segment { "/" Segment } ;
     *     Segment = LITERAL | Variable ;
     *     Variable = "{" LITERAL "}" ;
     *
     * Examples:
     *
     *     - "projects/{project}/topics/{topic}"
     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
     *
     * The components in braces correspond to the IDs for each resource in the
     * hierarchy. It is expected that, if multiple patterns are provided,
     * the same component name (e.g. "project") refers to IDs of the same
     * type of resource.
     * ```
     *
     * `repeated string pattern = 2;`
     * @param index The index to set the value at.
     * @param value The pattern to set.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("setPattern")
    public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: kotlin.String) {
      _builder.setPattern(index, value)
    }/**
     * ```
     * Optional. The relative resource name pattern associated with this resource
     * type. The DNS prefix of the full resource name shouldn't be specified here.
     *
     * The path pattern must follow the syntax, which aligns with HTTP binding
     * syntax:
     *
     *     Template = Segment { "/" Segment } ;
     *     Segment = LITERAL | Variable ;
     *     Variable = "{" LITERAL "}" ;
     *
     * Examples:
     *
     *     - "projects/{project}/topics/{topic}"
     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
     *
     * The components in braces correspond to the IDs for each resource in the
     * hierarchy. It is expected that, if multiple patterns are provided,
     * the same component name (e.g. "project") refers to IDs of the same
     * type of resource.
     * ```
     *
     * `repeated string pattern = 2;`
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("clearPattern")
    public fun com.google.protobuf.kotlin.DslList.clear() {
      _builder.clearPattern()
    }
    /**
     * ```
     * Optional. The field on the resource that designates the resource name
     * field. If omitted, this is assumed to be "name".
     * ```
     *
     * `string name_field = 3;`
     */
    public var nameField: kotlin.String
      @JvmName("getNameField")
      get() = _builder.getNameField()
      @JvmName("setNameField")
      set(value) {
        _builder.setNameField(value)
      }
    /**
     * ```
     * Optional. The field on the resource that designates the resource name
     * field. If omitted, this is assumed to be "name".
     * ```
     *
     * `string name_field = 3;`
     */
    public fun clearNameField() {
      _builder.clearNameField()
    }

    /**
     * ```
     * Optional. The historical or future-looking state of the resource pattern.
     *
     * Example:
     *
     *     // The InspectTemplate message originally only supported resource
     *     // names with organization, and project was added later.
     *     message InspectTemplate {
     *       option (google.api.resource) = {
     *         type: "dlp.googleapis.com/InspectTemplate"
     *         pattern:
     *         "organizations/{organization}/inspectTemplates/{inspect_template}"
     *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
     *         history: ORIGINALLY_SINGLE_PATTERN
     *       };
     *     }
     * ```
     *
     * `.google.api.ResourceDescriptor.History history = 4;`
     */
    public var history: com.google.api.ResourceDescriptor.History
      @JvmName("getHistory")
      get() = _builder.getHistory()
      @JvmName("setHistory")
      set(value) {
        _builder.setHistory(value)
      }
    public var historyValue: kotlin.Int
      @JvmName("getHistoryValue")
      get() = _builder.getHistoryValue()
      @JvmName("setHistoryValue")
      set(value) {
        _builder.setHistoryValue(value)
      }
    /**
     * ```
     * Optional. The historical or future-looking state of the resource pattern.
     *
     * Example:
     *
     *     // The InspectTemplate message originally only supported resource
     *     // names with organization, and project was added later.
     *     message InspectTemplate {
     *       option (google.api.resource) = {
     *         type: "dlp.googleapis.com/InspectTemplate"
     *         pattern:
     *         "organizations/{organization}/inspectTemplates/{inspect_template}"
     *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
     *         history: ORIGINALLY_SINGLE_PATTERN
     *       };
     *     }
     * ```
     *
     * `.google.api.ResourceDescriptor.History history = 4;`
     */
    public fun clearHistory() {
      _builder.clearHistory()
    }

    /**
     * ```
     * The plural name used in the resource name and permission names, such as
     * 'projects' for the resource name of 'projects/{project}' and the permission
     * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
     * concept of the `plural` field in k8s CRD spec
     * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
     *
     * Note: The plural form is required even for singleton resources. See
     * https://aip.dev/156
     * ```
     *
     * `string plural = 5;`
     */
    public var plural: kotlin.String
      @JvmName("getPlural")
      get() = _builder.getPlural()
      @JvmName("setPlural")
      set(value) {
        _builder.setPlural(value)
      }
    /**
     * ```
     * The plural name used in the resource name and permission names, such as
     * 'projects' for the resource name of 'projects/{project}' and the permission
     * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
     * concept of the `plural` field in k8s CRD spec
     * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
     *
     * Note: The plural form is required even for singleton resources. See
     * https://aip.dev/156
     * ```
     *
     * `string plural = 5;`
     */
    public fun clearPlural() {
      _builder.clearPlural()
    }

    /**
     * ```
     * The same concept of the `singular` field in k8s CRD spec
     * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
     * Such as "project" for the `resourcemanager.googleapis.com/Project` type.
     * ```
     *
     * `string singular = 6;`
     */
    public var singular: kotlin.String
      @JvmName("getSingular")
      get() = _builder.getSingular()
      @JvmName("setSingular")
      set(value) {
        _builder.setSingular(value)
      }
    /**
     * ```
     * The same concept of the `singular` field in k8s CRD spec
     * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
     * Such as "project" for the `resourcemanager.googleapis.com/Project` type.
     * ```
     *
     * `string singular = 6;`
     */
    public fun clearSingular() {
      _builder.clearSingular()
    }

    /**
     * An uninstantiable, behaviorless type to represent the field in
     * generics.
     */
    @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
    public class StyleProxy private constructor() : com.google.protobuf.kotlin.DslProxy()
    /**
     * ```
     * Style flag(s) for this resource.
     * These indicate that a resource is expected to conform to a given
     * style. See the specific style flags for additional information.
     * ```
     *
     * `repeated .google.api.ResourceDescriptor.Style style = 10;`
     */
    public val style: com.google.protobuf.kotlin.DslList
      @kotlin.jvm.JvmSynthetic
      get() = com.google.protobuf.kotlin.DslList(
        _builder.getStyleList()
      )
    /**
     * ```
     * Style flag(s) for this resource.
     * These indicate that a resource is expected to conform to a given
     * style. See the specific style flags for additional information.
     * ```
     *
     * `repeated .google.api.ResourceDescriptor.Style style = 10;`
     * @param value The style to add.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("addStyle")
    public fun com.google.protobuf.kotlin.DslList.add(value: com.google.api.ResourceDescriptor.Style) {
      _builder.addStyle(value)
    }/**
     * ```
     * Style flag(s) for this resource.
     * These indicate that a resource is expected to conform to a given
     * style. See the specific style flags for additional information.
     * ```
     *
     * `repeated .google.api.ResourceDescriptor.Style style = 10;`
     * @param value The style to add.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("plusAssignStyle")
    @Suppress("NOTHING_TO_INLINE")
    public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: com.google.api.ResourceDescriptor.Style) {
      add(value)
    }/**
     * ```
     * Style flag(s) for this resource.
     * These indicate that a resource is expected to conform to a given
     * style. See the specific style flags for additional information.
     * ```
     *
     * `repeated .google.api.ResourceDescriptor.Style style = 10;`
     * @param values The style to add.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("addAllStyle")
    public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) {
      _builder.addAllStyle(values)
    }/**
     * ```
     * Style flag(s) for this resource.
     * These indicate that a resource is expected to conform to a given
     * style. See the specific style flags for additional information.
     * ```
     *
     * `repeated .google.api.ResourceDescriptor.Style style = 10;`
     * @param values The style to add.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("plusAssignAllStyle")
    @Suppress("NOTHING_TO_INLINE")
    public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) {
      addAll(values)
    }/**
     * ```
     * Style flag(s) for this resource.
     * These indicate that a resource is expected to conform to a given
     * style. See the specific style flags for additional information.
     * ```
     *
     * `repeated .google.api.ResourceDescriptor.Style style = 10;`
     * @param index The index to set the value at.
     * @param value The style to set.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("setStyle")
    public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: com.google.api.ResourceDescriptor.Style) {
      _builder.setStyle(index, value)
    }/**
     * ```
     * Style flag(s) for this resource.
     * These indicate that a resource is expected to conform to a given
     * style. See the specific style flags for additional information.
     * ```
     *
     * `repeated .google.api.ResourceDescriptor.Style style = 10;`
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("clearStyle")
    public fun com.google.protobuf.kotlin.DslList.clear() {
      _builder.clearStyle()
    }}
}
@kotlin.jvm.JvmSynthetic
public inline fun com.google.api.ResourceDescriptor.copy(block: `com.google.api`.ResourceDescriptorKt.Dsl.() -> kotlin.Unit): com.google.api.ResourceDescriptor =
  `com.google.api`.ResourceDescriptorKt.Dsl._create(this.toBuilder()).apply { block() }._build()





© 2015 - 2024 Weber Informatics LLC | Privacy Policy