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

namespace Google\Cloud\RecaptchaEnterprise\V1;

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

/**
 * Information about the IP or IP range override.
 *
 * Generated from protobuf message <code>google.cloud.recaptchaenterprise.v1.IpOverrideData</code>
 */
class IpOverrideData extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The IP address to override (can be IPv4, IPv6 or CIDR).
     * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range.
     * The IP override must be a public IP address.
     * Example of IPv4: 168.192.5.6
     * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B
     * Example of IPv4 with CIDR: 168.192.5.0/24
     * Example of IPv6 with CIDR: 2001:0DB8:1234::/48
     *
     * Generated from protobuf field <code>string ip = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = {</code>
     */
    protected $ip = '';
    /**
     * Required. Describes the type of IP override.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType override_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $override_type = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $ip
     *           Required. The IP address to override (can be IPv4, IPv6 or CIDR).
     *           The IP override must be a valid IPv4 or IPv6 address, or a CIDR range.
     *           The IP override must be a public IP address.
     *           Example of IPv4: 168.192.5.6
     *           Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B
     *           Example of IPv4 with CIDR: 168.192.5.0/24
     *           Example of IPv6 with CIDR: 2001:0DB8:1234::/48
     *     @type int $override_type
     *           Required. Describes the type of IP override.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The IP address to override (can be IPv4, IPv6 or CIDR).
     * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range.
     * The IP override must be a public IP address.
     * Example of IPv4: 168.192.5.6
     * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B
     * Example of IPv4 with CIDR: 168.192.5.0/24
     * Example of IPv6 with CIDR: 2001:0DB8:1234::/48
     *
     * Generated from protobuf field <code>string ip = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = {</code>
     * @return string
     */
    public function getIp()
    {
        return $this->ip;
    }

    /**
     * Required. The IP address to override (can be IPv4, IPv6 or CIDR).
     * The IP override must be a valid IPv4 or IPv6 address, or a CIDR range.
     * The IP override must be a public IP address.
     * Example of IPv4: 168.192.5.6
     * Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B
     * Example of IPv4 with CIDR: 168.192.5.0/24
     * Example of IPv6 with CIDR: 2001:0DB8:1234::/48
     *
     * Generated from protobuf field <code>string ip = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = {</code>
     * @param string $var
     * @return $this
     */
    public function setIp($var)
    {
        GPBUtil::checkString($var, True);
        $this->ip = $var;

        return $this;
    }

    /**
     * Required. Describes the type of IP override.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType override_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getOverrideType()
    {
        return $this->override_type;
    }

    /**
     * Required. Describes the type of IP override.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType override_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setOverrideType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData\OverrideType::class);
        $this->override_type = $var;

        return $this;
    }

}

