<?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.CreateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitment].
 *
 * Generated from protobuf message <code>google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest</code>
 */
class CreateCapacityCommitmentRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Resource name of the parent reservation. 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 = '';
    /**
     * Content of the capacity commitment to create.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 2;</code>
     */
    private $capacity_commitment = null;
    /**
     * If true, fail the request if another project in the organization has a
     * capacity commitment.
     *
     * Generated from protobuf field <code>bool enforce_single_admin_project_per_org = 4;</code>
     */
    private $enforce_single_admin_project_per_org = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. Resource name of the parent reservation. E.g.,
     *              `projects/myproject/locations/US`
     *     @type \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment $capacity_commitment
     *           Content of the capacity commitment to create.
     *     @type bool $enforce_single_admin_project_per_org
     *           If true, fail the request if another project in the organization has a
     *           capacity commitment.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Bigquery\Reservation\V1\Reservation::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Resource name of the parent reservation. 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. Resource name of the parent reservation. 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;
    }

    /**
     * Content of the capacity commitment to create.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.reservation.v1.CapacityCommitment capacity_commitment = 2;</code>
     * @return \Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment|null
     */
    public function getCapacityCommitment()
    {
        return isset($this->capacity_commitment) ? $this->capacity_commitment : null;
    }

    public function hasCapacityCommitment()
    {
        return isset($this->capacity_commitment);
    }

    public function clearCapacityCommitment()
    {
        unset($this->capacity_commitment);
    }

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

        return $this;
    }

    /**
     * If true, fail the request if another project in the organization has a
     * capacity commitment.
     *
     * Generated from protobuf field <code>bool enforce_single_admin_project_per_org = 4;</code>
     * @return bool
     */
    public function getEnforceSingleAdminProjectPerOrg()
    {
        return $this->enforce_single_admin_project_per_org;
    }

    /**
     * If true, fail the request if another project in the organization has a
     * capacity commitment.
     *
     * Generated from protobuf field <code>bool enforce_single_admin_project_per_org = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setEnforceSingleAdminProjectPerOrg($var)
    {
        GPBUtil::checkBool($var);
        $this->enforce_single_admin_project_per_org = $var;

        return $this;
    }

}

