# Google Cloud Compute V1 API - Class Google::Cloud::Compute::V1::HttpHeaderMatch (v3.7.0)

3.7.0 (latest) 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.22.0 2.21.1 2.20.0 2.19.1 2.18.0 2.17.0 2.16.0 2.15.0 2.14.0 2.13.0 2.12.0 2.11.0 2.10.0 2.9.0 2.8.0 2.7.2 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.0 1.10.0 1.9.0 1.8.0 1.7.1 1.6.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0 0.5.0 Reference documentation and code samples for the Google Cloud Compute V1 API class Google::Cloud::Compute::V1::HttpHeaderMatch.

matchRule criteria for request header matches.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #exact_match

    def exact_match() -> ::String

**Returns**

- (::String) --- The value should exactly match contents of exactMatch.

  Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set.

### #exact_match=

    def exact_match=(value) -> ::String

**Parameter**

- **value** (::String) --- The value should exactly match contents of exactMatch.


  Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set.
**Returns**

- (::String) --- The value should exactly match contents of exactMatch.

  Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set.

### #header_name

    def header_name() -> ::String

**Returns**

- (::String) --- The name of the HTTP header to match.

  For matching against the HTTP request's authority, use a headerMatch
  with the header name ":authority".

  For matching a request's method, use the headerName ":method".

  When the URL map is bound to a target gRPC proxy that has
  the validateForProxyless field set to true, only
  non-binary
  user-specified custom metadata and the `content-type` header are supported.
  The following transport-level headers cannot be used in header matching
  rules:
  `:authority`, `:method`, `:path`, `:scheme`, `user-agent`,
  `accept-encoding`, `content-encoding`, `grpc-accept-encoding`,
  `grpc-encoding`, `grpc-previous-rpc-attempts`, `grpc-tags-bin`,
  `grpc-timeout` and `grpc-trace-bin`.

### #header_name=

    def header_name=(value) -> ::String

**Parameter**

- **value** (::String) --- The name of the HTTP header to match.


  For matching against the HTTP request's authority, use a headerMatch
  with the header name ":authority".

  For matching a request's method, use the headerName ":method".

  When the URL map is bound to a target gRPC proxy that has
  the validateForProxyless field set to true, only
  non-binary
  user-specified custom metadata and the `content-type` header are supported.
  The following transport-level headers cannot be used in header matching
  rules:
  `:authority`, `:method`, `:path`, `:scheme`, `user-agent`,
  `accept-encoding`, `content-encoding`, `grpc-accept-encoding`,
  `grpc-encoding`, `grpc-previous-rpc-attempts`, `grpc-tags-bin`,
  `grpc-timeout` and `grpc-trace-bin`.
**Returns**

- (::String) --- The name of the HTTP header to match.

  For matching against the HTTP request's authority, use a headerMatch
  with the header name ":authority".

  For matching a request's method, use the headerName ":method".

  When the URL map is bound to a target gRPC proxy that has
  the validateForProxyless field set to true, only
  non-binary
  user-specified custom metadata and the `content-type` header are supported.
  The following transport-level headers cannot be used in header matching
  rules:
  `:authority`, `:method`, `:path`, `:scheme`, `user-agent`,
  `accept-encoding`, `content-encoding`, `grpc-accept-encoding`,
  `grpc-encoding`, `grpc-previous-rpc-attempts`, `grpc-tags-bin`,
  `grpc-timeout` and `grpc-trace-bin`.

### #invert_match

    def invert_match() -> ::Boolean

**Returns**

- (::Boolean) --- If set to false, the headerMatch is considered a match if the preceding match criteria are met. If set to true, the headerMatch is considered a match if the preceding match criteria are NOT met.

  The default setting is false.

### #invert_match=

    def invert_match=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- If set to false, the headerMatch is considered a match if the preceding match criteria are met. If set to true, the headerMatch is considered a match if the preceding match criteria are NOT met.


  The default setting is false.
**Returns**

- (::Boolean) --- If set to false, the headerMatch is considered a match if the preceding match criteria are met. If set to true, the headerMatch is considered a match if the preceding match criteria are NOT met.

  The default setting is false.

### #prefix_match

    def prefix_match() -> ::String

**Returns**

- (::String) --- The value of the header must start with the contents ofprefixMatch.

  Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set.

### #prefix_match=

    def prefix_match=(value) -> ::String

**Parameter**

- **value** (::String) --- The value of the header must start with the contents ofprefixMatch.


  Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set.
**Returns**

