Class ResourceMetadata.Builder (1.109.0)

public static final class ResourceMetadata.Builder extends GeneratedMessage.Builder<ResourceMetadata.Builder> implements ResourceMetadataOrBuilder

Standardized resource metadata common to all compute resources.

Protobuf type google.cloud.compute.v1.ResourceMetadata

Static Methods

getDescriptor()

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

Methods

build()

public ResourceMetadata build()
Returns
Type Description
ResourceMetadata

buildPartial()

public ResourceMetadata buildPartial()
Returns
Type Description
ResourceMetadata

clear()

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

clearApiVersion()

public ResourceMetadata.Builder clearApiVersion()

The version of the API interface that this resource was retrieved through. For example, "2025-01-01" or "2025-01-01-preview".

optional string api_version = 476021683;

Returns
Type Description
ResourceMetadata.Builder

This builder for chaining.

clearResourceType()

public ResourceMetadata.Builder clearResourceType()

The canonical resource type name in the format of a resource type as defined by AIP-123. For example, "compute.googleapis.com/Instance".

optional string resource_type = 442752203;

Returns
Type Description
ResourceMetadata.Builder

This builder for chaining.

getApiVersion()

public String getApiVersion()

The version of the API interface that this resource was retrieved through. For example, "2025-01-01" or "2025-01-01-preview".

optional string api_version = 476021683;

Returns
Type Description
String

The apiVersion.

getApiVersionBytes()

public ByteString getApiVersionBytes()

The version of the API interface that this resource was retrieved through. For example, "2025-01-01" or "2025-01-01-preview".

optional string api_version = 476021683;

Returns
Type Description
ByteString

The bytes for apiVersion.

getDefaultInstanceForType()

public ResourceMetadata getDefaultInstanceForType()
Returns
Type Description
ResourceMetadata

getDescriptorForType()

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

getResourceType()

public String getResourceType()

The canonical resource type name in the format of a resource type as defined by AIP-123. For example, "compute.googleapis.com/Instance".

optional string resource_type = 442752203;

Returns
Type Description
String

The resourceType.

getResourceTypeBytes()

public ByteString getResourceTypeBytes()

The canonical resource type name in the format of a resource type as defined by AIP-123. For example, "compute.googleapis.com/Instance".

optional string resource_type = 442752203;

Returns
Type Description
ByteString

The bytes for resourceType.

hasApiVersion()

public boolean hasApiVersion()

The version of the API interface that this resource was retrieved through. For example, "2025-01-01" or "2025-01-01-preview".

optional string api_version = 476021683;

Returns
Type Description
boolean

Whether the apiVersion field is set.

hasResourceType()

public boolean hasResourceType()

The canonical resource type name in the format of a resource type as defined by AIP-123. For example, "compute.googleapis.com/Instance".

optional string resource_type = 442752203;

Returns
Type Description
boolean

Whether the resourceType field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(ResourceMetadata other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

setApiVersion(String value)

public ResourceMetadata.Builder setApiVersion(String value)

The version of the API interface that this resource was retrieved through. For example, "2025-01-01" or "2025-01-01-preview".

optional string api_version = 476021683;

Parameter
Name Description
value String

The apiVersion to set.

Returns
Type Description
ResourceMetadata.Builder

This builder for chaining.

setApiVersionBytes(ByteString value)

public ResourceMetadata.Builder setApiVersionBytes(ByteString value)

The version of the API interface that this resource was retrieved through. For example, "2025-01-01" or "2025-01-01-preview".

optional string api_version = 476021683;

Parameter
Name Description
value ByteString

The bytes for apiVersion to set.

Returns
Type Description
ResourceMetadata.Builder

This builder for chaining.

setResourceType(String value)

public ResourceMetadata.Builder setResourceType(String value)

The canonical resource type name in the format of a resource type as defined by AIP-123. For example, "compute.googleapis.com/Instance".

optional string resource_type = 442752203;

Parameter
Name Description
value String

The resourceType to set.

Returns
Type Description
ResourceMetadata.Builder

This builder for chaining.

setResourceTypeBytes(ByteString value)

public ResourceMetadata.Builder setResourceTypeBytes(ByteString value)

The canonical resource type name in the format of a resource type as defined by AIP-123. For example, "compute.googleapis.com/Instance".

optional string resource_type = 442752203;

Parameter
Name Description
value ByteString

The bytes for resourceType to set.

Returns
Type Description
ResourceMetadata.Builder

This builder for chaining.