Class ResourceDescriptor.Builder (2.46.0)

public static final class ResourceDescriptor.Builder extends GeneratedMessageV3.Builder<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

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllPattern(Iterable<String> values)

public ResourceDescriptor.Builder addAllPattern(Iterable<String> 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;

Parameter
Name Description
values Iterable<String>

The pattern to add.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

addAllStyle(Iterable<? extends ResourceDescriptor.Style> values)

public ResourceDescriptor.Builder addAllStyle(Iterable<? extends ResourceDescriptor.Style> 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;

Parameter
Name Description
values Iterable<? extends com.google.api.ResourceDescriptor.Style>

The style to add.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

addAllStyleValue(Iterable<Integer> values)

public ResourceDescriptor.Builder addAllStyleValue(Iterable<Integer> 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;

Parameter
Name Description
values Iterable<Integer>

The enum numeric values on the wire for style to add.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

addPattern(String value)

public ResourceDescriptor.Builder addPattern(String 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;

Parameter
Name Description
value String

The pattern to add.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

addPatternBytes(ByteString value)

public ResourceDescriptor.Builder addPatternBytes(ByteString 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;

Parameter
Name Description
value ByteString

The bytes of the pattern to add.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public ResourceDescriptor.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ResourceDescriptor.Builder
Overrides

addStyle(ResourceDescriptor.Style value)

public ResourceDescriptor.Builder addStyle(ResourceDescriptor.Style 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;

Parameter
Name Description
value ResourceDescriptor.Style

The style to add.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

addStyleValue(int value)

public ResourceDescriptor.Builder addStyleValue(int 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;

Parameter
Name Description
value int

The enum numeric value on the wire for style to add.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

build()

public ResourceDescriptor build()
Returns
Type Description
ResourceDescriptor

buildPartial()

public ResourceDescriptor buildPartial()
Returns
Type Description
ResourceDescriptor

clear()

public ResourceDescriptor.Builder clear()
Returns
Type Description
ResourceDescriptor.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public ResourceDescriptor.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
ResourceDescriptor.Builder
Overrides

clearHistory()

public ResourceDescriptor.Builder clearHistory()

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;

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

clearNameField()

public ResourceDescriptor.Builder clearNameField()

Optional. The field on the resource that designates the resource name field. If omitted, this is assumed to be "name".

string name_field = 3;

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public ResourceDescriptor.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
ResourceDescriptor.Builder
Overrides

clearPattern()

public ResourceDescriptor.Builder clearPattern()

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;

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

clearPlural()

public ResourceDescriptor.Builder clearPlural()

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, 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;

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

clearSingular()

public ResourceDescriptor.Builder clearSingular()

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;

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

clearStyle()

public ResourceDescriptor.Builder clearStyle()

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;

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

clearType()

public ResourceDescriptor.Builder clearType()

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+/. 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;

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

clone()

public ResourceDescriptor.Builder clone()
Returns
Type Description
ResourceDescriptor.Builder
Overrides

getDefaultInstanceForType()

public ResourceDescriptor getDefaultInstanceForType()
Returns
Type Description
ResourceDescriptor

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

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;

Returns
Type Description
ResourceDescriptor.History

The history.

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;

Returns
Type Description
int

The enum numeric value on the wire for history.

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;

Returns
Type Description
String

The nameField.

getNameFieldBytes()

public 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;

Returns
Type Description
ByteString

The bytes for nameField.

getPattern(int index)

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;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The pattern at the given index.

getPatternBytes(int index)

public 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;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the pattern at the given index.

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;

Returns
Type Description
int

The count of pattern.

getPatternList()

public ProtocolStringList 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;

Returns
Type Description
ProtocolStringList

A list containing the pattern.

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, 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;

Returns
Type Description
String

The plural.

getPluralBytes()

public 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, 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;

Returns
Type Description
ByteString

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;

Returns
Type Description
String

The singular.

getSingularBytes()

public 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;

Returns
Type Description
ByteString

The bytes for singular.

getStyle(int index)

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;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
ResourceDescriptor.Style

The style at the given index.

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;

Returns
Type Description
int

The count of style.

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;

Returns
Type Description
List<Style>

A list containing the style.

getStyleValue(int index)

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;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
int

The enum numeric value on the wire of 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;

Returns
Type Description
List<Integer>

A list containing the enum numeric values on the wire for style.

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+/. 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;

Returns
Type Description
String

The type.

getTypeBytes()

public 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+/. 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;

Returns
Type Description
ByteString

The bytes for type.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(ResourceDescriptor other)

public ResourceDescriptor.Builder mergeFrom(ResourceDescriptor other)
Parameter
Name Description
other ResourceDescriptor
Returns
Type Description
ResourceDescriptor.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public ResourceDescriptor.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ResourceDescriptor.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public ResourceDescriptor.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
ResourceDescriptor.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final ResourceDescriptor.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ResourceDescriptor.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public ResourceDescriptor.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ResourceDescriptor.Builder
Overrides

setHistory(ResourceDescriptor.History value)

public ResourceDescriptor.Builder setHistory(ResourceDescriptor.History 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;

Parameter
Name Description
value ResourceDescriptor.History

The history to set.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

setHistoryValue(int value)

public ResourceDescriptor.Builder setHistoryValue(int 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;

Parameter
Name Description
value int

The enum numeric value on the wire for history to set.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

setNameField(String value)

public ResourceDescriptor.Builder setNameField(String 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;

Parameter
Name Description
value String

The nameField to set.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

setNameFieldBytes(ByteString value)

public ResourceDescriptor.Builder setNameFieldBytes(ByteString 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;

Parameter
Name Description
value ByteString

The bytes for nameField to set.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

setPattern(int index, String value)

public ResourceDescriptor.Builder setPattern(int index, String 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;

Parameters
Name Description
index int

The index to set the value at.

value String

The pattern to set.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

setPlural(String value)

public ResourceDescriptor.Builder setPlural(String 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'. One exception to this is for Nested Collections that have stuttering names, as defined in AIP-122, 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;

Parameter
Name Description
value String

The plural to set.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

setPluralBytes(ByteString value)

public ResourceDescriptor.Builder setPluralBytes(ByteString 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'. One exception to this is for Nested Collections that have stuttering names, as defined in AIP-122, 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;

Parameter
Name Description
value ByteString

The bytes for plural to set.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public ResourceDescriptor.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
ResourceDescriptor.Builder
Overrides

setSingular(String value)

public ResourceDescriptor.Builder setSingular(String 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;

Parameter
Name Description
value String

The singular to set.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

setSingularBytes(ByteString value)

public ResourceDescriptor.Builder setSingularBytes(ByteString 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;

Parameter
Name Description
value ByteString

The bytes for singular to set.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

setStyle(int index, ResourceDescriptor.Style value)

public ResourceDescriptor.Builder setStyle(int index, ResourceDescriptor.Style 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;

Parameters
Name Description
index int

The index to set the value at.

value ResourceDescriptor.Style

The style to set.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

setStyleValue(int index, int value)

public ResourceDescriptor.Builder setStyleValue(int index, int 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;

Parameters
Name Description
index int

The index to set the value at.

value int

The enum numeric value on the wire for style to set.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

setType(String value)

public ResourceDescriptor.Builder setType(String 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+/. 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;

Parameter
Name Description
value String

The type to set.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

setTypeBytes(ByteString value)

public ResourceDescriptor.Builder setTypeBytes(ByteString 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+/. 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;

Parameter
Name Description
value ByteString

The bytes for type to set.

Returns
Type Description
ResourceDescriptor.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final ResourceDescriptor.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ResourceDescriptor.Builder
Overrides