- (::String) --- The value of the header must start with the contents ofprefixMatch.

  Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set.

### #present_match

    def present_match() -> ::Boolean

**Returns**

- (::Boolean) --- A header with the contents of headerName must exist. The match takes place whether or not the request's header has a value.

  Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set.

### #present_match=

    def present_match=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- A header with the contents of headerName must exist. The match takes place whether or not the request's header has a value.


  Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set.
**Returns**

- (::Boolean) --- A header with the contents of headerName must exist. The match takes place whether or not the request's header has a value.

  Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set.

### #range_match

    def range_match() -> ::Google::Cloud::Compute::V1::Int64RangeMatch

**Returns**

- ([::Google::Cloud::Compute::V1::Int64RangeMatch](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Int64RangeMatch)) --- The header value must be an integer and its value must be in the range specified in rangeMatch. If the header does not contain an integer, number or is empty, the match fails.


  For example for a range \[-5, 0\]

        - -3 will match.
        - 0 will not match.
        - 0.25 will not match.
        - -3someString will not match.

  Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set.

  rangeMatch is not supported for load balancers
  that have loadBalancingScheme set to EXTERNAL.

### #range_match=

    def range_match=(value) -> ::Google::Cloud::Compute::V1::Int64RangeMatch

**Parameter**

- **value** ([::Google::Cloud::Compute::V1::Int64RangeMatch](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Int64RangeMatch)) --- The header value must be an integer and its value must be in the range specified in rangeMatch. If the header does not contain an integer, number or is empty, the match fails.


  For example for a range \[-5, 0\]

        - -3 will match.
        - 0 will not match.
        - 0.25 will not match.
        - -3someString will not match.

  Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set.

  rangeMatch is not supported for load balancers
  that have loadBalancingScheme set to EXTERNAL.
**Returns**

- ([::Google::Cloud::Compute::V1::Int64RangeMatch](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Int64RangeMatch)) --- The header value must be an integer and its value must be in the range specified in rangeMatch. If the header does not contain an integer, number or is empty, the match fails.


  For example for a range \[-5, 0\]

        - -3 will match.
        - 0 will not match.
        - 0.25 will not match.
        - -3someString will not match.

  Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set.

  rangeMatch is not supported for load balancers
  that have loadBalancingScheme set to EXTERNAL.

### #regex_match

    def regex_match() -> ::String

**Returns**

- (::String) --- The value of the header must match the regular expression specified inregexMatch. For more information about regular expression syntax, see Syntax.

  For matching against a port specified in the HTTP request, use a
  headerMatch with headerName set to PORT and a regular expression that
  satisfies the RFC2616 Host header's port specifier.

  Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set.

  Regular expressions can only be used when the loadBalancingScheme is
  set to INTERNAL_SELF_MANAGED, EXTERNAL_MANAGED
  (regional scope) or INTERNAL_MANAGED.

### #regex_match=

    def regex_match=(value) -> ::String

**Parameter**

- **value** (::String) --- The value of the header must match the regular expression specified inregexMatch. For more information about regular expression syntax, see Syntax.


  For matching against a port specified in the HTTP request, use a
  headerMatch with headerName set to PORT and a regular expression that
  satisfies the RFC2616 Host header's port specifier.

  Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set.

  Regular expressions can only be used when the loadBalancingScheme is
  set to INTERNAL_SELF_MANAGED, EXTERNAL_MANAGED
  (regional scope) or INTERNAL_MANAGED.
**Returns**

- (::String) --- The value of the header must match the regular expression specified inregexMatch. For more information about regular expression syntax, see Syntax.

  For matching against a port specified in the HTTP request, use a
  headerMatch with headerName set to PORT and a regular expression that
  satisfies the RFC2616 Host header's port specifier.

  Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set.

  Regular expressions can only be used when the loadBalancingScheme is
  set to INTERNAL_SELF_MANAGED, EXTERNAL_MANAGED
  (regional scope) or INTERNAL_MANAGED.

### #suffix_match

    def suffix_match() -> ::String

**Returns**

- (::String) --- The value of the header must end with the contents ofsuffixMatch.

  Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set.

### #suffix_match=

    def suffix_match=(value) -> ::String

**Parameter**

- **value** (::String) --- The value of the header must end with the contents ofsuffixMatch.


  Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set.
**Returns**

- (::String) --- The value of the header must end with the contents ofsuffixMatch.

  Only one of exactMatch, prefixMatch,suffixMatch, regexMatch,presentMatch or rangeMatch must be set.