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

/**
 * A specification of the desired way to instantiate a disk in the instance template when its created from a source instance.
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.DiskInstantiationConfig</code>
 */
class DiskInstantiationConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
     *
     * Generated from protobuf field <code>bool auto_delete = 196325947;</code>
     */
    private $auto_delete = false;
    /**
     * The custom source image to be used to restore this disk when instantiating this instance template.
     *
     * Generated from protobuf field <code>string custom_image = 184123149;</code>
     */
    private $custom_image = '';
    /**
     * Specifies the device name of the disk to which the configurations apply to.
     *
     * Generated from protobuf field <code>string device_name = 67541716;</code>
     */
    private $device_name = '';
    /**
     * Specifies whether to include the disk and what image to use. Possible values are:
     * - source-image: to use the same image that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks.
     * - source-image-family: to use the same image family that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks.
     * - custom-image: to use a user-provided image url for disk creation. Applicable to the boot disk and additional read-write disks.
     * - attach-read-only: to attach a read-only disk. Applicable to read-only disks.
     * - do-not-include: to exclude a disk from the template. Applicable to additional read-write disks, local SSDs, and read-only disks.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.DiskInstantiationConfig.InstantiateFrom instantiate_from = 124948447;</code>
     */
    private $instantiate_from = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $auto_delete
     *           Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
     *     @type string $custom_image
     *           The custom source image to be used to restore this disk when instantiating this instance template.
     *     @type string $device_name
     *           Specifies the device name of the disk to which the configurations apply to.
     *     @type int $instantiate_from
     *           Specifies whether to include the disk and what image to use. Possible values are:
     *           - source-image: to use the same image that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks.
     *           - source-image-family: to use the same image family that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks.
     *           - custom-image: to use a user-provided image url for disk creation. Applicable to the boot disk and additional read-write disks.
     *           - attach-read-only: to attach a read-only disk. Applicable to read-only disks.
     *           - do-not-include: to exclude a disk from the template. Applicable to additional read-write disks, local SSDs, and read-only disks.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
     *
     * Generated from protobuf field <code>bool auto_delete = 196325947;</code>
     * @return bool
     */
    public function getAutoDelete()
    {
        return $this->auto_delete;
    }

    /**
     * Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
     *
     * Generated from protobuf field <code>bool auto_delete = 196325947;</code>
     * @param bool $var
     * @return $this
     */
    public function setAutoDelete($var)
    {
        GPBUtil::checkBool($var);
        $this->auto_delete = $var;

        return $this;
    }

    /**
     * The custom source image to be used to restore this disk when instantiating this instance template.
     *
     * Generated from protobuf field <code>string custom_image = 184123149;</code>
     * @return string
     */
    public function getCustomImage()
    {
        return $this->custom_image;
    }

    /**
     * The custom source image to be used to restore this disk when instantiating this instance template.
     *
     * Generated from protobuf field <code>string custom_image = 184123149;</code>
     * @param string $var
     * @return $this
     */
    public function setCustomImage($var)
    {
        GPBUtil::checkString($var, True);
        $this->custom_image = $var;

        return $this;
    }

    /**
     * Specifies the device name of the disk to which the configurations apply to.
     *
     * Generated from protobuf field <code>string device_name = 67541716;</code>
     * @return string
     */
    public function getDeviceName()
    {
        return $this->device_name;
    }

    /**
     * Specifies the device name of the disk to which the configurations apply to.
     *
     * Generated from protobuf field <code>string device_name = 67541716;</code>
     * @param string $var
     * @return $this
     */
    public function setDeviceName($var)
    {
        GPBUtil::checkString($var, True);
        $this->device_name = $var;

        return $this;
    }

    /**
     * Specifies whether to include the disk and what image to use. Possible values are:
     * - source-image: to use the same image that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks.
     * - source-image-family: to use the same image family that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks.
     * - custom-image: to use a user-provided image url for disk creation. Applicable to the boot disk and additional read-write disks.
     * - attach-read-only: to attach a read-only disk. Applicable to read-only disks.
     * - do-not-include: to exclude a disk from the template. Applicable to additional read-write disks, local SSDs, and read-only disks.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.DiskInstantiationConfig.InstantiateFrom instantiate_from = 124948447;</code>
     * @return int
     */
    public function getInstantiateFrom()
    {
        return $this->instantiate_from;
    }

    /**
     * Specifies whether to include the disk and what image to use. Possible values are:
     * - source-image: to use the same image that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks.
     * - source-image-family: to use the same image family that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks.
     * - custom-image: to use a user-provided image url for disk creation. Applicable to the boot disk and additional read-write disks.
     * - attach-read-only: to attach a read-only disk. Applicable to read-only disks.
     * - do-not-include: to exclude a disk from the template. Applicable to additional read-write disks, local SSDs, and read-only disks.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.DiskInstantiationConfig.InstantiateFrom instantiate_from = 124948447;</code>
     * @param int $var
     * @return $this
     */
    public function setInstantiateFrom($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Compute\V1\DiskInstantiationConfig\InstantiateFrom::class);
        $this->instantiate_from = $var;

        return $this;
    }

}

