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

namespace Google\Cloud\CapacityPlanner\V1beta;

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

/**
 * CapacityPlanView contains the capacity plan key and the time series views.
 *
 * Generated from protobuf message <code>google.cloud.capacityplanner.v1beta.CapacityPlanView</code>
 */
class CapacityPlanView extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The capacity plan key associated with the capacity plan view.
     *
     * Generated from protobuf field <code>.google.cloud.capacityplanner.v1beta.CapacityPlanKey key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $key = null;
    /**
     * Required. The time series views associated with the capacity plan view.
     *
     * Generated from protobuf field <code>repeated .google.cloud.capacityplanner.v1beta.TimeSeriesView time_series_views = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $time_series_views;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\CapacityPlanner\V1beta\CapacityPlanKey $key
     *           Required. The capacity plan key associated with the capacity plan view.
     *     @type array<\Google\Cloud\CapacityPlanner\V1beta\TimeSeriesView>|\Google\Protobuf\Internal\RepeatedField $time_series_views
     *           Required. The time series views associated with the capacity plan view.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Capacityplanner\V1Beta\CapacityPlanningService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The capacity plan key associated with the capacity plan view.
     *
     * Generated from protobuf field <code>.google.cloud.capacityplanner.v1beta.CapacityPlanKey key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\CapacityPlanner\V1beta\CapacityPlanKey|null
     */
    public function getKey()
    {
        return $this->key;
    }

    public function hasKey()
    {
        return isset($this->key);
    }

    public function clearKey()
    {
        unset($this->key);
    }

    /**
     * Required. The capacity plan key associated with the capacity plan view.
     *
     * Generated from protobuf field <code>.google.cloud.capacityplanner.v1beta.CapacityPlanKey key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\CapacityPlanner\V1beta\CapacityPlanKey $var
     * @return $this
     */
    public function setKey($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\CapacityPlanner\V1beta\CapacityPlanKey::class);
        $this->key = $var;

        return $this;
    }

    /**
     * Required. The time series views associated with the capacity plan view.
     *
     * Generated from protobuf field <code>repeated .google.cloud.capacityplanner.v1beta.TimeSeriesView time_series_views = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getTimeSeriesViews()
    {
        return $this->time_series_views;
    }

    /**
     * Required. The time series views associated with the capacity plan view.
     *
     * Generated from protobuf field <code>repeated .google.cloud.capacityplanner.v1beta.TimeSeriesView time_series_views = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param array<\Google\Cloud\CapacityPlanner\V1beta\TimeSeriesView>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setTimeSeriesViews($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\CapacityPlanner\V1beta\TimeSeriesView::class);
        $this->time_series_views = $arr;

        return $this;
    }

}

