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

namespace Google\Cloud\Compute\V1;

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

/**
 * Represents a reservation resource. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running. For more information, read  Reserving zonal resources. (== resource_for {$api_version}.reservations ==)
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.Reservation</code>
 */
class Reservation extends \Google\Protobuf\Internal\Message
{
    /**
     * [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
     *
     * Generated from protobuf field <code>string commitment = 213699349;</code>
     */
    private $commitment = '';
    /**
     * [Output Only] Creation timestamp in RFC3339 text format.
     *
     * Generated from protobuf field <code>string creation_timestamp = 30525366;</code>
     */
    private $creation_timestamp = '';
    /**
     * An optional description of this resource. Provide this property when you create the resource.
     *
     * Generated from protobuf field <code>string description = 154502140;</code>
     */
    private $description = '';
    /**
     * [Output Only] The unique identifier for the resource. This identifier is defined by the server.
     *
     * Generated from protobuf field <code>string id = 3355;</code>
     */
    private $id = '';
    /**
     * [Output Only] Type of the resource. Always compute#reservations for reservations.
     *
     * Generated from protobuf field <code>string kind = 3292052;</code>
     */
    private $kind = '';
    /**
     * The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     *
     * Generated from protobuf field <code>string name = 3373707;</code>
     */
    private $name = '';
    /**
     * [Output Only] Server-defined fully-qualified URL for this resource.
     *
     * Generated from protobuf field <code>string self_link = 187779341;</code>
     */
    private $self_link = '';
    /**
     * Reservation for instances with specific machine shapes.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.AllocationSpecificSKUReservation specific_reservation = 136466495;</code>
     */
    private $specific_reservation = null;
    /**
     * Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation.
     *
     * Generated from protobuf field <code>bool specific_reservation_required = 226550687;</code>
     */
    private $specific_reservation_required = false;
    /**
     * [Output Only] The status of the reservation.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.Reservation.Status status = 181260274;</code>
     */
    private $status = 0;
    /**
     * Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment.
     *
     * Generated from protobuf field <code>string zone = 3744684;</code>
     */
    private $zone = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $commitment
     *           [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
     *     @type string $creation_timestamp
     *           [Output Only] Creation timestamp in RFC3339 text format.
     *     @type string $description
     *           An optional description of this resource. Provide this property when you create the resource.
     *     @type string $id
     *           [Output Only] The unique identifier for the resource. This identifier is defined by the server.
     *     @type string $kind
     *           [Output Only] Type of the resource. Always compute#reservations for reservations.
     *     @type string $name
     *           The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     *     @type string $self_link
     *           [Output Only] Server-defined fully-qualified URL for this resource.
     *     @type \Google\Cloud\Compute\V1\AllocationSpecificSKUReservation $specific_reservation
     *           Reservation for instances with specific machine shapes.
     *     @type bool $specific_reservation_required
     *           Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation.
     *     @type int $status
     *           [Output Only] The status of the reservation.
     *     @type string $zone
     *           Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
     *
     * Generated from protobuf field <code>string commitment = 213699349;</code>
     * @return string
     */
    public function getCommitment()
    {
        return $this->commitment;
    }

    /**
     * [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
     *
     * Generated from protobuf field <code>string commitment = 213699349;</code>
     * @param string $var
     * @return $this
     */
    public function setCommitment($var)
    {
        GPBUtil::checkString($var, True);
        $this->commitment = $var;

        return $this;
    }

    /**
     * [Output Only] Creation timestamp in RFC3339 text format.
     *
     * Generated from protobuf field <code>string creation_timestamp = 30525366;</code>
     * @return string
     */
    public function getCreationTimestamp()
    {
        return $this->creation_timestamp;
    }

    /**
     * [Output Only] Creation timestamp in RFC3339 text format.
     *
     * Generated from protobuf field <code>string creation_timestamp = 30525366;</code>
     * @param string $var
     * @return $this
     */
    public function setCreationTimestamp($var)
    {
        GPBUtil::checkString($var, True);
        $this->creation_timestamp = $var;

        return $this;
    }

    /**
     * An optional description of this resource. Provide this property when you create the resource.
     *
     * Generated from protobuf field <code>string description = 154502140;</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * An optional description of this resource. Provide this property when you create the resource.
     *
     * Generated from protobuf field <code>string description = 154502140;</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * [Output Only] The unique identifier for the resource. This identifier is defined by the server.
     *
     * Generated from protobuf field <code>string id = 3355;</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * [Output Only] The unique identifier for the resource. This identifier is defined by the server.
     *
     * Generated from protobuf field <code>string id = 3355;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * [Output Only] Type of the resource. Always compute#reservations for reservations.
     *
     * Generated from protobuf field <code>string kind = 3292052;</code>
     * @return string
     */
    public function getKind()
    {
        return $this->kind;
    }

    /**
     * [Output Only] Type of the resource. Always compute#reservations for reservations.
     *
     * Generated from protobuf field <code>string kind = 3292052;</code>
     * @param string $var
     * @return $this
     */
    public function setKind($var)
    {
        GPBUtil::checkString($var, True);
        $this->kind = $var;

        return $this;
    }

    /**
     * The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     *
     * Generated from protobuf field <code>string name = 3373707;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     *
     * Generated from protobuf field <code>string name = 3373707;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * [Output Only] Server-defined fully-qualified URL for this resource.
     *
     * Generated from protobuf field <code>string self_link = 187779341;</code>
     * @return string
     */
    public function getSelfLink()
    {
        return $this->self_link;
    }

    /**
     * [Output Only] Server-defined fully-qualified URL for this resource.
     *
     * Generated from protobuf field <code>string self_link = 187779341;</code>
     * @param string $var
     * @return $this
     */
    public function setSelfLink($var)
    {
        GPBUtil::checkString($var, True);
        $this->self_link = $var;

        return $this;
    }

    /**
     * Reservation for instances with specific machine shapes.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.AllocationSpecificSKUReservation specific_reservation = 136466495;</code>
     * @return \Google\Cloud\Compute\V1\AllocationSpecificSKUReservation
     */
    public function getSpecificReservation()
    {
        return isset($this->specific_reservation) ? $this->specific_reservation : null;
    }

    public function hasSpecificReservation()
    {
        return isset($this->specific_reservation);
    }

    public function clearSpecificReservation()
    {
        unset($this->specific_reservation);
    }

    /**
     * Reservation for instances with specific machine shapes.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.AllocationSpecificSKUReservation specific_reservation = 136466495;</code>
     * @param \Google\Cloud\Compute\V1\AllocationSpecificSKUReservation $var
     * @return $this
     */
    public function setSpecificReservation($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AllocationSpecificSKUReservation::class);
        $this->specific_reservation = $var;

        return $this;
    }

