Class ResourceDescriptor

java.lang.Object
com.google.protobuf.AbstractMessageLite<MessageType,BuilderType>
com.google.protobuf.GeneratedMessageLite<ResourceDescriptor,ResourceDescriptor.Builder>
com.google.api.ResourceDescriptor
All Implemented Interfaces:
ResourceDescriptorOrBuilder, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder

public final class ResourceDescriptor extends com.google.protobuf.GeneratedMessageLite<ResourceDescriptor,ResourceDescriptor.Builder> implements ResourceDescriptorOrBuilder
 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"
 pattern: "projects/{project}/topics/{topic}"
 };
 }

 The ResourceDescriptor Yaml config will look like:

 resources:
 - type: "pubsub.googleapis.com/Topic"
 pattern: "projects/{project}/topics/{topic}"

 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"
 pattern: "projects/{project}/logs/{log}"
 pattern: "folders/{folder}/logs/{log}"
 pattern: "organizations/{organization}/logs/{log}"
 pattern: "billingAccounts/{billing_account}/logs/{log}"
 };
 }

 The ResourceDescriptor Yaml config will look like:

 resources:
 - type: 'logging.googleapis.com/LogEntry'
 pattern: "projects/{project}/logs/{log}"
 pattern: "folders/{folder}/logs/{log}"
 pattern: "organizations/{organization}/logs/{log}"
 pattern: "billingAccounts/{billing_account}/logs/{log}"
 
