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

namespace Google\Cloud\NetworkConnectivity\V1\PolicyBasedRoute;

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

/**
 * Filter matches L4 traffic.
 *
 * Generated from protobuf message <code>google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter</code>
 */
class Filter extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. The IP protocol that this policy based route applies to. Valid
     * values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
     *
     * Generated from protobuf field <code>string ip_protocol = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $ip_protocol = '';
    /**
     * Optional. The source IP range of outgoing packets that this policy based
     * route applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
     *
     * Generated from protobuf field <code>string src_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $src_range = '';
    /**
     * Optional. The destination IP range of outgoing packets that this policy
     * based route applies to. Default is "0.0.0.0/0" if protocol version is
     * IPv4.
     *
     * Generated from protobuf field <code>string dest_range = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $dest_range = '';
    /**
     * Required. Internet protocol versions this policy based route applies to.
     * For this version, only IPV4 is supported.
     *
     * Generated from protobuf field <code>.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion protocol_version = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $protocol_version = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $ip_protocol
     *           Optional. The IP protocol that this policy based route applies to. Valid
     *           values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
     *     @type string $src_range
     *           Optional. The source IP range of outgoing packets that this policy based
     *           route applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
     *     @type string $dest_range
     *           Optional. The destination IP range of outgoing packets that this policy
     *           based route applies to. Default is "0.0.0.0/0" if protocol version is
     *           IPv4.
     *     @type int $protocol_version
     *           Required. Internet protocol versions this policy based route applies to.
     *           For this version, only IPV4 is supported.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Networkconnectivity\V1\PolicyBasedRouting::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. The IP protocol that this policy based route applies to. Valid
     * values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
     *
     * Generated from protobuf field <code>string ip_protocol = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getIpProtocol()
    {
        return $this->ip_protocol;
    }

    /**
     * Optional. The IP protocol that this policy based route applies to. Valid
     * values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
     *
     * Generated from protobuf field <code>string ip_protocol = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setIpProtocol($var)
    {
        GPBUtil::checkString($var, True);
        $this->ip_protocol = $var;

        return $this;
    }

    /**
     * Optional. The source IP range of outgoing packets that this policy based
     * route applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
     *
     * Generated from protobuf field <code>string src_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getSrcRange()
    {
        return $this->src_range;
    }

    /**
     * Optional. The source IP range of outgoing packets that this policy based
     * route applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
     *
     * Generated from protobuf field <code>string src_range = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setSrcRange($var)
    {
        GPBUtil::checkString($var, True);
        $this->src_range = $var;

        return $this;
    }

    /**
     * Optional. The destination IP range of outgoing packets that this policy
     * based route applies to. Default is "0.0.0.0/0" if protocol version is
     * IPv4.
     *
     * Generated from protobuf field <code>string dest_range = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDestRange()
    {
        return $this->dest_range;
    }

    /**
     * Optional. The destination IP range of outgoing packets that this policy
     * based route applies to. Default is "0.0.0.0/0" if protocol version is
     * IPv4.
     *
     * Generated from protobuf field <code>string dest_range = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDestRange($var)
    {
        GPBUtil::checkString($var, True);
        $this->dest_range = $var;

        return $this;
    }

    /**
     * Required. Internet protocol versions this policy based route applies to.
     * For this version, only IPV4 is supported.
     *
     * Generated from protobuf field <code>.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion protocol_version = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getProtocolVersion()
    {
        return $this->protocol_version;
    }

    /**
     * Required. Internet protocol versions this policy based route applies to.
     * For this version, only IPV4 is supported.
     *
     * Generated from protobuf field <code>.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion protocol_version = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setProtocolVersion($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\NetworkConnectivity\V1\PolicyBasedRoute\Filter\ProtocolVersion::class);
        $this->protocol_version = $var;

        return $this;
    }

}


