public final class ResourceDescriptor extends com.google.protobuf.GeneratedMessageV3 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 | Class and Description |
|---|---|
static class |
ResourceDescriptor.Builder
A simple descriptor of a resource type.
|
static class |
ResourceDescriptor.History
A description of the historical or future-looking state of the
resource pattern.
|
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable| Modifier and Type | Field and Description |
|---|---|
static int |
HISTORY_FIELD_NUMBER |
static int |
NAME_FIELD_FIELD_NUMBER |
static int |
PATTERN_FIELD_NUMBER |
static int |
TYPE_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static ResourceDescriptor |
getDefaultInstance() |
ResourceDescriptor |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
ResourceDescriptor.History |
getHistory()
Optional.
|
int |
getHistoryValue()
Optional.
|
String |
getNameField()
Optional.
|
com.google.protobuf.ByteString |
getNameFieldBytes()
Optional.
|
com.google.protobuf.Parser<ResourceDescriptor> |
getParserForType() |
String |
getPattern(int index)
Required.
|
com.google.protobuf.ByteString |
getPatternBytes(int index)
Required.
|
int |
getPatternCount()
Required.
|
com.google.protobuf.ProtocolStringList |
getPatternList()
Required.
|
int |
getSerializedSize() |
String |
getType()
The full name of the resource type.
|
com.google.protobuf.ByteString |
getTypeBytes()
The full name of the resource type.
|
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
int |
hashCode() |
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static ResourceDescriptor.Builder |
newBuilder() |
static ResourceDescriptor.Builder |
newBuilder(ResourceDescriptor prototype) |
ResourceDescriptor.Builder |
newBuilderForType() |
protected ResourceDescriptor.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
static ResourceDescriptor |
parseDelimitedFrom(InputStream input) |
static ResourceDescriptor |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ResourceDescriptor |
parseFrom(byte[] data) |
static ResourceDescriptor |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ResourceDescriptor |
parseFrom(ByteBuffer data) |
static ResourceDescriptor |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ResourceDescriptor |
parseFrom(com.google.protobuf.ByteString data) |
static ResourceDescriptor |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ResourceDescriptor |
parseFrom(com.google.protobuf.CodedInputStream input) |
static ResourceDescriptor |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ResourceDescriptor |
parseFrom(InputStream input) |
static ResourceDescriptor |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<ResourceDescriptor> |
parser() |
ResourceDescriptor.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, makeExtensionsImmutable, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int TYPE_FIELD_NUMBER
public static final int PATTERN_FIELD_NUMBER
public static final int NAME_FIELD_FIELD_NUMBER
public static final int HISTORY_FIELD_NUMBER
public final com.google.protobuf.UnknownFieldSet getUnknownFields()
getUnknownFields in interface com.google.protobuf.MessageOrBuildergetUnknownFields in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public 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 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 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 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.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 final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static ResourceDescriptor parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ResourceDescriptor parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ResourceDescriptor parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ResourceDescriptor parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ResourceDescriptor parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ResourceDescriptor parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ResourceDescriptor parseFrom(InputStream input) throws IOException
IOExceptionpublic static ResourceDescriptor parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static ResourceDescriptor parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static ResourceDescriptor parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static ResourceDescriptor parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static ResourceDescriptor parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic ResourceDescriptor.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static ResourceDescriptor.Builder newBuilder()
public static ResourceDescriptor.Builder newBuilder(ResourceDescriptor prototype)
public ResourceDescriptor.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected ResourceDescriptor.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static ResourceDescriptor getDefaultInstance()
public static com.google.protobuf.Parser<ResourceDescriptor> parser()
public com.google.protobuf.Parser<ResourceDescriptor> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public ResourceDescriptor getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder