Class CustomErrorResponsePolicyCustomErrorResponseRule.Builder (1.64.0)

public static final class CustomErrorResponsePolicyCustomErrorResponseRule.Builder extends GeneratedMessageV3.Builder<CustomErrorResponsePolicyCustomErrorResponseRule.Builder> implements CustomErrorResponsePolicyCustomErrorResponseRuleOrBuilder

Specifies the mapping between the response code that will be returned along with the custom error content and the response code returned by the backend service.

Protobuf type google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule

Inheritance

Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder > CustomErrorResponsePolicyCustomErrorResponseRule.Builder

Static Methods

getDescriptor()

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

Methods

addAllMatchResponseCodes(Iterable<String> values)

public CustomErrorResponsePolicyCustomErrorResponseRule.Builder addAllMatchResponseCodes(Iterable<String> values)

Valid values include: - A number between 400 and 599: For example 401 or 503, in which case the load balancer applies the policy if the error code exactly matches this value. - 5xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 500 to 599. - 4xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 400 to 499. Values must be unique within matchResponseCodes and across all errorResponseRules of CustomErrorResponsePolicy.

repeated string match_response_codes = 104973410;

Parameter
Name Description
values Iterable<String>

The matchResponseCodes to add.

Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule.Builder

This builder for chaining.

addMatchResponseCodes(String value)

public CustomErrorResponsePolicyCustomErrorResponseRule.Builder addMatchResponseCodes(String value)

Valid values include: - A number between 400 and 599: For example 401 or 503, in which case the load balancer applies the policy if the error code exactly matches this value. - 5xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 500 to 599. - 4xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 400 to 499. Values must be unique within matchResponseCodes and across all errorResponseRules of CustomErrorResponsePolicy.

repeated string match_response_codes = 104973410;

Parameter
Name Description
value String

The matchResponseCodes to add.

Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule.Builder

This builder for chaining.

addMatchResponseCodesBytes(ByteString value)

public CustomErrorResponsePolicyCustomErrorResponseRule.Builder addMatchResponseCodesBytes(ByteString value)

Valid values include: - A number between 400 and 599: For example 401 or 503, in which case the load balancer applies the policy if the error code exactly matches this value. - 5xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 500 to 599. - 4xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 400 to 499. Values must be unique within matchResponseCodes and across all errorResponseRules of CustomErrorResponsePolicy.

repeated string match_response_codes = 104973410;

Parameter
Name Description
value ByteString

The bytes of the matchResponseCodes to add.

Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public CustomErrorResponsePolicyCustomErrorResponseRule build()
Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule

buildPartial()

public CustomErrorResponsePolicyCustomErrorResponseRule buildPartial()
Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule

clear()

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

clearField(Descriptors.FieldDescriptor field)

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

clearMatchResponseCodes()

public CustomErrorResponsePolicyCustomErrorResponseRule.Builder clearMatchResponseCodes()

Valid values include: - A number between 400 and 599: For example 401 or 503, in which case the load balancer applies the policy if the error code exactly matches this value. - 5xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 500 to 599. - 4xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 400 to 499. Values must be unique within matchResponseCodes and across all errorResponseRules of CustomErrorResponsePolicy.

repeated string match_response_codes = 104973410;

Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public CustomErrorResponsePolicyCustomErrorResponseRule.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule.Builder
Overrides

clearOverrideResponseCode()

public CustomErrorResponsePolicyCustomErrorResponseRule.Builder clearOverrideResponseCode()

The HTTP status code returned with the response containing the custom error content. If overrideResponseCode is not supplied, the same response code returned by the original backend bucket or backend service is returned to the client.

optional int32 override_response_code = 530328568;

Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule.Builder

This builder for chaining.

clearPath()

public CustomErrorResponsePolicyCustomErrorResponseRule.Builder clearPath()

The full path to a file within backendBucket . For example: /errors/defaultError.html path must start with a leading slash. path cannot have trailing slashes. If the file is not available in backendBucket or the load balancer cannot reach the BackendBucket, a simple Not Found Error is returned to the client. The value must be from 1 to 1024 characters

optional string path = 3433509;

Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule.Builder

This builder for chaining.

clone()

public CustomErrorResponsePolicyCustomErrorResponseRule.Builder clone()
Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule.Builder
Overrides

getDefaultInstanceForType()

public CustomErrorResponsePolicyCustomErrorResponseRule getDefaultInstanceForType()
Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule

getDescriptorForType()

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

getMatchResponseCodes(int index)

public String getMatchResponseCodes(int index)

Valid values include: - A number between 400 and 599: For example 401 or 503, in which case the load balancer applies the policy if the error code exactly matches this value. - 5xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 500 to 599. - 4xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 400 to 499. Values must be unique within matchResponseCodes and across all errorResponseRules of CustomErrorResponsePolicy.

repeated string match_response_codes = 104973410;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The matchResponseCodes at the given index.

getMatchResponseCodesBytes(int index)

public ByteString getMatchResponseCodesBytes(int index)

Valid values include: - A number between 400 and 599: For example 401 or 503, in which case the load balancer applies the policy if the error code exactly matches this value. - 5xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 500 to 599. - 4xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 400 to 499. Values must be unique within matchResponseCodes and across all errorResponseRules of CustomErrorResponsePolicy.

