Class UrlRewrite.Builder (1.51.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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public UrlRewrite build()
Returns
TypeDescription
UrlRewrite

buildPartial()

public UrlRewrite buildPartial()
Returns
TypeDescription
UrlRewrite

clear()

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

clearField(Descriptors.FieldDescriptor field)

public UrlRewrite.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
UrlRewrite.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public UrlRewrite.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
UrlRewrite.Builder

This builder for chaining.

clone()

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

getDefaultInstanceForType()

public UrlRewrite getDefaultInstanceForType()
Returns
TypeDescription
UrlRewrite

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

Whether the pathTemplateRewrite field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(UrlRewrite other)

public UrlRewrite.Builder mergeFrom(UrlRewrite other)
Parameter
NameDescription
otherUrlRewrite
Returns
TypeDescription
UrlRewrite.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setField(Descriptors.FieldDescriptor field, Object value)

public UrlRewrite.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueString

The hostRewrite to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for hostRewrite to set.

Returns
TypeDescription
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
NameDescription
valueString

The pathPrefixRewrite to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for pathPrefixRewrite to set.

Returns
TypeDescription
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
NameDescription
valueString

The pathTemplateRewrite to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for pathTemplateRewrite to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
UrlRewrite.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

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