    /**
     * Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation.
     *
     * Generated from protobuf field <code>bool specific_reservation_required = 226550687;</code>
     * @return bool
     */
    public function getSpecificReservationRequired()
    {
        return $this->specific_reservation_required;
    }

    /**
     * Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation.
     *
     * Generated from protobuf field <code>bool specific_reservation_required = 226550687;</code>
     * @param bool $var
     * @return $this
     */
    public function setSpecificReservationRequired($var)
    {
        GPBUtil::checkBool($var);
        $this->specific_reservation_required = $var;

        return $this;
    }

    /**
     * [Output Only] The status of the reservation.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.Reservation.Status status = 181260274;</code>
     * @return int
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * [Output Only] The status of the reservation.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.Reservation.Status status = 181260274;</code>
     * @param int $var
     * @return $this
     */
    public function setStatus($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Compute\V1\Reservation\Status::class);
        $this->status = $var;

        return $this;
    }

    /**
     * Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment.
     *
     * Generated from protobuf field <code>string zone = 3744684;</code>
     * @return string
     */
    public function getZone()
    {
        return $this->zone;
    }

    /**
     * Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment.
     *
     * Generated from protobuf field <code>string zone = 3744684;</code>
     * @param string $var
     * @return $this
     */
    public function setZone($var)
    {
        GPBUtil::checkString($var, True);
        $this->zone = $var;

        return $this;
    }

}

