Class CustomErrorResponsePolicy.Builder (1.65.0)

public static final class CustomErrorResponsePolicy.Builder extends GeneratedMessageV3.Builder<CustomErrorResponsePolicy.Builder> implements CustomErrorResponsePolicyOrBuilder

Specifies the custom error response policy that must be applied when the backend service or backend bucket responds with an error.

Protobuf type google.cloud.compute.v1.CustomErrorResponsePolicy

Static Methods

getDescriptor()

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

Methods

addAllErrorResponseRules(Iterable<? extends CustomErrorResponsePolicyCustomErrorResponseRule> values)

public CustomErrorResponsePolicy.Builder addAllErrorResponseRules(Iterable<? extends CustomErrorResponsePolicyCustomErrorResponseRule> values)

Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect.

repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304;

Parameter
Name Description
values Iterable<? extends com.google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule>
Returns
Type Description
CustomErrorResponsePolicy.Builder

addErrorResponseRules(CustomErrorResponsePolicyCustomErrorResponseRule value)

public CustomErrorResponsePolicy.Builder addErrorResponseRules(CustomErrorResponsePolicyCustomErrorResponseRule value)

Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect.

repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304;

Parameter
Name Description
value CustomErrorResponsePolicyCustomErrorResponseRule
Returns
Type Description
CustomErrorResponsePolicy.Builder

addErrorResponseRules(CustomErrorResponsePolicyCustomErrorResponseRule.Builder builderForValue)

public CustomErrorResponsePolicy.Builder addErrorResponseRules(CustomErrorResponsePolicyCustomErrorResponseRule.Builder builderForValue)

Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect.

repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304;

Parameter
Name Description
builderForValue CustomErrorResponsePolicyCustomErrorResponseRule.Builder
Returns
Type Description
CustomErrorResponsePolicy.Builder

addErrorResponseRules(int index, CustomErrorResponsePolicyCustomErrorResponseRule value)

public CustomErrorResponsePolicy.Builder addErrorResponseRules(int index, CustomErrorResponsePolicyCustomErrorResponseRule value)

Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect.

repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304;

Parameters
Name Description
index int
value CustomErrorResponsePolicyCustomErrorResponseRule
Returns
Type Description
CustomErrorResponsePolicy.Builder

addErrorResponseRules(int index, CustomErrorResponsePolicyCustomErrorResponseRule.Builder builderForValue)

public CustomErrorResponsePolicy.Builder addErrorResponseRules(int index, CustomErrorResponsePolicyCustomErrorResponseRule.Builder builderForValue)

Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect.

repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304;

Parameters
Name Description
index int
builderForValue CustomErrorResponsePolicyCustomErrorResponseRule.Builder
Returns
Type Description
CustomErrorResponsePolicy.Builder

addErrorResponseRulesBuilder()

public CustomErrorResponsePolicyCustomErrorResponseRule.Builder addErrorResponseRulesBuilder()

Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect.

repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304;

Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule.Builder

addErrorResponseRulesBuilder(int index)

public CustomErrorResponsePolicyCustomErrorResponseRule.Builder addErrorResponseRulesBuilder(int index)

Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect.

repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304;

Parameter
Name Description
index int
Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public CustomErrorResponsePolicy build()
Returns
Type Description
CustomErrorResponsePolicy

buildPartial()

public CustomErrorResponsePolicy buildPartial()
Returns
Type Description
CustomErrorResponsePolicy

clear()

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

clearErrorResponseRules()

public CustomErrorResponsePolicy.Builder clearErrorResponseRules()

Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect.

repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304;

Returns
Type Description
CustomErrorResponsePolicy.Builder

clearErrorService()

public CustomErrorResponsePolicy.Builder clearErrorService()

The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket - compute/v1/projects/project/global/backendBuckets/myBackendBucket - global/backendBuckets/myBackendBucket If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). errorService is not supported for internal or regional HTTP/HTTPS load balancers.

optional string error_service = 164214654;

Returns
Type Description
CustomErrorResponsePolicy.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

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

getDefaultInstanceForType()

public CustomErrorResponsePolicy getDefaultInstanceForType()
Returns
Type Description
CustomErrorResponsePolicy

getDescriptorForType()

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

getErrorResponseRules(int index)

public CustomErrorResponsePolicyCustomErrorResponseRule getErrorResponseRules(int index)

Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect.

repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304;

Parameter
Name Description
index int
Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule

getErrorResponseRulesBuilder(int index)

public CustomErrorResponsePolicyCustomErrorResponseRule.Builder getErrorResponseRulesBuilder(int index)

Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect.

repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304;

Parameter
Name Description
index int
Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRule.Builder

getErrorResponseRulesBuilderList()

public List<CustomErrorResponsePolicyCustomErrorResponseRule.Builder> getErrorResponseRulesBuilderList()

Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect.

repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304;

Returns
Type Description
List<Builder>

getErrorResponseRulesCount()

public int getErrorResponseRulesCount()

Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect.

repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304;

Returns
Type Description
int

getErrorResponseRulesList()

public List<CustomErrorResponsePolicyCustomErrorResponseRule> getErrorResponseRulesList()

Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect.

repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304;

Returns
Type Description
List<CustomErrorResponsePolicyCustomErrorResponseRule>

getErrorResponseRulesOrBuilder(int index)

public CustomErrorResponsePolicyCustomErrorResponseRuleOrBuilder getErrorResponseRulesOrBuilder(int index)

Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect.

repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304;

Parameter
Name Description
index int
Returns
Type Description
CustomErrorResponsePolicyCustomErrorResponseRuleOrBuilder

getErrorResponseRulesOrBuilderList()

public List<? extends CustomErrorResponsePolicyCustomErrorResponseRuleOrBuilder> getErrorResponseRulesOrBuilderList()

Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect.

repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304;

Returns
Type Description
List<? extends com.google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRuleOrBuilder>

getErrorService()

public String getErrorService()

The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket - compute/v1/projects/project/global/backendBuckets/myBackendBucket - global/backendBuckets/myBackendBucket If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). errorService is not supported for internal or regional HTTP/HTTPS load balancers.

optional string error_service = 164214654;

Returns
Type Description
String

The errorService.

getErrorServiceBytes()

public ByteString getErrorServiceBytes()

The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket - compute/v1/projects/project/global/backendBuckets/myBackendBucket - global/backendBuckets/myBackendBucket If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). errorService is not supported for internal or regional HTTP/HTTPS load balancers.

optional string error_service = 164214654;

Returns
Type Description
ByteString

The bytes for errorService.

hasErrorService()

public boolean hasErrorService()

The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket - compute/v1/projects/project/global/backendBuckets/myBackendBucket - global/backendBuckets/myBackendBucket If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). errorService is not supported for internal or regional HTTP/HTTPS load balancers.

optional string error_service = 164214654;

Returns
Type Description
boolean

Whether the errorService field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CustomErrorResponsePolicy other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

removeErrorResponseRules(int index)

public CustomErrorResponsePolicy.Builder removeErrorResponseRules(int index)

Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect.

repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304;

Parameter
Name Description
index int
Returns
Type Description
CustomErrorResponsePolicy.Builder

setErrorResponseRules(int index, CustomErrorResponsePolicyCustomErrorResponseRule value)

public CustomErrorResponsePolicy.Builder setErrorResponseRules(int index, CustomErrorResponsePolicyCustomErrorResponseRule value)

Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect.

repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304;

Parameters
Name Description
index int
value CustomErrorResponsePolicyCustomErrorResponseRule
Returns
Type Description
CustomErrorResponsePolicy.Builder

setErrorResponseRules(int index, CustomErrorResponsePolicyCustomErrorResponseRule.Builder builderForValue)

public CustomErrorResponsePolicy.Builder setErrorResponseRules(int index, CustomErrorResponsePolicyCustomErrorResponseRule.Builder builderForValue)

Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect.

repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304;

Parameters
Name Description
index int
builderForValue CustomErrorResponsePolicyCustomErrorResponseRule.Builder
Returns
Type Description
CustomErrorResponsePolicy.Builder

setErrorService(String value)

public CustomErrorResponsePolicy.Builder setErrorService(String value)

The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket - compute/v1/projects/project/global/backendBuckets/myBackendBucket - global/backendBuckets/myBackendBucket If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). errorService is not supported for internal or regional HTTP/HTTPS load balancers.

optional string error_service = 164214654;

Parameter
Name Description
value String

The errorService to set.

Returns
Type Description
CustomErrorResponsePolicy.Builder

This builder for chaining.

setErrorServiceBytes(ByteString value)

public CustomErrorResponsePolicy.Builder setErrorServiceBytes(ByteString value)

The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket - compute/v1/projects/project/global/backendBuckets/myBackendBucket - global/backendBuckets/myBackendBucket If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). errorService is not supported for internal or regional HTTP/HTTPS load balancers.

optional string error_service = 164214654;

Parameter
Name Description
value ByteString

The bytes for errorService to set.

Returns
Type Description
CustomErrorResponsePolicy.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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