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

namespace Google\Cloud\CapacityPlanner\V1beta;

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

/**
 * Response entity for reservations data.
 *
 * Generated from protobuf message <code>google.cloud.capacityplanner.v1beta.ReservationData</code>
 */
class ReservationData extends \Google\Protobuf\Internal\Message
{
    /**
     * Identifier. The resource name of the connection in the form of:
     * `projects/{project_id}/locations/{location_id}/reservations/{reservation_id}`
     * or
     * `organizations/{organization_id}/locations/{location_id}/reservations/{reservation_id}`
     * or
     * `folders/{folder_id}/locations/{location_id}/reservations/{reservation_id}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     */
    protected $name = '';
    /**
     * The collection of data points that represent the aggregated reserved value
     * for reservations filtered by the criteria.
     *
     * Generated from protobuf field <code>.google.cloud.capacityplanner.v1beta.TimeSeries time_series = 2;</code>
     */
    protected $time_series = null;
    /**
     * The collection of data points that represent the aggregated used value for
     * reservations filtered by the criteria.
     *
     * Generated from protobuf field <code>.google.cloud.capacityplanner.v1beta.TimeSeries used_reservation_values = 5;</code>
     */
    protected $used_reservation_values = null;
    /**
     * Future reservations filtered by the criteria.
     *
     * Generated from protobuf field <code>repeated .google.cloud.capacityplanner.v1beta.FutureReservation future_reservations = 3;</code>
     */
    private $future_reservations;
    /**
     * Allocations filtered by the criteria.
     *
     * Generated from protobuf field <code>repeated .google.cloud.capacityplanner.v1beta.Allocation allocations = 4;</code>
     */
    private $allocations;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Identifier. The resource name of the connection in the form of:
     *           `projects/{project_id}/locations/{location_id}/reservations/{reservation_id}`
     *           or
     *           `organizations/{organization_id}/locations/{location_id}/reservations/{reservation_id}`
     *           or
     *           `folders/{folder_id}/locations/{location_id}/reservations/{reservation_id}`
     *     @type \Google\Cloud\CapacityPlanner\V1beta\TimeSeries $time_series
     *           The collection of data points that represent the aggregated reserved value
     *           for reservations filtered by the criteria.
     *     @type \Google\Cloud\CapacityPlanner\V1beta\TimeSeries $used_reservation_values
     *           The collection of data points that represent the aggregated used value for
     *           reservations filtered by the criteria.
     *     @type array<\Google\Cloud\CapacityPlanner\V1beta\FutureReservation>|\Google\Protobuf\Internal\RepeatedField $future_reservations
     *           Future reservations filtered by the criteria.
     *     @type array<\Google\Cloud\CapacityPlanner\V1beta\Allocation>|\Google\Protobuf\Internal\RepeatedField $allocations
     *           Allocations filtered by the criteria.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Capacityplanner\V1Beta\UsageService::initOnce();
        parent::__construct($data);
    }

    /**
     * Identifier. The resource name of the connection in the form of:
     * `projects/{project_id}/locations/{location_id}/reservations/{reservation_id}`
     * or
     * `organizations/{organization_id}/locations/{location_id}/reservations/{reservation_id}`
     * or
     * `folders/{folder_id}/locations/{location_id}/reservations/{reservation_id}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Identifier. The resource name of the connection in the form of:
     * `projects/{project_id}/locations/{location_id}/reservations/{reservation_id}`
     * or
     * `organizations/{organization_id}/locations/{location_id}/reservations/{reservation_id}`
     * or
     * `folders/{folder_id}/locations/{location_id}/reservations/{reservation_id}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * The collection of data points that represent the aggregated reserved value
     * for reservations filtered by the criteria.
     *
     * Generated from protobuf field <code>.google.cloud.capacityplanner.v1beta.TimeSeries time_series = 2;</code>
     * @return \Google\Cloud\CapacityPlanner\V1beta\TimeSeries|null
     */
    public function getTimeSeries()
    {
        return $this->time_series;
    }

    public function hasTimeSeries()
    {
        return isset($this->time_series);
    }

    public function clearTimeSeries()
    {
        unset($this->time_series);
    }

    /**
     * The collection of data points that represent the aggregated reserved value
     * for reservations filtered by the criteria.
     *
     * Generated from protobuf field <code>.google.cloud.capacityplanner.v1beta.TimeSeries time_series = 2;</code>
     * @param \Google\Cloud\CapacityPlanner\V1beta\TimeSeries $var
     * @return $this
     */
    public function setTimeSeries($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\CapacityPlanner\V1beta\TimeSeries::class);
        $this->time_series = $var;

        return $this;
    }

    /**
     * The collection of data points that represent the aggregated used value for
     * reservations filtered by the criteria.
     *
     * Generated from protobuf field <code>.google.cloud.capacityplanner.v1beta.TimeSeries used_reservation_values = 5;</code>
     * @return \Google\Cloud\CapacityPlanner\V1beta\TimeSeries|null
     */
    public function getUsedReservationValues()
    {
        return $this->used_reservation_values;
    }

    public function hasUsedReservationValues()
    {
        return isset($this->used_reservation_values);
    }

    public function clearUsedReservationValues()
    {
        unset($this->used_reservation_values);
    }

    /**
     * The collection of data points that represent the aggregated used value for
     * reservations filtered by the criteria.
     *
     * Generated from protobuf field <code>.google.cloud.capacityplanner.v1beta.TimeSeries used_reservation_values = 5;</code>
     * @param \Google\Cloud\CapacityPlanner\V1beta\TimeSeries $var
     * @return $this
     */
    public function setUsedReservationValues($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\CapacityPlanner\V1beta\TimeSeries::class);
        $this->used_reservation_values = $var;

        return $this;
    }

    /**
     * Future reservations filtered by the criteria.
     *
     * Generated from protobuf field <code>repeated .google.cloud.capacityplanner.v1beta.FutureReservation future_reservations = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getFutureReservations()
    {
        return $this->future_reservations;
    }

    /**
     * Future reservations filtered by the criteria.
     *
     * Generated from protobuf field <code>repeated .google.cloud.capacityplanner.v1beta.FutureReservation future_reservations = 3;</code>
     * @param array<\Google\Cloud\CapacityPlanner\V1beta\FutureReservation>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setFutureReservations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\CapacityPlanner\V1beta\FutureReservation::class);
        $this->future_reservations = $arr;

        return $this;
    }

    /**
     * Allocations filtered by the criteria.
     *
     * Generated from protobuf field <code>repeated .google.cloud.capacityplanner.v1beta.Allocation allocations = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAllocations()
    {
        return $this->allocations;
    }

    /**
     * Allocations filtered by the criteria.
     *
     * Generated from protobuf field <code>repeated .google.cloud.capacityplanner.v1beta.Allocation allocations = 4;</code>
     * @param array<\Google\Cloud\CapacityPlanner\V1beta\Allocation>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAllocations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\CapacityPlanner\V1beta\Allocation::class);
        $this->allocations = $arr;

        return $this;
    }

}

