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

namespace Google\Cloud\VMMigration\V1;

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

/**
 * Scheduling information for VM on maintenance/restart behaviour and
 * node allocation in sole tenant nodes.
 *
 * Generated from protobuf message <code>google.cloud.vmmigration.v1.ComputeScheduling</code>
 */
class ComputeScheduling extends \Google\Protobuf\Internal\Message
{
    /**
     * How the instance should behave when the host machine undergoes
     * maintenance that may temporarily impact instance performance.
     *
     * Generated from protobuf field <code>.google.cloud.vmmigration.v1.ComputeScheduling.OnHostMaintenance on_host_maintenance = 1;</code>
     */
    private $on_host_maintenance = 0;
    /**
     * Whether the Instance should be automatically restarted whenever it is
     * terminated by Compute Engine (not terminated by user).
     * This configuration is identical to `automaticRestart` field in Compute
     * Engine create instance under scheduling.
     * It was changed to an enum (instead of a boolean) to match the default
     * value in Compute Engine which is automatic restart.
     *
     * Generated from protobuf field <code>.google.cloud.vmmigration.v1.ComputeScheduling.RestartType restart_type = 5;</code>
     */
    private $restart_type = 0;
    /**
     * A set of node affinity and anti-affinity configurations for sole tenant
     * nodes.
     *
     * Generated from protobuf field <code>repeated .google.cloud.vmmigration.v1.SchedulingNodeAffinity node_affinities = 3;</code>
     */
    private $node_affinities;
    /**
     * The minimum number of virtual CPUs this instance will consume when
     * running on a sole-tenant node. Ignored if no node_affinites are
     * configured.
     *
     * Generated from protobuf field <code>int32 min_node_cpus = 4;</code>
     */
    private $min_node_cpus = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $on_host_maintenance
     *           How the instance should behave when the host machine undergoes
     *           maintenance that may temporarily impact instance performance.
     *     @type int $restart_type
     *           Whether the Instance should be automatically restarted whenever it is
     *           terminated by Compute Engine (not terminated by user).
     *           This configuration is identical to `automaticRestart` field in Compute
     *           Engine create instance under scheduling.
     *           It was changed to an enum (instead of a boolean) to match the default
     *           value in Compute Engine which is automatic restart.
     *     @type array<\Google\Cloud\VMMigration\V1\SchedulingNodeAffinity>|\Google\Protobuf\Internal\RepeatedField $node_affinities
     *           A set of node affinity and anti-affinity configurations for sole tenant
     *           nodes.
     *     @type int $min_node_cpus
     *           The minimum number of virtual CPUs this instance will consume when
     *           running on a sole-tenant node. Ignored if no node_affinites are
     *           configured.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce();
        parent::__construct($data);
    }

    /**
     * How the instance should behave when the host machine undergoes
     * maintenance that may temporarily impact instance performance.
     *
     * Generated from protobuf field <code>.google.cloud.vmmigration.v1.ComputeScheduling.OnHostMaintenance on_host_maintenance = 1;</code>
     * @return int
     */
    public function getOnHostMaintenance()
    {
        return $this->on_host_maintenance;
    }

    /**
     * How the instance should behave when the host machine undergoes
     * maintenance that may temporarily impact instance performance.
     *
     * Generated from protobuf field <code>.google.cloud.vmmigration.v1.ComputeScheduling.OnHostMaintenance on_host_maintenance = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setOnHostMaintenance($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\ComputeScheduling\OnHostMaintenance::class);
        $this->on_host_maintenance = $var;

        return $this;
    }

    /**
     * Whether the Instance should be automatically restarted whenever it is
     * terminated by Compute Engine (not terminated by user).
     * This configuration is identical to `automaticRestart` field in Compute
     * Engine create instance under scheduling.
     * It was changed to an enum (instead of a boolean) to match the default
     * value in Compute Engine which is automatic restart.
     *
     * Generated from protobuf field <code>.google.cloud.vmmigration.v1.ComputeScheduling.RestartType restart_type = 5;</code>
     * @return int
     */
    public function getRestartType()
    {
        return $this->restart_type;
    }

    /**
     * Whether the Instance should be automatically restarted whenever it is
     * terminated by Compute Engine (not terminated by user).
     * This configuration is identical to `automaticRestart` field in Compute
     * Engine create instance under scheduling.
     * It was changed to an enum (instead of a boolean) to match the default
     * value in Compute Engine which is automatic restart.
     *
     * Generated from protobuf field <code>.google.cloud.vmmigration.v1.ComputeScheduling.RestartType restart_type = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setRestartType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\ComputeScheduling\RestartType::class);
        $this->restart_type = $var;

        return $this;
    }

    /**
     * A set of node affinity and anti-affinity configurations for sole tenant
     * nodes.
     *
     * Generated from protobuf field <code>repeated .google.cloud.vmmigration.v1.SchedulingNodeAffinity node_affinities = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getNodeAffinities()
    {
        return $this->node_affinities;
    }

    /**
     * A set of node affinity and anti-affinity configurations for sole tenant
     * nodes.
     *
     * Generated from protobuf field <code>repeated .google.cloud.vmmigration.v1.SchedulingNodeAffinity node_affinities = 3;</code>
     * @param array<\Google\Cloud\VMMigration\V1\SchedulingNodeAffinity>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setNodeAffinities($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\SchedulingNodeAffinity::class);
        $this->node_affinities = $arr;

        return $this;
    }

    /**
     * The minimum number of virtual CPUs this instance will consume when
     * running on a sole-tenant node. Ignored if no node_affinites are
     * configured.
     *
     * Generated from protobuf field <code>int32 min_node_cpus = 4;</code>
     * @return int
     */
    public function getMinNodeCpus()
    {
        return $this->min_node_cpus;
    }

    /**
     * The minimum number of virtual CPUs this instance will consume when
     * running on a sole-tenant node. Ignored if no node_affinites are
     * configured.
     *
     * Generated from protobuf field <code>int32 min_node_cpus = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setMinNodeCpus($var)
    {
        GPBUtil::checkInt32($var);
        $this->min_node_cpus = $var;

        return $this;
    }

}

