<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/networkservices/v1/http_route.proto

namespace Google\Cloud\NetworkServices\V1\HttpRoute;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * The specification for modifying the URL of the request, prior to forwarding
 * the request to the destination.
 *
 * Generated from protobuf message <code>google.cloud.networkservices.v1.HttpRoute.URLRewrite</code>
 */
class URLRewrite extends \Google\Protobuf\Internal\Message
{
    /**
     * Prior to forwarding the request to the selected destination, the matching
     * portion of the requests path is replaced by this value.
     *
     * Generated from protobuf field <code>string path_prefix_rewrite = 1;</code>
     */
    protected $path_prefix_rewrite = '';
    /**
     * Prior to forwarding the request to the selected destination, the requests
     * host header is replaced by this value.
     *
     * Generated from protobuf field <code>string host_rewrite = 2;</code>
     */
    protected $host_rewrite = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $path_prefix_rewrite
     *           Prior to forwarding the request to the selected destination, the matching
     *           portion of the requests path is replaced by this value.
     *     @type string $host_rewrite
     *           Prior to forwarding the request to the selected destination, the requests
     *           host header is replaced by this value.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Networkservices\V1\HttpRoute::initOnce();
        parent::__construct($data);
    }

    /**
     * Prior to forwarding the request to the selected destination, the matching
     * portion of the requests path is replaced by this value.
     *
     * Generated from protobuf field <code>string path_prefix_rewrite = 1;</code>
     * @return string
     */
    public function getPathPrefixRewrite()
    {
        return $this->path_prefix_rewrite;
    }

    /**
     * Prior to forwarding the request to the selected destination, the matching
     * portion of the requests path is replaced by this value.
     *
     * Generated from protobuf field <code>string path_prefix_rewrite = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setPathPrefixRewrite($var)
    {
        GPBUtil::checkString($var, True);
        $this->path_prefix_rewrite = $var;

        return $this;
    }

    /**
     * Prior to forwarding the request to the selected destination, the requests
     * host header is replaced by this value.
     *
     * Generated from protobuf field <code>string host_rewrite = 2;</code>
     * @return string
     */
    public function getHostRewrite()
    {
        return $this->host_rewrite;
    }

    /**
     * Prior to forwarding the request to the selected destination, the requests
     * host header is replaced by this value.
     *
     * Generated from protobuf field <code>string host_rewrite = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setHostRewrite($var)
    {
        GPBUtil::checkString($var, True);
        $this->host_rewrite = $var;

        return $this;
    }

}


