Class UrlRewrite.Builder (1.62.0)

public static final class UrlRewrite.Builder extends GeneratedMessageV3.Builder<UrlRewrite.Builder> implements UrlRewriteOrBuilder

The spec for modifying the path before sending the request to the matched backend service.

Protobuf type google.cloud.compute.v1.UrlRewrite

Implements

UrlRewriteOrBuilder

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public UrlRewrite build()
Returns
Type Description
UrlRewrite

buildPartial()

public UrlRewrite buildPartial()
Returns
Type Description
UrlRewrite

clear()

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

clearField(Descriptors.FieldDescriptor field)

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

clearHostRewrite()

public UrlRewrite.Builder clearHostRewrite()

Before forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. The value must be from 1 to 255 characters.

optional string host_rewrite = 159819253;

Returns
Type Description
UrlRewrite.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearPathPrefixRewrite()

public UrlRewrite.Builder clearPathPrefixRewrite()

Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. The value must be from 1 to 1024 characters.

optional string path_prefix_rewrite = 41186361;

Returns
Type Description
UrlRewrite.Builder

This builder for chaining.

clearPathTemplateRewrite()

public UrlRewrite.Builder clearPathTemplateRewrite()

If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax. A corresponding path_template_match must be specified. Any template variables must exist in the path_template_match field. - -At least one variable must be specified in the path_template_match field - You can omit variables from the rewritten URL - The * and ** operators cannot be matched unless they have a corresponding variable name - e.g. {format=} or {var=}. For example, a path_template_match of /static/{format=} could be rewritten as /static/content/{format} to prefix /content to the URL. Variables can also be re-ordered in a rewrite, so that /{country}/{format}/{suffix=*} can be rewritten as /content/{format}/{country}/{suffix}. At least one non-empty routeRules[].matchRules[].path_template_match is required. Only one of path_prefix_rewrite or path_template_rewrite may be specified.

optional string path_template_rewrite = 423409569;

Returns
Type Description
UrlRewrite.Builder

This builder for chaining.

clone()

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

getDefaultInstanceForType()

public UrlRewrite getDefaultInstanceForType()
Returns
Type Description
UrlRewrite

getDescriptorForType()

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

getHostRewrite()

public String getHostRewrite()

Before forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. The value must be from 1 to 255 characters.

optional string host_rewrite = 159819253;

Returns
Type Description
String

The hostRewrite.

getHostRewriteBytes()

public ByteString getHostRewriteBytes()

Before forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. The value must be from 1 to 255 characters.

optional string host_rewrite = 159819253;

Returns
Type Description
ByteString

The bytes for hostRewrite.

getPathPrefixRewrite()

public String getPathPrefixRewrite()

Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. The value must be from 1 to 1024 characters.

optional string path_prefix_rewrite = 41186361;

Returns
Type Description
String

The pathPrefixRewrite.

getPathPrefixRewriteBytes()

public ByteString getPathPrefixRewriteBytes()

Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. The value must be from 1 to 1024 characters.

optional string path_prefix_rewrite = 41186361;

Returns
Type Description
ByteString

The bytes for pathPrefixRewrite.

getPathTemplateRewrite()

public String getPathTemplateRewrite()

If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax. A corresponding path_template_match must be specified. Any template variables must exist in the path_template_match field. - -At least one variable must be specified in the path_template_match field - You can omit variables from the rewritten URL - The * and ** operators cannot be matched unless they have a corresponding variable name - e.g. {format=} or {var=}. For example, a path_template_match of /static/{format=} could be rewritten as /static/content/{format} to prefix /content to the URL. Variables can also be re-ordered in a rewrite, so that /{country}/{format}/{suffix=*} can be rewritten as /content/{format}/{country}/{suffix}. At least one non-empty routeRules[].matchRules[].path_template_match is required. Only one of path_prefix_rewrite or path_template_rewrite may be specified.

optional string path_template_rewrite = 423409569;

Returns
Type Description
String

The pathTemplateRewrite.

getPathTemplateRewriteBytes()

public ByteString getPathTemplateRewriteBytes()

If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax. A corresponding path_template_match must be specified. Any template variables must exist in the path_template_match field. - -At least one variable must be specified in the path_template_match field - You can omit variables from the rewritten URL - The * and ** operators cannot be matched unless they have a corresponding variable name - e.g. {format=} or {var=}. For example, a path_template_match of /static/{format=} could be rewritten as /static/content/{format} to prefix /content to the URL. Variables can also be re-ordered in a rewrite, so that /{country}/{format}/{suffix=*} can be rewritten as /content/{format}/{country}/{suffix}. At least one non-empty routeRules[].matchRules[].path_template_match is required. Only one of path_prefix_rewrite or path_template_rewrite may be specified.

optional string path_template_rewrite = 423409569;

Returns
Type Description
ByteString

The bytes for pathTemplateRewrite.

hasHostRewrite()

