<?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;

/**
 * This reservation type allows to pre allocate specific instance configuration. Next ID: 6
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.AllocationSpecificSKUReservation</code>
 */
class AllocationSpecificSKUReservation extends \Google\Protobuf\Internal\Message
{
    /**
     * [Output Only] Indicates how many instances are actually usable currently.
     *
     * Generated from protobuf field <code>optional int64 assured_count = 281197645;</code>
     */
    private $assured_count = null;
    /**
     * Specifies the number of resources that are allocated.
     *
     * Generated from protobuf field <code>optional int64 count = 94851343;</code>
     */
    private $count = null;
    /**
     * [Output Only] Indicates how many instances are in use.
     *
     * Generated from protobuf field <code>optional int64 in_use_count = 493458877;</code>
     */
    private $in_use_count = null;
    /**
     * The instance properties for the reservation.
     *
     * Generated from protobuf field <code>optional .google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties instance_properties = 215355165;</code>
     */
    private $instance_properties = null;
    /**
     * Specifies the instance template to create the reservation. If you use this field, you must exclude the instanceProperties field. This field is optional, and it can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project /global/instanceTemplates/instanceTemplate - projects/project/global/instanceTemplates/instanceTemplate - global/instanceTemplates/instanceTemplate 
     *
     * Generated from protobuf field <code>optional string source_instance_template = 332423616;</code>
     */
    private $source_instance_template = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $assured_count
     *           [Output Only] Indicates how many instances are actually usable currently.
     *     @type int|string $count
     *           Specifies the number of resources that are allocated.
     *     @type int|string $in_use_count
     *           [Output Only] Indicates how many instances are in use.
     *     @type \Google\Cloud\Compute\V1\AllocationSpecificSKUAllocationReservedInstanceProperties $instance_properties
     *           The instance properties for the reservation.
     *     @type string $source_instance_template
     *           Specifies the instance template to create the reservation. If you use this field, you must exclude the instanceProperties field. This field is optional, and it can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project /global/instanceTemplates/instanceTemplate - projects/project/global/instanceTemplates/instanceTemplate - global/instanceTemplates/instanceTemplate 
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * [Output Only] Indicates how many instances are actually usable currently.
     *
     * Generated from protobuf field <code>optional int64 assured_count = 281197645;</code>
     * @return int|string
     */
    public function getAssuredCount()
    {
        return isset($this->assured_count) ? $this->assured_count : 0;
    }

    public function hasAssuredCount()
    {
        return isset($this->assured_count);
    }

    public function clearAssuredCount()
    {
        unset($this->assured_count);
    }

    /**
     * [Output Only] Indicates how many instances are actually usable currently.
     *
     * Generated from protobuf field <code>optional int64 assured_count = 281197645;</code>
     * @param int|string $var
     * @return $this
     */
    public function setAssuredCount($var)
    {
        GPBUtil::checkInt64($var);
        $this->assured_count = $var;

        return $this;
    }

    /**
     * Specifies the number of resources that are allocated.
     *
     * Generated from protobuf field <code>optional int64 count = 94851343;</code>
     * @return int|string
     */
    public function getCount()
    {
        return isset($this->count) ? $this->count : 0;
    }

    public function hasCount()
    {
        return isset($this->count);
    }

    public function clearCount()
    {
        unset($this->count);
    }

    /**
     * Specifies the number of resources that are allocated.
     *
     * Generated from protobuf field <code>optional int64 count = 94851343;</code>
     * @param int|string $var
     * @return $this
     */
    public function setCount($var)
    {
        GPBUtil::checkInt64($var);
        $this->count = $var;

        return $this;
    }

    /**
     * [Output Only] Indicates how many instances are in use.
     *
     * Generated from protobuf field <code>optional int64 in_use_count = 493458877;</code>
     * @return int|string
     */
    public function getInUseCount()
    {
        return isset($this->in_use_count) ? $this->in_use_count : 0;
    }

    public function hasInUseCount()
    {
        return isset($this->in_use_count);
    }

    public function clearInUseCount()
    {
        unset($this->in_use_count);
    }

    /**
     * [Output Only] Indicates how many instances are in use.
     *
     * Generated from protobuf field <code>optional int64 in_use_count = 493458877;</code>
     * @param int|string $var
     * @return $this
     */
    public function setInUseCount($var)
    {
        GPBUtil::checkInt64($var);
        $this->in_use_count = $var;

        return $this;
    }

    /**
     * The instance properties for the reservation.
     *
     * Generated from protobuf field <code>optional .google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties instance_properties = 215355165;</code>
     * @return \Google\Cloud\Compute\V1\AllocationSpecificSKUAllocationReservedInstanceProperties|null
     */
    public function getInstanceProperties()
    {
        return $this->instance_properties;
    }

    public function hasInstanceProperties()
    {
        return isset($this->instance_properties);
    }

    public function clearInstanceProperties()
    {
        unset($this->instance_properties);
    }

    /**
     * The instance properties for the reservation.
     *
     * Generated from protobuf field <code>optional .google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties instance_properties = 215355165;</code>
     * @param \Google\Cloud\Compute\V1\AllocationSpecificSKUAllocationReservedInstanceProperties $var
     * @return $this
     */
    public function setInstanceProperties($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AllocationSpecificSKUAllocationReservedInstanceProperties::class);
        $this->instance_properties = $var;

        return $this;
    }

    /**
     * Specifies the instance template to create the reservation. If you use this field, you must exclude the instanceProperties field. This field is optional, and it can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project /global/instanceTemplates/instanceTemplate - projects/project/global/instanceTemplates/instanceTemplate - global/instanceTemplates/instanceTemplate 
     *
     * Generated from protobuf field <code>optional string source_instance_template = 332423616;</code>
     * @return string
     */
    public function getSourceInstanceTemplate()
    {
        return isset($this->source_instance_template) ? $this->source_instance_template : '';
    }

    public function hasSourceInstanceTemplate()
    {
        return isset($this->source_instance_template);
    }

    public function clearSourceInstanceTemplate()
    {
        unset($this->source_instance_template);
    }

    /**
     * Specifies the instance template to create the reservation. If you use this field, you must exclude the instanceProperties field. This field is optional, and it can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project /global/instanceTemplates/instanceTemplate - projects/project/global/instanceTemplates/instanceTemplate - global/instanceTemplates/instanceTemplate 
     *
     * Generated from protobuf field <code>optional string source_instance_template = 332423616;</code>
     * @param string $var
     * @return $this
     */
    public function setSourceInstanceTemplate($var)
    {
        GPBUtil::checkString($var, True);
        $this->source_instance_template = $var;

        return $this;
    }

}

