Class ErrorInfo.Builder (1.15.0)

public static final class ErrorInfo.Builder extends GeneratedMessageV3.Builder<ErrorInfo.Builder> implements ErrorInfoOrBuilder

Describes the cause of the error with structured details. Example of an error when contacting the "pubsub.googleapis.com" API when it is not enabled: { "reason": "API_DISABLED" "domain": "googleapis.com" "metadata": { "resource": "projects/123", "service": "pubsub.googleapis.com" } } This response indicates that the pubsub.googleapis.com API is not enabled. Example of an error that is returned when attempting to create a Spanner instance in a region that is out of stock: { "reason": "STOCKOUT" "domain": "spanner.googleapis.com", "metadata": { "availableRegions": "us-central1,us-east2" } }

Protobuf type google.cloud.compute.v1.ErrorInfo

Implements

ErrorInfoOrBuilder

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public ErrorInfo build()
Returns
TypeDescription
ErrorInfo

buildPartial()

public ErrorInfo buildPartial()
Returns
TypeDescription
ErrorInfo

clear()

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

clearDomain()

public ErrorInfo.Builder clearDomain()

The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com".

optional string domain = 284415172;

Returns
TypeDescription
ErrorInfo.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearMetadatas()

public ErrorInfo.Builder clearMetadatas()
Returns
TypeDescription
ErrorInfo.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearReason()

public ErrorInfo.Builder clearReason()

The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match /[A-Z0-9_]+/.

optional string reason = 138777156;

Returns
TypeDescription
ErrorInfo.Builder

This builder for chaining.

clone()

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

containsMetadatas(String key)

public boolean containsMetadatas(String key)

Additional structured details about this error. Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request.

map<string, string> metadatas = 8514340;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getDefaultInstanceForType()

public ErrorInfo getDefaultInstanceForType()
Returns
TypeDescription
ErrorInfo

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDomain()

public String getDomain()

The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com".

optional string domain = 284415172;

Returns
TypeDescription
String

The domain.

getDomainBytes()

public ByteString getDomainBytes()

The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com".

optional string domain = 284415172;

Returns
TypeDescription
ByteString

The bytes for domain.

getMetadatas()

public Map<String,String> getMetadatas()

Use #getMetadatasMap() instead.

Returns
TypeDescription
Map<String,String>

getMetadatasCount()

public int getMetadatasCount()

Additional structured details about this error. Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request.

map<string, string> metadatas = 8514340;

Returns
TypeDescription
int

getMetadatasMap()

public Map<String,String> getMetadatasMap()

Additional structured details about this error. Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request.

map<string, string> metadatas = 8514340;

Returns
TypeDescription
Map<String,String>

getMetadatasOrDefault(String key, String defaultValue)

public String getMetadatasOrDefault(String key, String defaultValue)

Additional structured details about this error. Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request.

map<string, string> metadatas = 8514340;

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getMetadatasOrThrow(String key)

public String getMetadatasOrThrow(String key)

Additional structured details about this error. Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request.

map<string, string> metadatas = 8514340;

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getMutableMetadatas()

public Map<String,String> getMutableMetadatas()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,String>

getReason()

public String getReason()

The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match /[A-Z0-9_]+/.

optional string reason = 138777156;

Returns
TypeDescription
String

The reason.

getReasonBytes()

public ByteString getReasonBytes()

The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match /[A-Z0-9_]+/.

optional string reason = 138777156;

Returns
TypeDescription
ByteString

The bytes for reason.

hasDomain()

public boolean hasDomain()

The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com".

optional string domain = 284415172;

Returns
TypeDescription
boolean

Whether the domain field is set.

hasReason()

public boolean hasReason()

The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match /[A-Z0-9_]+/.

optional string reason = 138777156;

Returns
TypeDescription
boolean

Whether the reason field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

internalGetMutableMapField(int number)

protected MapField internalGetMutableMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(ErrorInfo other)

public ErrorInfo.Builder mergeFrom(ErrorInfo other)
Parameter
NameDescription
otherErrorInfo
Returns
TypeDescription
ErrorInfo.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

putAllMetadatas(Map<String,String> values)

public ErrorInfo.Builder putAllMetadatas(Map<String,String> values)

Additional structured details about this error. Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request.

map<string, string> metadatas = 8514340;

Parameter
NameDescription
valuesMap<String,String>
Returns
TypeDescription
ErrorInfo.Builder

putMetadatas(String key, String value)

public ErrorInfo.Builder putMetadatas(String key, String value)

Additional structured details about this error. Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request.

map<string, string> metadatas = 8514340;

Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
ErrorInfo.Builder

removeMetadatas(String key)

public ErrorInfo.Builder removeMetadatas(String key)

Additional structured details about this error. Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request.

map<string, string> metadatas = 8514340;

Parameter
NameDescription
keyString
Returns
TypeDescription
ErrorInfo.Builder

setDomain(String value)

public ErrorInfo.Builder setDomain(String value)

The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com".

optional string domain = 284415172;

Parameter
NameDescription
valueString

The domain to set.

Returns
TypeDescription
ErrorInfo.Builder

This builder for chaining.

setDomainBytes(ByteString value)

public ErrorInfo.Builder setDomainBytes(ByteString value)

The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com".

optional string domain = 284415172;

Parameter
NameDescription
valueByteString

The bytes for domain to set.

Returns
TypeDescription
ErrorInfo.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setReason(String value)

public ErrorInfo.Builder setReason(String value)

The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match /[A-Z0-9_]+/.

optional string reason = 138777156;

Parameter
NameDescription
valueString

The reason to set.

Returns
TypeDescription
ErrorInfo.Builder

This builder for chaining.

setReasonBytes(ByteString value)

public ErrorInfo.Builder setReasonBytes(ByteString value)

The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match /[A-Z0-9_]+/.

optional string reason = 138777156;

Parameter
NameDescription
valueByteString

The bytes for reason to set.

Returns
TypeDescription
ErrorInfo.Builder

This builder for chaining.

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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