Class ResourceReference.Builder (2.43.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
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public ResourceReference build()
Returns
Type Description
ResourceReference

buildPartial()

public ResourceReference buildPartial()
Returns
Type Description
ResourceReference

clear()

public ResourceReference.Builder clear()
Returns
Type Description
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
Type Description
ResourceReference.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

public ResourceReference.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
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
Type Description
ResourceReference.Builder

This builder for chaining.

clone()

public ResourceReference.Builder clone()
Returns
Type Description
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
Type Description
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
Type Description
ByteString

The bytes for childType.

getDefaultInstanceForType()

public ResourceReference getDefaultInstanceForType()
Returns
Type Description
ResourceReference

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
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
Type Description
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
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(ResourceReference other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final ResourceReference.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
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
Name Description
value String

The childType to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for childType to set.

Returns
Type Description
ResourceReference.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

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

public ResourceReference.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
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
Name Description
value String

The type to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for type to set.

Returns
Type Description
ResourceReference.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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