<?php
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/ads/googleads/v24/common/criteria.proto

namespace Google\Ads\GoogleAds\V24\Common;

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

/**
 * An IpBlock criterion used for excluding IP addresses.
 * We support excluding individual IP addresses or CIDR blocks. Create one
 * IpBlockInfo criterion for each individual IP address or CIDR block you want
 * to exclude. You can exclude up to 500 IP addresses per campaign. For more
 * details, see
 * [Exclude IP addresses](//support.google.com/google-ads/answer/2456098).
 * IPv4 examples:
 *  * Individual address: 192.168.0.1
 *  * Individual address as CIDR block: 192.168.0.1/32
 *  * CIDR block: 192.168.0.0/24
 * IPv6 examples:
 *  * Individual address: 2001:db8:a0b:12f0::1
 *  * Individual address as CIDR block: 2001:db8:a0b:12f0::1/128
 *  * CIDR block: 2001:db8::/48
 *
 * Generated from protobuf message <code>google.ads.googleads.v24.common.IpBlockInfo</code>
 */
class IpBlockInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * The IP address or the CIDR block to be excluded.
     *
     * Generated from protobuf field <code>optional string ip_address = 2;</code>
     */
    protected $ip_address = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *                    Optional. Data for populating the Message object.
     *
     * @type string $ip_address
     *           The IP address or the CIDR block to be excluded.
     * }
     */
    public function __construct($data = null)
    {
        \GPBMetadata\Google\Ads\GoogleAds\V24\Common\Criteria::initOnce();
        parent::__construct($data);
    }

    /**
     * The IP address or the CIDR block to be excluded.
     *
     * Generated from protobuf field <code>optional string ip_address = 2;</code>
     *
     * @return string
     */
    public function getIpAddress()
    {
        return isset($this->ip_address) ? $this->ip_address : '';
    }

    public function hasIpAddress()
    {
        return isset($this->ip_address);
    }

    public function clearIpAddress()
    {
        unset($this->ip_address);
    }

    /**
     * The IP address or the CIDR block to be excluded.
     *
     * Generated from protobuf field <code>optional string ip_address = 2;</code>
     *
     * @param  string $var
     * @return $this
     */
    public function setIpAddress($var)
    {
        GPBUtil::checkString($var, true);
        $this->ip_address = $var;

        return $this;
    }

}