public boolean hasHostRewrite()

Before forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. The value must be from 1 to 255 characters.

optional string host_rewrite = 159819253;

Returns
Type Description
boolean

Whether the hostRewrite field is set.

hasPathPrefixRewrite()

public boolean hasPathPrefixRewrite()

Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. The value must be from 1 to 1024 characters.

optional string path_prefix_rewrite = 41186361;

Returns
Type Description
boolean

Whether the pathPrefixRewrite field is set.

hasPathTemplateRewrite()

public boolean hasPathTemplateRewrite()

If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax. A corresponding path_template_match must be specified. Any template variables must exist in the path_template_match field. - -At least one variable must be specified in the path_template_match field - You can omit variables from the rewritten URL - The * and ** operators cannot be matched unless they have a corresponding variable name - e.g. {format=} or {var=}. For example, a path_template_match of /static/{format=} could be rewritten as /static/content/{format} to prefix /content to the URL. Variables can also be re-ordered in a rewrite, so that /{country}/{format}/{suffix=*} can be rewritten as /content/{format}/{country}/{suffix}. At least one non-empty routeRules[].matchRules[].path_template_match is required. Only one of path_prefix_rewrite or path_template_rewrite may be specified.

optional string path_template_rewrite = 423409569;

Returns
Type Description
boolean

Whether the pathTemplateRewrite field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(UrlRewrite other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setField(Descriptors.FieldDescriptor field, Object value)

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

setHostRewrite(String value)

public UrlRewrite.Builder setHostRewrite(String value)

Before forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. The value must be from 1 to 255 characters.

optional string host_rewrite = 159819253;

Parameter
Name Description
value String

The hostRewrite to set.

Returns
Type Description
UrlRewrite.Builder

This builder for chaining.

setHostRewriteBytes(ByteString value)

public UrlRewrite.Builder setHostRewriteBytes(ByteString value)

Before forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. The value must be from 1 to 255 characters.

optional string host_rewrite = 159819253;

Parameter
Name Description
value ByteString

The bytes for hostRewrite to set.

Returns
Type Description
UrlRewrite.Builder

This builder for chaining.

setPathPrefixRewrite(String value)

public UrlRewrite.Builder setPathPrefixRewrite(String value)

Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. The value must be from 1 to 1024 characters.

optional string path_prefix_rewrite = 41186361;

Parameter
Name Description
value String

The pathPrefixRewrite to set.

Returns
Type Description
UrlRewrite.Builder

This builder for chaining.

setPathPrefixRewriteBytes(ByteString value)

public UrlRewrite.Builder setPathPrefixRewriteBytes(ByteString value)

Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. The value must be from 1 to 1024 characters.

optional string path_prefix_rewrite = 41186361;

Parameter
Name Description
value ByteString

The bytes for pathPrefixRewrite to set.

Returns
Type Description
UrlRewrite.Builder

This builder for chaining.

setPathTemplateRewrite(String value)

public UrlRewrite.Builder setPathTemplateRewrite(String value)

If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax. A corresponding path_template_match must be specified. Any template variables must exist in the path_template_match field. - -At least one variable must be specified in the path_template_match field - You can omit variables from the rewritten URL - The * and ** operators cannot be matched unless they have a corresponding variable name - e.g. {format=} or {var=}. For example, a path_template_match of /static/{format=} could be rewritten as /static/content/{format} to prefix /content to the URL. Variables can also be re-ordered in a rewrite, so that /{country}/{format}/{suffix=*} can be rewritten as /content/{format}/{country}/{suffix}. At least one non-empty routeRules[].matchRules[].path_template_match is required. Only one of path_prefix_rewrite or path_template_rewrite may be specified.

optional string path_template_rewrite = 423409569;

Parameter
Name Description
value String

The pathTemplateRewrite to set.

Returns
Type Description
UrlRewrite.Builder

This builder for chaining.

setPathTemplateRewriteBytes(ByteString value)

public UrlRewrite.Builder setPathTemplateRewriteBytes(ByteString value)

If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax. A corresponding path_template_match must be specified. Any template variables must exist in the path_template_match field. - -At least one variable must be specified in the path_template_match field - You can omit variables from the rewritten URL - The * and ** operators cannot be matched unless they have a corresponding variable name - e.g. {format=} or {var=}. For example, a path_template_match of /static/{format=} could be rewritten as /static/content/{format} to prefix /content to the URL. Variables can also be re-ordered in a rewrite, so that /{country}/{format}/{suffix=*} can be rewritten as /content/{format}/{country}/{suffix}. At least one non-empty routeRules[].matchRules[].path_template_match is required. Only one of path_prefix_rewrite or path_template_rewrite may be specified.

optional string path_template_rewrite = 423409569;

Parameter
Name Description
value ByteString

The bytes for pathTemplateRewrite to set.

Returns
Type Description
UrlRewrite.Builder

This builder for chaining.

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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