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

namespace Google\Cloud\Batch\V1\AllocationPolicy;

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

/**
 * InstancePolicy describes an instance type and resources attached to each VM
 * created by this InstancePolicy.
 *
 * Generated from protobuf message <code>google.cloud.batch.v1.AllocationPolicy.InstancePolicy</code>
 */
class InstancePolicy extends \Google\Protobuf\Internal\Message
{
    /**
     * The Compute Engine machine type.
     *
     * Generated from protobuf field <code>string machine_type = 2;</code>
     */
    private $machine_type = '';
    /**
     * The minimum CPU platform.
     * See
     * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
     * Not yet implemented.
     *
     * Generated from protobuf field <code>string min_cpu_platform = 3;</code>
     */
    private $min_cpu_platform = '';
    /**
     * The provisioning model.
     *
     * Generated from protobuf field <code>.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 4;</code>
     */
    private $provisioning_model = 0;
    /**
     * The accelerators attached to each VM instance.
     *
     * Generated from protobuf field <code>repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5;</code>
     */
    private $accelerators;
    /**
     * Book disk to be created and attached to each VM by this InstancePolicy.
     * Boot disk will be deleted when the VM is deleted.
     *
     * Generated from protobuf field <code>.google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8;</code>
     */
    private $boot_disk = null;
    /**
     * Non-boot disks to be attached for each VM created by this InstancePolicy.
     * New disks will be deleted when the VM is deleted.
     *
     * Generated from protobuf field <code>repeated .google.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6;</code>
     */
    private $disks;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $machine_type
     *           The Compute Engine machine type.
     *     @type string $min_cpu_platform
     *           The minimum CPU platform.
     *           See
     *           `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
     *           Not yet implemented.
     *     @type int $provisioning_model
     *           The provisioning model.
     *     @type array<\Google\Cloud\Batch\V1\AllocationPolicy\Accelerator>|\Google\Protobuf\Internal\RepeatedField $accelerators
     *           The accelerators attached to each VM instance.
     *     @type \Google\Cloud\Batch\V1\AllocationPolicy\Disk $boot_disk
     *           Book disk to be created and attached to each VM by this InstancePolicy.
     *           Boot disk will be deleted when the VM is deleted.
     *     @type array<\Google\Cloud\Batch\V1\AllocationPolicy\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $disks
     *           Non-boot disks to be attached for each VM created by this InstancePolicy.
     *           New disks will be deleted when the VM is deleted.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce();
        parent::__construct($data);
    }

    /**
     * The Compute Engine machine type.
     *
     * Generated from protobuf field <code>string machine_type = 2;</code>
     * @return string
     */
    public function getMachineType()
    {
        return $this->machine_type;
    }

    /**
     * The Compute Engine machine type.
     *
     * Generated from protobuf field <code>string machine_type = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setMachineType($var)
    {
        GPBUtil::checkString($var, True);
        $this->machine_type = $var;

        return $this;
    }

    /**
     * The minimum CPU platform.
     * See
     * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
     * Not yet implemented.
     *
     * Generated from protobuf field <code>string min_cpu_platform = 3;</code>
     * @return string
     */
    public function getMinCpuPlatform()
    {
        return $this->min_cpu_platform;
    }

    /**
     * The minimum CPU platform.
     * See
     * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
     * Not yet implemented.
     *
     * Generated from protobuf field <code>string min_cpu_platform = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setMinCpuPlatform($var)
    {
        GPBUtil::checkString($var, True);
        $this->min_cpu_platform = $var;

        return $this;
    }

    /**
     * The provisioning model.
     *
     * Generated from protobuf field <code>.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 4;</code>
     * @return int
     */
    public function getProvisioningModel()
    {
        return $this->provisioning_model;
    }

    /**
     * The provisioning model.
     *
     * Generated from protobuf field <code>.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setProvisioningModel($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\AllocationPolicy\ProvisioningModel::class);
        $this->provisioning_model = $var;

        return $this;
    }

    /**
     * The accelerators attached to each VM instance.
     *
     * Generated from protobuf field <code>repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAccelerators()
    {
        return $this->accelerators;
    }

    /**
     * The accelerators attached to each VM instance.
     *
     * Generated from protobuf field <code>repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5;</code>
     * @param array<\Google\Cloud\Batch\V1\AllocationPolicy\Accelerator>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAccelerators($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\AllocationPolicy\Accelerator::class);
        $this->accelerators = $arr;

        return $this;
    }

    /**
     * Book disk to be created and attached to each VM by this InstancePolicy.
     * Boot disk will be deleted when the VM is deleted.
     *
     * Generated from protobuf field <code>.google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8;</code>
     * @return \Google\Cloud\Batch\V1\AllocationPolicy\Disk|null
     */
    public function getBootDisk()
    {
        return $this->boot_disk;
    }

    public function hasBootDisk()
    {
        return isset($this->boot_disk);
    }

    public function clearBootDisk()
    {
        unset($this->boot_disk);
    }

    /**
     * Book disk to be created and attached to each VM by this InstancePolicy.
     * Boot disk will be deleted when the VM is deleted.
     *
     * Generated from protobuf field <code>.google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8;</code>
     * @param \Google\Cloud\Batch\V1\AllocationPolicy\Disk $var
     * @return $this
     */
    public function setBootDisk($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\Disk::class);
        $this->boot_disk = $var;

        return $this;
    }

    /**
     * Non-boot disks to be attached for each VM created by this InstancePolicy.
     * New disks will be deleted when the VM is deleted.
     *
     * Generated from protobuf field <code>repeated .google.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getDisks()
    {
        return $this->disks;
    }

    /**
     * Non-boot disks to be attached for each VM created by this InstancePolicy.
     * New disks will be deleted when the VM is deleted.
     *
     * Generated from protobuf field <code>repeated .google.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6;</code>
     * @param array<\Google\Cloud\Batch\V1\AllocationPolicy\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setDisks($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\AllocationPolicy\AttachedDisk::class);
        $this->disks = $arr;

        return $this;
    }

}


