public static final class ResourceDescriptor.Builder extends com.google.protobuf.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}"
};
}
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: "organizations/{organization}/logs/{log}"
pattern: "folders/{folder}/logs/{log}"
pattern: "billingAccounts/{billing_account}/logs/{log}"
};
}
Protobuf type google.api.ResourceDescriptor| Modifier and Type | Method and Description |
|---|---|
ResourceDescriptor.Builder |
addAllPattern(Iterable<String> values)
Required.
|
ResourceDescriptor.Builder |
addPattern(String value)
Required.
|
ResourceDescriptor.Builder |
addPatternBytes(com.google.protobuf.ByteString value)
Required.
|
ResourceDescriptor.Builder |
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
ResourceDescriptor |
build() |
ResourceDescriptor |
buildPartial() |
ResourceDescriptor.Builder |
clear() |
ResourceDescriptor.Builder |
clearField(com.google.protobuf.Descriptors.FieldDescriptor field) |
ResourceDescriptor.Builder |
clearHistory()
Optional.
|
ResourceDescriptor.Builder |
clearNameField()
Optional.
|
ResourceDescriptor.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) |
ResourceDescriptor.Builder |
clearPattern()
Required.
|
ResourceDescriptor.Builder |
clearType()
The full name of the resource type.
|
ResourceDescriptor.Builder |
clone() |
ResourceDescriptor |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
ResourceDescriptor.History |
getHistory()
Optional.
|
int |
getHistoryValue()
Optional.
|
String |
getNameField()
Optional.
|
com.google.protobuf.ByteString |
getNameFieldBytes()
Optional.
|
String |
getPattern(int index)
Required.
|
com.google.protobuf.ByteString |
getPatternBytes(int index)
Required.
|
int |
getPatternCount()
Required.
|
com.google.protobuf.ProtocolStringList |
getPatternList()
Required.
|
String |
getType()
The full name of the resource type.
|
com.google.protobuf.ByteString |
getTypeBytes()
The full name of the resource type.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
ResourceDescriptor.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
ResourceDescriptor.Builder |
mergeFrom(com.google.protobuf.Message other) |
ResourceDescriptor.Builder |
mergeFrom(ResourceDescriptor other) |
ResourceDescriptor.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
ResourceDescriptor.Builder |
setField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
ResourceDescriptor.Builder |
setHistory(ResourceDescriptor.History value)
Optional.
|
ResourceDescriptor.Builder |
setHistoryValue(int value)
Optional.
|
ResourceDescriptor.Builder |
setNameField(String value)
Optional.
|
ResourceDescriptor.Builder |
setNameFieldBytes(com.google.protobuf.ByteString value)
Optional.
|
ResourceDescriptor.Builder |
setPattern(int index,
String value)
Required.
|
ResourceDescriptor.Builder |
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
Object value) |
ResourceDescriptor.Builder |
setType(String value)
The full name of the resource type.
|
ResourceDescriptor.Builder |
setTypeBytes(com.google.protobuf.ByteString value)
The full name of the resource type.
|
ResourceDescriptor.Builder |
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<ResourceDescriptor.Builder>public ResourceDescriptor.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessageV3.Builder<ResourceDescriptor.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<ResourceDescriptor.Builder>public ResourceDescriptor getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic ResourceDescriptor build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic ResourceDescriptor buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic ResourceDescriptor.Builder clone()
clone in interface com.google.protobuf.Message.Builderclone in interface com.google.protobuf.MessageLite.Builderclone in class com.google.protobuf.GeneratedMessageV3.Builder<ResourceDescriptor.Builder>public ResourceDescriptor.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
setField in interface com.google.protobuf.Message.BuildersetField in class com.google.protobuf.GeneratedMessageV3.Builder<ResourceDescriptor.Builder>public ResourceDescriptor.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField in interface com.google.protobuf.Message.BuilderclearField in class com.google.protobuf.GeneratedMessageV3.Builder<ResourceDescriptor.Builder>public ResourceDescriptor.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof in interface com.google.protobuf.Message.BuilderclearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<ResourceDescriptor.Builder>public ResourceDescriptor.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField in interface com.google.protobuf.Message.BuildersetRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<ResourceDescriptor.Builder>public ResourceDescriptor.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField in interface com.google.protobuf.Message.BuilderaddRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<ResourceDescriptor.Builder>public ResourceDescriptor.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<ResourceDescriptor.Builder>public ResourceDescriptor.Builder mergeFrom(ResourceDescriptor other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<ResourceDescriptor.Builder>public ResourceDescriptor.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<ResourceDescriptor.Builder>IOExceptionpublic String getType()
The full name of the resource type. It must be in the format of
{service_name}/{resource_type_kind}. The resource type names are
singular and do not contain version numbers.
For example: `storage.googleapis.com/Bucket`
The value of the resource_type_kind must follow the regular expression
/[A-Z][a-zA-Z0-9]+/. It must start with upper case character and
recommended to use PascalCase (UpperCamelCase). The maximum number of
characters allowed for the resource_type_kind is 100.
string type = 1;getType in interface ResourceDescriptorOrBuilderpublic com.google.protobuf.ByteString getTypeBytes()
The full name of the resource type. It must be in the format of
{service_name}/{resource_type_kind}. The resource type names are
singular and do not contain version numbers.
For example: `storage.googleapis.com/Bucket`
The value of the resource_type_kind must follow the regular expression
/[A-Z][a-zA-Z0-9]+/. It must start with upper case character and
recommended to use PascalCase (UpperCamelCase). The maximum number of
characters allowed for the resource_type_kind is 100.
string type = 1;getTypeBytes in interface ResourceDescriptorOrBuilderpublic ResourceDescriptor.Builder setType(String value)
The full name of the resource type. It must be in the format of
{service_name}/{resource_type_kind}. The resource type names are
singular and do not contain version numbers.
For example: `storage.googleapis.com/Bucket`
The value of the resource_type_kind must follow the regular expression
/[A-Z][a-zA-Z0-9]+/. It must start with upper case character and
recommended to use PascalCase (UpperCamelCase). The maximum number of
characters allowed for the resource_type_kind is 100.
string type = 1;public ResourceDescriptor.Builder clearType()
The full name of the resource type. It must be in the format of
{service_name}/{resource_type_kind}. The resource type names are
singular and do not contain version numbers.
For example: `storage.googleapis.com/Bucket`
The value of the resource_type_kind must follow the regular expression
/[A-Z][a-zA-Z0-9]+/. It must start with upper case character and
recommended to use PascalCase (UpperCamelCase). The maximum number of
characters allowed for the resource_type_kind is 100.
string type = 1;public ResourceDescriptor.Builder setTypeBytes(com.google.protobuf.ByteString value)
The full name of the resource type. It must be in the format of
{service_name}/{resource_type_kind}. The resource type names are
singular and do not contain version numbers.
For example: `storage.googleapis.com/Bucket`
The value of the resource_type_kind must follow the regular expression
/[A-Z][a-zA-Z0-9]+/. It must start with upper case character and
recommended to use PascalCase (UpperCamelCase). The maximum number of
characters allowed for the resource_type_kind is 100.
string type = 1;public com.google.protobuf.ProtocolStringList getPatternList()
Required. The valid pattern or patterns for this resource's names.
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;getPatternList in interface ResourceDescriptorOrBuilderpublic int getPatternCount()
Required. The valid pattern or patterns for this resource's names.
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;getPatternCount in interface ResourceDescriptorOrBuilderpublic String getPattern(int index)
Required. The valid pattern or patterns for this resource's names.
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;getPattern in interface ResourceDescriptorOrBuilderpublic com.google.protobuf.ByteString getPatternBytes(int index)
Required. The valid pattern or patterns for this resource's names.
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;getPatternBytes in interface ResourceDescriptorOrBuilderpublic ResourceDescriptor.Builder setPattern(int index, String value)
Required. The valid pattern or patterns for this resource's names.
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;public ResourceDescriptor.Builder addPattern(String value)
Required. The valid pattern or patterns for this resource's names.
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;public ResourceDescriptor.Builder addAllPattern(Iterable<String> values)
Required. The valid pattern or patterns for this resource's names.
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;public ResourceDescriptor.Builder clearPattern()
Required. The valid pattern or patterns for this resource's names.
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;public ResourceDescriptor.Builder addPatternBytes(com.google.protobuf.ByteString value)
Required. The valid pattern or patterns for this resource's names.
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;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;getNameField in interface ResourceDescriptorOrBuilderpublic 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;getNameFieldBytes in interface ResourceDescriptorOrBuilderpublic 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;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;public ResourceDescriptor.Builder setNameFieldBytes(com.google.protobuf.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;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;getHistoryValue in interface ResourceDescriptorOrBuilderpublic 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;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;getHistory in interface ResourceDescriptorOrBuilderpublic 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;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;public final ResourceDescriptor.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields in interface com.google.protobuf.Message.BuildersetUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<ResourceDescriptor.Builder>public final ResourceDescriptor.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields in interface com.google.protobuf.Message.BuildermergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<ResourceDescriptor.Builder>