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

namespace Google\Cloud\BareMetalSolution\V2;

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

/**
 * Configuration parameters for a new volume.
 *
 * Generated from protobuf message <code>google.cloud.baremetalsolution.v2.VolumeConfig</code>
 */
class VolumeConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The name of the volume config.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $name = '';
    /**
     * A transient unique identifier to identify a volume within an
     * ProvisioningConfig request.
     *
     * Generated from protobuf field <code>string id = 2;</code>
     */
    private $id = '';
    /**
     * Whether snapshots should be enabled.
     *
     * Generated from protobuf field <code>bool snapshots_enabled = 3;</code>
     */
    private $snapshots_enabled = false;
    /**
     * The type of this Volume.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VolumeConfig.Type type = 4;</code>
     */
    private $type = 0;
    /**
     * Volume protocol.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VolumeConfig.Protocol protocol = 5;</code>
     */
    private $protocol = 0;
    /**
     * The requested size of this volume, in GB.
     *
     * Generated from protobuf field <code>int32 size_gb = 6;</code>
     */
    private $size_gb = 0;
    /**
     * LUN ranges to be configured. Set only when protocol is PROTOCOL_FC.
     *
     * Generated from protobuf field <code>repeated .google.cloud.baremetalsolution.v2.VolumeConfig.LunRange lun_ranges = 7;</code>
     */
    private $lun_ranges;
    /**
     * Machine ids connected to this volume. Set only when protocol is
     * PROTOCOL_FC.
     *
     * Generated from protobuf field <code>repeated string machine_ids = 8;</code>
     */
    private $machine_ids;
    /**
     * NFS exports. Set only when protocol is PROTOCOL_NFS.
     *
     * Generated from protobuf field <code>repeated .google.cloud.baremetalsolution.v2.VolumeConfig.NfsExport nfs_exports = 9;</code>
     */
    private $nfs_exports;
    /**
     * User note field, it can be used by customers to add additional information
     * for the BMS Ops team .
     *
     * Generated from protobuf field <code>string user_note = 10;</code>
     */
    private $user_note = '';
    /**
     * The GCP service of the storage volume. Available gcp_service are in
     * https://cloud.google.com/bare-metal/docs/bms-planning.
     *
     * Generated from protobuf field <code>string gcp_service = 11;</code>
     */
    private $gcp_service = '';
    /**
     * Performance tier of the Volume.
     * Default is SHARED.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VolumePerformanceTier performance_tier = 12;</code>
     */
    private $performance_tier = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. The name of the volume config.
     *     @type string $id
     *           A transient unique identifier to identify a volume within an
     *           ProvisioningConfig request.
     *     @type bool $snapshots_enabled
     *           Whether snapshots should be enabled.
     *     @type int $type
     *           The type of this Volume.
     *     @type int $protocol
     *           Volume protocol.
     *     @type int $size_gb
     *           The requested size of this volume, in GB.
     *     @type array<\Google\Cloud\BareMetalSolution\V2\VolumeConfig\LunRange>|\Google\Protobuf\Internal\RepeatedField $lun_ranges
     *           LUN ranges to be configured. Set only when protocol is PROTOCOL_FC.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $machine_ids
     *           Machine ids connected to this volume. Set only when protocol is
     *           PROTOCOL_FC.
     *     @type array<\Google\Cloud\BareMetalSolution\V2\VolumeConfig\NfsExport>|\Google\Protobuf\Internal\RepeatedField $nfs_exports
     *           NFS exports. Set only when protocol is PROTOCOL_NFS.
     *     @type string $user_note
     *           User note field, it can be used by customers to add additional information
     *           for the BMS Ops team .
     *     @type string $gcp_service
     *           The GCP service of the storage volume. Available gcp_service are in
     *           https://cloud.google.com/bare-metal/docs/bms-planning.
     *     @type int $performance_tier
     *           Performance tier of the Volume.
     *           Default is SHARED.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Provisioning::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The name of the volume config.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. The name of the volume config.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * A transient unique identifier to identify a volume within an
     * ProvisioningConfig request.
     *
     * Generated from protobuf field <code>string id = 2;</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * A transient unique identifier to identify a volume within an
     * ProvisioningConfig request.
     *
     * Generated from protobuf field <code>string id = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * Whether snapshots should be enabled.
     *
     * Generated from protobuf field <code>bool snapshots_enabled = 3;</code>
     * @return bool
     */
    public function getSnapshotsEnabled()
    {
        return $this->snapshots_enabled;
    }

    /**
     * Whether snapshots should be enabled.
     *
     * Generated from protobuf field <code>bool snapshots_enabled = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setSnapshotsEnabled($var)
    {
        GPBUtil::checkBool($var);
        $this->snapshots_enabled = $var;

        return $this;
    }

    /**
     * The type of this Volume.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VolumeConfig.Type type = 4;</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * The type of this Volume.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VolumeConfig.Type type = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\VolumeConfig\Type::class);
        $this->type = $var;

        return $this;
    }

    /**
     * Volume protocol.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VolumeConfig.Protocol protocol = 5;</code>
     * @return int
     */
    public function getProtocol()
    {
        return $this->protocol;
    }

    /**
     * Volume protocol.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VolumeConfig.Protocol protocol = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setProtocol($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\VolumeConfig\Protocol::class);
        $this->protocol = $var;

        return $this;
    }

    /**
     * The requested size of this volume, in GB.
     *
     * Generated from protobuf field <code>int32 size_gb = 6;</code>
     * @return int
     */
    public function getSizeGb()
    {
        return $this->size_gb;
    }

    /**
     * The requested size of this volume, in GB.
     *
     * Generated from protobuf field <code>int32 size_gb = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setSizeGb($var)
    {
        GPBUtil::checkInt32($var);
        $this->size_gb = $var;

        return $this;
    }

    /**
     * LUN ranges to be configured. Set only when protocol is PROTOCOL_FC.
     *
     * Generated from protobuf field <code>repeated .google.cloud.baremetalsolution.v2.VolumeConfig.LunRange lun_ranges = 7;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getLunRanges()
    {
        return $this->lun_ranges;
    }

    /**
     * LUN ranges to be configured. Set only when protocol is PROTOCOL_FC.
     *
     * Generated from protobuf field <code>repeated .google.cloud.baremetalsolution.v2.VolumeConfig.LunRange lun_ranges = 7;</code>
     * @param array<\Google\Cloud\BareMetalSolution\V2\VolumeConfig\LunRange>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setLunRanges($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\VolumeConfig\LunRange::class);
        $this->lun_ranges = $arr;

        return $this;
    }

    /**
     * Machine ids connected to this volume. Set only when protocol is
     * PROTOCOL_FC.
     *
     * Generated from protobuf field <code>repeated string machine_ids = 8;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getMachineIds()
    {
        return $this->machine_ids;
    }

    /**
     * Machine ids connected to this volume. Set only when protocol is
     * PROTOCOL_FC.
     *
     * Generated from protobuf field <code>repeated string machine_ids = 8;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setMachineIds($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->machine_ids = $arr;

        return $this;
    }

    /**
     * NFS exports. Set only when protocol is PROTOCOL_NFS.
     *
     * Generated from protobuf field <code>repeated .google.cloud.baremetalsolution.v2.VolumeConfig.NfsExport nfs_exports = 9;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getNfsExports()
    {
        return $this->nfs_exports;
    }

    /**
     * NFS exports. Set only when protocol is PROTOCOL_NFS.
     *
     * Generated from protobuf field <code>repeated .google.cloud.baremetalsolution.v2.VolumeConfig.NfsExport nfs_exports = 9;</code>
     * @param array<\Google\Cloud\BareMetalSolution\V2\VolumeConfig\NfsExport>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setNfsExports($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BareMetalSolution\V2\VolumeConfig\NfsExport::class);
        $this->nfs_exports = $arr;

        return $this;
    }

    /**
     * User note field, it can be used by customers to add additional information
     * for the BMS Ops team .
     *
     * Generated from protobuf field <code>string user_note = 10;</code>
     * @return string
     */
    public function getUserNote()
    {
        return $this->user_note;
    }

    /**
     * User note field, it can be used by customers to add additional information
     * for the BMS Ops team .
     *
     * Generated from protobuf field <code>string user_note = 10;</code>
     * @param string $var
     * @return $this
     */
    public function setUserNote($var)
    {
        GPBUtil::checkString($var, True);
        $this->user_note = $var;

        return $this;
    }

    /**
     * The GCP service of the storage volume. Available gcp_service are in
     * https://cloud.google.com/bare-metal/docs/bms-planning.
     *
     * Generated from protobuf field <code>string gcp_service = 11;</code>
     * @return string
     */
    public function getGcpService()
    {
        return $this->gcp_service;
    }

    /**
     * The GCP service of the storage volume. Available gcp_service are in
     * https://cloud.google.com/bare-metal/docs/bms-planning.
     *
     * Generated from protobuf field <code>string gcp_service = 11;</code>
     * @param string $var
     * @return $this
     */
    public function setGcpService($var)
    {
        GPBUtil::checkString($var, True);
        $this->gcp_service = $var;

        return $this;
    }

    /**
     * Performance tier of the Volume.
     * Default is SHARED.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VolumePerformanceTier performance_tier = 12;</code>
     * @return int
     */
    public function getPerformanceTier()
    {
        return $this->performance_tier;
    }

    /**
     * Performance tier of the Volume.
     * Default is SHARED.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VolumePerformanceTier performance_tier = 12;</code>
     * @param int $var
     * @return $this
     */
    public function setPerformanceTier($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\VolumePerformanceTier::class);
        $this->performance_tier = $var;

        return $this;
    }

}

