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

namespace Google\Ads\GoogleAds\V20\Common;

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

/**
 * Flexible rule that wraps the common rule and a lookback window.
 *
 * Generated from protobuf message <code>google.ads.googleads.v20.common.FlexibleRuleOperandInfo</code>
 */
class FlexibleRuleOperandInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * List of rule item groups that defines this rule.
     * Rule item groups are grouped together.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.common.UserListRuleInfo rule = 1;</code>
     */
    protected $rule = null;
    /**
     * Lookback window for this rule in days. From now until X days ago.
     *
     * Generated from protobuf field <code>optional int64 lookback_window_days = 2;</code>
     */
    protected $lookback_window_days = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Ads\GoogleAds\V20\Common\UserListRuleInfo $rule
     *           List of rule item groups that defines this rule.
     *           Rule item groups are grouped together.
     *     @type int|string $lookback_window_days
     *           Lookback window for this rule in days. From now until X days ago.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V20\Common\UserLists::initOnce();
        parent::__construct($data);
    }

    /**
     * List of rule item groups that defines this rule.
     * Rule item groups are grouped together.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.common.UserListRuleInfo rule = 1;</code>
     * @return \Google\Ads\GoogleAds\V20\Common\UserListRuleInfo|null
     */
    public function getRule()
    {
        return $this->rule;
    }

    public function hasRule()
    {
        return isset($this->rule);
    }

    public function clearRule()
    {
        unset($this->rule);
    }

    /**
     * List of rule item groups that defines this rule.
     * Rule item groups are grouped together.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.common.UserListRuleInfo rule = 1;</code>
     * @param \Google\Ads\GoogleAds\V20\Common\UserListRuleInfo $var
     * @return $this
     */
    public function setRule($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V20\Common\UserListRuleInfo::class);
        $this->rule = $var;

        return $this;
    }

    /**
     * Lookback window for this rule in days. From now until X days ago.
     *
     * Generated from protobuf field <code>optional int64 lookback_window_days = 2;</code>
     * @return int|string
     */
    public function getLookbackWindowDays()
    {
        return isset($this->lookback_window_days) ? $this->lookback_window_days : 0;
    }

    public function hasLookbackWindowDays()
    {
        return isset($this->lookback_window_days);
    }

    public function clearLookbackWindowDays()
    {
        unset($this->lookback_window_days);
    }

    /**
     * Lookback window for this rule in days. From now until X days ago.
     *
     * Generated from protobuf field <code>optional int64 lookback_window_days = 2;</code>
     * @param int|string $var
     * @return $this
     */
    public function setLookbackWindowDays($var)
    {
        GPBUtil::checkInt64($var);
        $this->lookback_window_days = $var;

        return $this;
    }

}