repeated string match_response_codes = 104973410;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the matchResponseCodes at the given index.

getMatchResponseCodesCount()

public int getMatchResponseCodesCount()

Valid values include: - A number between 400 and 599: For example 401 or 503, in which case the load balancer applies the policy if the error code exactly matches this value. - 5xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 500 to 599. - 4xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 400 to 499. Values must be unique within matchResponseCodes and across all errorResponseRules of CustomErrorResponsePolicy.

repeated string match_response_codes = 104973410;

Returns
Type Description
int

The count of matchResponseCodes.

getMatchResponseCodesList()

public ProtocolStringList getMatchResponseCodesList()

Valid values include: - A number between 400 and 599: For example 401 or 503, in which case the load balancer applies the policy if the error code exactly matches this value. - 5xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 500 to 599. - 4xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 400 to 499. Values must be unique within matchResponseCodes and across all errorResponseRules of CustomErrorResponsePolicy.

repeated string match_response_codes = 104973410;

Returns
Type Description
ProtocolStringList

A list containing the matchResponseCodes.

getOverrideResponseCode()

public int getOverrideResponseCode()

The HTTP status code returned with the response containing the custom error content. If overrideResponseCode is not supplied, the same response code returned by the original backend bucket or backend service is returned to the client.

optional int32 override_response_code = 530328568;

Returns
Type Description
int

The overrideResponseCode.

getPath()

public String getPath()

The full path to a file within backendBucket . For example: /errors/defaultError.html path must start with a leading slash. path cannot have trailing slashes. If the file is not available in backendBucket or the load balancer cannot reach the BackendBucket, a simple Not Found Error is returned to the client. The value must be from 1 to 1024 characters

optional string path = 3433509;

Returns
Type Description
String

The path.

getPathBytes()

public ByteString getPathBytes()

The full path to a file within backendBucket . For example: /errors/defaultError.html path must start with a leading slash. path cannot have trailing slashes. If the file is not available in backendBucket or the load balancer cannot reach the BackendBucket, a simple Not Found Error is returned to the client. The value must be from 1 to 1024 characters

optional string path = 3433509;

Returns
Type Description
ByteString

The bytes for path.

hasOverrideResponseCode()

public boolean hasOverrideResponseCode()

The HTTP status code returned with the response containing the custom error content. If overrideResponseCode is not supplied, the same response code returned by the original backend bucket or backend service is returned to the client.

optional int32 override_response_code = 530328568;

Returns
Type Description
boolean

Whether the overrideResponseCode field is set.

hasPath()

public boolean hasPath()

The full path to a file within backendBucket . For example: /errors/defaultError.html path must start with a leading slash. path cannot have trailing slashes. If the file is not available in backendBucket or the load balancer cannot reach the BackendBucket, a simple Not Found Error is returned to the client. The value must be from 1 to 1024 characters

optional string path = 3433509;

Returns
Type Description
boolean

Whether the path field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CustomErrorResponsePolicyCustomErrorResponseRule other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final CustomErrorResponsePolicyCustomErrorResponseRule.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

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

setMatchResponseCodes(int index, String value)

public CustomErrorResponsePolicyCustomErrorResponseRule.Builder setMatchResponseCodes(int index, String value)

Valid values include: - A number between 400 and 599: For example 401 or 503, in which case the load balancer applies the policy if the error code exactly matches this value. - 5xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 500 to 599. - 4xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 400 to 499. Values must be unique within matchResponseCodes and across all errorResponseRules of CustomErrorResponsePolicy.

repeated string match_response_codes = 104973410;

Parameters
Name Description
index int

The index to set the value at.

value String

The matchResponseCodes to set.

Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule.Builder

This builder for chaining.

setOverrideResponseCode(int value)

public CustomErrorResponsePolicyCustomErrorResponseRule.Builder setOverrideResponseCode(int value)

The HTTP status code returned with the response containing the custom error content. If overrideResponseCode is not supplied, the same response code returned by the original backend bucket or backend service is returned to the client.

optional int32 override_response_code = 530328568;

Parameter
Name Description
value int

The overrideResponseCode to set.

Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule.Builder

This builder for chaining.

setPath(String value)

public CustomErrorResponsePolicyCustomErrorResponseRule.Builder setPath(String value)

The full path to a file within backendBucket . For example: /errors/defaultError.html path must start with a leading slash. path cannot have trailing slashes. If the file is not available in backendBucket or the load balancer cannot reach the BackendBucket, a simple Not Found Error is returned to the client. The value must be from 1 to 1024 characters

optional string path = 3433509;

Parameter
Name Description
value String

The path to set.

Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule.Builder

This builder for chaining.

setPathBytes(ByteString value)

public CustomErrorResponsePolicyCustomErrorResponseRule.Builder setPathBytes(ByteString value)

The full path to a file within backendBucket . For example: /errors/defaultError.html path must start with a leading slash. path cannot have trailing slashes. If the file is not available in backendBucket or the load balancer cannot reach the BackendBucket, a simple Not Found Error is returned to the client. The value must be from 1 to 1024 characters

optional string path = 3433509;

Parameter
Name Description
value ByteString

The bytes for path to set.

Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule.Builder

This builder for chaining.

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

public CustomErrorResponsePolicyCustomErrorResponseRule.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

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