<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/bigquery/reservation/v1/reservation.proto

namespace Google\Cloud\BigQuery\Reservation\V1;

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

/**
 * The request for [ReservationService.CreateReservation][google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation].
 *
 * Generated from protobuf message <code>google.cloud.bigquery.reservation.v1.CreateReservationRequest</code>
 */
class CreateReservationRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Project, location. E.g.,
     * `projects/myproject/locations/US`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * The reservation ID. This field must only contain lower case alphanumeric
     * characters or dash. Max length is 64 characters.
     *
     * Generated from protobuf field <code>string reservation_id = 2;</code>
     */
    private $reservation_id = '';
    /**
     * Definition of the new reservation to create.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.reservation.v1.Reservation reservation = 3;</code>
     */
    private $reservation = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. Project, location. E.g.,
     *           `projects/myproject/locations/US`
     *     @type string $reservation_id
     *           The reservation ID. This field must only contain lower case alphanumeric
     *           characters or dash. Max length is 64 characters.
     *     @type \Google\Cloud\BigQuery\Reservation\V1\Reservation $reservation
     *           Definition of the new reservation to create.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Project, location. E.g.,
     * `projects/myproject/locations/US`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. Project, location. E.g.,
     * `projects/myproject/locations/US`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * The reservation ID. This field must only contain lower case alphanumeric
     * characters or dash. Max length is 64 characters.
     *
     * Generated from protobuf field <code>string reservation_id = 2;</code>
     * @return string
     */
    public function getReservationId()
    {
        return $this->reservation_id;
    }

    /**
     * The reservation ID. This field must only contain lower case alphanumeric
     * characters or dash. Max length is 64 characters.
     *
     * Generated from protobuf field <code>string reservation_id = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setReservationId($var)
    {
        GPBUtil::checkString($var, True);
        $this->reservation_id = $var;

        return $this;
    }

    /**
     * Definition of the new reservation to create.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.reservation.v1.Reservation reservation = 3;</code>
     * @return \Google\Cloud\BigQuery\Reservation\V1\Reservation|null
     */
    public function getReservation()
    {
        return isset($this->reservation) ? $this->reservation : null;
    }

    public function hasReservation()
    {
        return isset($this->reservation);
    }

    public function clearReservation()
    {
        unset($this->reservation);
    }

    /**
     * Definition of the new reservation to create.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.reservation.v1.Reservation reservation = 3;</code>
     * @param \Google\Cloud\BigQuery\Reservation\V1\Reservation $var
     * @return $this
     */
    public function setReservation($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Reservation\V1\Reservation::class);
        $this->reservation = $var;

        return $this;
    }

}

