<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/analytics/admin/v1alpha/resources.proto

namespace Google\Analytics\Admin\V1alpha;

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

/**
 * Settings for a SKAdNetwork conversion postback window.
 *
 * Generated from protobuf message <code>google.analytics.admin.v1alpha.PostbackWindow</code>
 */
class PostbackWindow extends \Google\Protobuf\Internal\Message
{
    /**
     * Ordering of the repeated field will be used to prioritize the conversion
     * value settings. Lower indexed entries are prioritized higher. The first
     * conversion value setting that evaluates to true will be selected. It must
     * have at least one entry if enable_postback_window_settings is set to
     * true. It can have maximum of 128 entries.
     *
     * Generated from protobuf field <code>repeated .google.analytics.admin.v1alpha.ConversionValues conversion_values = 1;</code>
     */
    private $conversion_values;
    /**
     * If enable_postback_window_settings is true, conversion_values
     * must be populated and will be used for determining when and how to set the
     * Conversion Value on a client device and exporting schema to linked Ads
     * accounts. If false, the settings are not used, but are retained in case
     * they may be used in the future. This must always be true for
     * postback_window_one.
     *
     * Generated from protobuf field <code>bool postback_window_settings_enabled = 2;</code>
     */
    private $postback_window_settings_enabled = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Analytics\Admin\V1alpha\ConversionValues>|\Google\Protobuf\Internal\RepeatedField $conversion_values
     *           Ordering of the repeated field will be used to prioritize the conversion
     *           value settings. Lower indexed entries are prioritized higher. The first
     *           conversion value setting that evaluates to true will be selected. It must
     *           have at least one entry if enable_postback_window_settings is set to
     *           true. It can have maximum of 128 entries.
     *     @type bool $postback_window_settings_enabled
     *           If enable_postback_window_settings is true, conversion_values
     *           must be populated and will be used for determining when and how to set the
     *           Conversion Value on a client device and exporting schema to linked Ads
     *           accounts. If false, the settings are not used, but are retained in case
     *           they may be used in the future. This must always be true for
     *           postback_window_one.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Analytics\Admin\V1Alpha\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * Ordering of the repeated field will be used to prioritize the conversion
     * value settings. Lower indexed entries are prioritized higher. The first
     * conversion value setting that evaluates to true will be selected. It must
     * have at least one entry if enable_postback_window_settings is set to
     * true. It can have maximum of 128 entries.
     *
     * Generated from protobuf field <code>repeated .google.analytics.admin.v1alpha.ConversionValues conversion_values = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getConversionValues()
    {
        return $this->conversion_values;
    }

    /**
     * Ordering of the repeated field will be used to prioritize the conversion
     * value settings. Lower indexed entries are prioritized higher. The first
     * conversion value setting that evaluates to true will be selected. It must
     * have at least one entry if enable_postback_window_settings is set to
     * true. It can have maximum of 128 entries.
     *
     * Generated from protobuf field <code>repeated .google.analytics.admin.v1alpha.ConversionValues conversion_values = 1;</code>
     * @param array<\Google\Analytics\Admin\V1alpha\ConversionValues>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setConversionValues($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Admin\V1alpha\ConversionValues::class);
        $this->conversion_values = $arr;

        return $this;
    }

    /**
     * If enable_postback_window_settings is true, conversion_values
     * must be populated and will be used for determining when and how to set the
     * Conversion Value on a client device and exporting schema to linked Ads
     * accounts. If false, the settings are not used, but are retained in case
     * they may be used in the future. This must always be true for
     * postback_window_one.
     *
     * Generated from protobuf field <code>bool postback_window_settings_enabled = 2;</code>
     * @return bool
     */
    public function getPostbackWindowSettingsEnabled()
    {
        return $this->postback_window_settings_enabled;
    }

    /**
     * If enable_postback_window_settings is true, conversion_values
     * must be populated and will be used for determining when and how to set the
     * Conversion Value on a client device and exporting schema to linked Ads
     * accounts. If false, the settings are not used, but are retained in case
     * they may be used in the future. This must always be true for
     * postback_window_one.
     *
     * Generated from protobuf field <code>bool postback_window_settings_enabled = 2;</code>
     * @param bool $var
     * @return $this
     */
    public function setPostbackWindowSettingsEnabled($var)
    {
        GPBUtil::checkBool($var);
        $this->postback_window_settings_enabled = $var;

        return $this;
    }

}

