Class ResourceReference.Builder (2.34.0)

public static final class ResourceReference.Builder extends GeneratedMessageV3.Builder<ResourceReference.Builder> implements ResourceReferenceOrBuilder

Defines a proto annotation that describes a string field that refers to an API resource.

Protobuf type google.api.ResourceReference

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public ResourceReference.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
ResourceReference.Builder
Overrides

build()

public ResourceReference build()
Returns
TypeDescription
ResourceReference

buildPartial()

public ResourceReference buildPartial()
Returns
TypeDescription
ResourceReference

clear()

public ResourceReference.Builder clear()
Returns
TypeDescription
ResourceReference.Builder
Overrides

clearChildType()

public ResourceReference.Builder clearChildType()

The resource type of a child collection that the annotated field references. This is useful for annotating the parent field that doesn't have a fixed resource type.

Example:

 message ListLogEntriesRequest {
   string parent = 1 [(google.api.resource_reference) = {
     child_type: "logging.googleapis.com/LogEntry"
   };
 }

string child_type = 2;

Returns
TypeDescription
ResourceReference.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public ResourceReference.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
ResourceReference.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public ResourceReference.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
ResourceReference.Builder
Overrides

clearType()

public ResourceReference.Builder clearType()

The resource type that the annotated field references.

Example:

 message Subscription {
   string topic = 2 [(google.api.resource_reference) = {
     type: "pubsub.googleapis.com/Topic"
   }];
 }

Occasionally, a field may reference an arbitrary resource. In this case, APIs use the special value * in their resource reference.

Example:

 message GetIamPolicyRequest {
   string resource = 2 [(google.api.resource_reference) = {
     type: "*"
   }];
 }

string type = 1;

Returns
TypeDescription
ResourceReference.Builder

This builder for chaining.

clone()

public ResourceReference.Builder clone()
Returns
TypeDescription
ResourceReference.Builder
Overrides

getChildType()

public String getChildType()

The resource type of a child collection that the annotated field references. This is useful for annotating the parent field that doesn't have a fixed resource type.

Example:

 message ListLogEntriesRequest {
   string parent = 1 [(google.api.resource_reference) = {
     child_type: "logging.googleapis.com/LogEntry"
   };
 }

string child_type = 2;

Returns
TypeDescription
String

The childType.

getChildTypeBytes()

public ByteString getChildTypeBytes()

The resource type of a child collection that the annotated field references. This is useful for annotating the parent field that doesn't have a fixed resource type.

Example:

 message ListLogEntriesRequest {
   string parent = 1 [(google.api.resource_reference) = {
     child_type: "logging.googleapis.com/LogEntry"
   };
 }

string child_type = 2;

Returns
TypeDescription
ByteString

The bytes for childType.

getDefaultInstanceForType()

public ResourceReference getDefaultInstanceForType()
Returns
TypeDescription
ResourceReference

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getType()

public String getType()

The resource type that the annotated field references.

Example:

 message Subscription {
   string topic = 2 [(google.api.resource_reference) = {
     type: "pubsub.googleapis.com/Topic"
   }];
 }

Occasionally, a field may reference an arbitrary resource. In this case, APIs use the special value * in their resource reference.

Example:

 message GetIamPolicyRequest {
   string resource = 2 [(google.api.resource_reference) = {
     type: "*"
   }];
 }

string type = 1;

Returns
TypeDescription
String

The type.

getTypeBytes()

public ByteString getTypeBytes()

The resource type that the annotated field references.

Example:

 message Subscription {
   string topic = 2 [(google.api.resource_reference) = {
     type: "pubsub.googleapis.com/Topic"
   }];
 }

Occasionally, a field may reference an arbitrary resource. In this case, APIs use the special value * in their resource reference.

Example:

 message GetIamPolicyRequest {
   string resource = 2 [(google.api.resource_reference) = {
     type: "*"
   }];
 }

string type = 1;

Returns
TypeDescription
ByteString

The bytes for type.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(ResourceReference other)

public ResourceReference.Builder mergeFrom(ResourceReference other)
Parameter
NameDescription
otherResourceReference
Returns
TypeDescription
ResourceReference.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public ResourceReference.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ResourceReference.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public ResourceReference.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
ResourceReference.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final ResourceReference.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
ResourceReference.Builder
Overrides

setChildType(String value)

public ResourceReference.Builder setChildType(String value)

The resource type of a child collection that the annotated field references. This is useful for annotating the parent field that doesn't have a fixed resource type.

Example:

 message ListLogEntriesRequest {
   string parent = 1 [(google.api.resource_reference) = {
     child_type: "logging.googleapis.com/LogEntry"
   };
 }

string child_type = 2;

Parameter
NameDescription
valueString

The childType to set.

Returns
TypeDescription
ResourceReference.Builder

This builder for chaining.

setChildTypeBytes(ByteString value)

public ResourceReference.Builder setChildTypeBytes(ByteString value)

The resource type of a child collection that the annotated field references. This is useful for annotating the parent field that doesn't have a fixed resource type.

Example:

 message ListLogEntriesRequest {
   string parent = 1 [(google.api.resource_reference) = {
     child_type: "logging.googleapis.com/LogEntry"
   };
 }

string child_type = 2;

Parameter
NameDescription
valueByteString

The bytes for childType to set.

Returns
TypeDescription
ResourceReference.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public ResourceReference.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
ResourceReference.Builder
Overrides

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

public ResourceReference.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
ResourceReference.Builder
Overrides

setType(String value)

public ResourceReference.Builder setType(String value)

The resource type that the annotated field references.

Example:

 message Subscription {
   string topic = 2 [(google.api.resource_reference) = {
     type: "pubsub.googleapis.com/Topic"
   }];
 }

Occasionally, a field may reference an arbitrary resource. In this case, APIs use the special value * in their resource reference.

Example:

 message GetIamPolicyRequest {
   string resource = 2 [(google.api.resource_reference) = {
     type: "*"
   }];
 }

string type = 1;

Parameter
NameDescription
valueString

The type to set.

Returns
TypeDescription
ResourceReference.Builder

This builder for chaining.

setTypeBytes(ByteString value)

public ResourceReference.Builder setTypeBytes(ByteString value)

The resource type that the annotated field references.

Example:

 message Subscription {
   string topic = 2 [(google.api.resource_reference) = {
     type: "pubsub.googleapis.com/Topic"
   }];
 }

Occasionally, a field may reference an arbitrary resource. In this case, APIs use the special value * in their resource reference.

Example:

 message GetIamPolicyRequest {
   string resource = 2 [(google.api.resource_reference) = {
     type: "*"
   }];
 }

string type = 1;

Parameter
NameDescription
valueByteString

The bytes for type to set.

Returns
TypeDescription
ResourceReference.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final ResourceReference.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
ResourceReference.Builder
Overrides