Protobuf type google.api.ResourceDescriptor
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A simple descriptor of a resource type.
    static enum 
    A description of the historical or future-looking state of the resource pattern.
    static enum 
    A flag representing a specific style that a resource claims to conform to.

    Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageLite

    com.google.protobuf.GeneratedMessageLite.DefaultInstanceBasedParser<T extends com.google.protobuf.GeneratedMessageLite<T,?>>, com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageLite.GeneratedExtension<ContainingType extends com.google.protobuf.MessageLite,Type extends Object>, com.google.protobuf.GeneratedMessageLite.MethodToInvoke, com.google.protobuf.GeneratedMessageLite.SerializedForm

    Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite

    com.google.protobuf.AbstractMessageLite.InternalOneOfEnum
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     

    Fields inherited from class com.google.protobuf.GeneratedMessageLite

    unknownFields

    Fields inherited from class com.google.protobuf.AbstractMessageLite

    memoizedHashCode
  • Method Summary

    Modifier and Type
    Method
    Description
    protected final Object
    dynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1)
     
     
    Optional.
    int
    Optional.
    Optional.
    com.google.protobuf.ByteString
    Optional.
    getPattern(int index)
    Optional.
    com.google.protobuf.ByteString
    getPatternBytes(int index)
    Optional.
    int
    Optional.
    Optional.
    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'.
    com.google.protobuf.ByteString
    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'.
    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.
    com.google.protobuf.ByteString
    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.
    getStyle(int index)
    Style flag(s) for this resource.
    int
    Style flag(s) for this resource.
    Style flag(s) for this resource.
    int
    getStyleValue(int index)
    Style flag(s) for this resource.
    Style flag(s) for this resource.
    The resource type.
    com.google.protobuf.ByteString
    The resource type.
     
     
     
    parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    parseFrom(byte[] data)
     
    parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    parseFrom(com.google.protobuf.ByteString data)
     
    parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    parseFrom(com.google.protobuf.CodedInputStream input)
     
    parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
     
    parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
     
    parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static com.google.protobuf.Parser<ResourceDescriptor>
     

    Methods inherited from class com.google.protobuf.GeneratedMessageLite

    createBuilder, createBuilder, dynamicMethod, dynamicMethod, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, emptyProtobufList, equals, getDefaultInstanceForType, getParserForType, getSerializedSize, hashCode, isInitialized, isInitialized, makeImmutable, mergeLengthDelimitedField, mergeUnknownFields, mergeVarintField, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBuilderForType, newMessageInfo, newRepeatedGeneratedExtension, newSingularGeneratedExtension, parseDelimitedFrom, parseDelimitedFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parsePartialFrom, parseUnknownField, registerDefaultInstance, toBuilder, toString, writeTo

    Methods inherited from class com.google.protobuf.AbstractMessageLite

    addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder

    getDefaultInstanceForType, isInitialized
  • Field Details

  • Method Details

    • getType

      public String getType()
       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 [json_name = "type"];
      Specified by:
      getType in interface ResourceDescriptorOrBuilder
      Returns:
      The type.
    • getTypeBytes

      public com.google.protobuf.ByteString getTypeBytes()
       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 [json_name = "type"];
      Specified by:
      getTypeBytes in interface ResourceDescriptorOrBuilder
      Returns:
      The bytes for type.
    • getPatternList

      public List<String> 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 [json_name = "pattern"];
      Specified by:
      getPatternList in interface ResourceDescriptorOrBuilder
      Returns:
      A list containing the pattern.
    • getPatternCount

      public int getPatternCount()
       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 [json_name = "pattern"];
      Specified by:
      getPatternCount in interface ResourceDescriptorOrBuilder
      Returns:
      The count of pattern.
    • getPattern

      public String getPattern(int index)
       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 [json_name = "pattern"];
      Specified by:
      getPattern in interface ResourceDescriptorOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The pattern at the given index.
    • getPatternBytes

      public com.google.protobuf.ByteString getPatternBytes(int index)
       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 [json_name = "pattern"];
      Specified by:
      getPatternBytes in interface ResourceDescriptorOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the pattern at the given index.
    • getNameField

      public String getNameField()
       Optional. The field on the resource that designates the resource name
       field. If omitted, this is assumed to be "name".
       
      string name_field = 3 [json_name = "nameField"];
      Specified by:
      getNameField in interface ResourceDescriptorOrBuilder
      Returns:
      The nameField.
    • getNameFieldBytes

      public com.google.protobuf.ByteString getNameFieldBytes()
       Optional. The field on the resource that designates the resource name
       field. If omitted, this is assumed to be "name".
       
      string name_field = 3 [json_name = "nameField"];
      Specified by:
      getNameFieldBytes in interface ResourceDescriptorOrBuilder
      Returns:
      The bytes for nameField.
    • getHistoryValue

      public int getHistoryValue()
       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 [json_name = "history"];
      Specified by:
      getHistoryValue in interface ResourceDescriptorOrBuilder
      Returns:
      The enum numeric value on the wire for history.
    • getHistory

      public ResourceDescriptor.History getHistory()
       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 [json_name = "history"];
      Specified by:
      getHistory in interface ResourceDescriptorOrBuilder
      Returns:
      The history.
    • getPlural

      public String getPlural()
       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'. One exception
       to this is for Nested Collections that have stuttering names, as defined
       in [AIP-122](https://google.aip.dev/122#nested-collections), where the
       collection ID in the resource name pattern does not necessarily directly
       match the `plural` value.
      
       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 [json_name = "plural"];
      Specified by:
      getPlural in interface ResourceDescriptorOrBuilder
      Returns:
      The plural.
    • getPluralBytes

      public com.google.protobuf.ByteString getPluralBytes()
       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'. One exception
       to this is for Nested Collections that have stuttering names, as defined
       in [AIP-122](https://google.aip.dev/122#nested-collections), where the
       collection ID in the resource name pattern does not necessarily directly
       match the `plural` value.
      
       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 [json_name = "plural"];
      Specified by:
      getPluralBytes in interface ResourceDescriptorOrBuilder
      Returns:
      The bytes for plural.
    • getSingular

      public String getSingular()
       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 [json_name = "singular"];
      Specified by:
      getSingular in interface ResourceDescriptorOrBuilder
      Returns:
      The singular.
    • getSingularBytes

      public com.google.protobuf.ByteString getSingularBytes()
       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 [json_name = "singular"];
      Specified by:
      getSingularBytes in interface ResourceDescriptorOrBuilder
      Returns:
      The bytes for singular.
    • getStyleList

      public List<ResourceDescriptor.Style> 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 [json_name = "style"];
      Specified by:
      getStyleList in interface ResourceDescriptorOrBuilder
      Returns:
      A list containing the style.
    • getStyleCount

      public int getStyleCount()
       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 [json_name = "style"];
      Specified by:
      getStyleCount in interface ResourceDescriptorOrBuilder
      Returns:
      The count of style.
    • getStyle

      public ResourceDescriptor.Style getStyle(int index)
       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 [json_name = "style"];
      Specified by:
      getStyle in interface ResourceDescriptorOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The style at the given index.
    • getStyleValueList

      public List<Integer> getStyleValueList()
       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 [json_name = "style"];
      Specified by:
      getStyleValueList in interface ResourceDescriptorOrBuilder
      Returns:
      A list containing the enum numeric values on the wire for style.
    • getStyleValue

      public int getStyleValue(int index)
       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 [json_name = "style"];
      Specified by:
      getStyleValue in interface ResourceDescriptorOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The enum numeric value on the wire of style at the given index.
    • parseFrom

      public static ResourceDescriptor parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static ResourceDescriptor parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static ResourceDescriptor parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static ResourceDescriptor parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static ResourceDescriptor parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static ResourceDescriptor parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static ResourceDescriptor parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static ResourceDescriptor parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static ResourceDescriptor parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static ResourceDescriptor parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static ResourceDescriptor parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static ResourceDescriptor parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilder

      public static ResourceDescriptor.Builder newBuilder()
    • newBuilder

      public static ResourceDescriptor.Builder newBuilder(ResourceDescriptor prototype)
    • dynamicMethod

      protected final Object dynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1)
      Specified by:
      dynamicMethod in class com.google.protobuf.GeneratedMessageLite<ResourceDescriptor,ResourceDescriptor.Builder>
    • getDefaultInstance

      public static ResourceDescriptor getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<ResourceDescriptor> parser()