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

namespace Google\Analytics\Data\V1alpha;

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

/**
 * Describes date range for a cohort report.
 *
 * Generated from protobuf message <code>google.analytics.data.v1alpha.CohortsRange</code>
 */
class CohortsRange extends \Google\Protobuf\Internal\Message
{
    /**
     * Reporting date range for each cohort is calculated based on these three
     * fields.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.CohortsRange.Granularity granularity = 1;</code>
     */
    private $granularity = 0;
    /**
     * For daily cohorts, this will be the start day offset.
     * For weekly cohorts, this will be the week offset.
     *
     * Generated from protobuf field <code>int32 start_offset = 2;</code>
     */
    private $start_offset = 0;
    /**
     * For daily cohorts, this will be the end day offset.
     * For weekly cohorts, this will be the week offset.
     *
     * Generated from protobuf field <code>int32 end_offset = 3;</code>
     */
    private $end_offset = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $granularity
     *           Reporting date range for each cohort is calculated based on these three
     *           fields.
     *     @type int $start_offset
     *           For daily cohorts, this will be the start day offset.
     *           For weekly cohorts, this will be the week offset.
     *     @type int $end_offset
     *           For daily cohorts, this will be the end day offset.
     *           For weekly cohorts, this will be the week offset.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce();
        parent::__construct($data);
    }

    /**
     * Reporting date range for each cohort is calculated based on these three
     * fields.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.CohortsRange.Granularity granularity = 1;</code>
     * @return int
     */
    public function getGranularity()
    {
        return $this->granularity;
    }

    /**
     * Reporting date range for each cohort is calculated based on these three
     * fields.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.CohortsRange.Granularity granularity = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setGranularity($var)
    {
        GPBUtil::checkEnum($var, \Google\Analytics\Data\V1alpha\CohortsRange\Granularity::class);
        $this->granularity = $var;

        return $this;
    }

    /**
     * For daily cohorts, this will be the start day offset.
     * For weekly cohorts, this will be the week offset.
     *
     * Generated from protobuf field <code>int32 start_offset = 2;</code>
     * @return int
     */
    public function getStartOffset()
    {
        return $this->start_offset;
    }

    /**
     * For daily cohorts, this will be the start day offset.
     * For weekly cohorts, this will be the week offset.
     *
     * Generated from protobuf field <code>int32 start_offset = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setStartOffset($var)
    {
        GPBUtil::checkInt32($var);
        $this->start_offset = $var;

        return $this;
    }

    /**
     * For daily cohorts, this will be the end day offset.
     * For weekly cohorts, this will be the week offset.
     *
     * Generated from protobuf field <code>int32 end_offset = 3;</code>
     * @return int
     */
    public function getEndOffset()
    {
        return $this->end_offset;
    }

    /**
     * For daily cohorts, this will be the end day offset.
     * For weekly cohorts, this will be the week offset.
     *
     * Generated from protobuf field <code>int32 end_offset = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setEndOffset($var)
    {
        GPBUtil::checkInt32($var);
        $this->end_offset = $var;

        return $this;
    }

}

