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

/**
 * PlacementPolicy describes a group placement policy for the VMs controlled
 * by this AllocationPolicy.
 *
 * Generated from protobuf message <code>google.cloud.batch.v1.AllocationPolicy.PlacementPolicy</code>
 */
class PlacementPolicy extends \Google\Protobuf\Internal\Message
{
    /**
     * UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
     * want VMs to be located close to each other for low network latency
     * between the VMs. No placement policy will be generated when collocation
     * is UNSPECIFIED.
     *
     * Generated from protobuf field <code>string collocation = 1;</code>
     */
    protected $collocation = '';
    /**
     * When specified, causes the job to fail if more than max_distance logical
     * switches are required between VMs. Batch uses the most compact possible
     * placement of VMs even when max_distance is not specified. An explicit
     * max_distance makes that level of compactness a strict requirement.
     * Not yet implemented
     *
     * Generated from protobuf field <code>int64 max_distance = 2;</code>
     */
    protected $max_distance = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $collocation
     *           UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
     *           want VMs to be located close to each other for low network latency
     *           between the VMs. No placement policy will be generated when collocation
     *           is UNSPECIFIED.
     *     @type int|string $max_distance
     *           When specified, causes the job to fail if more than max_distance logical
     *           switches are required between VMs. Batch uses the most compact possible
     *           placement of VMs even when max_distance is not specified. An explicit
     *           max_distance makes that level of compactness a strict requirement.
     *           Not yet implemented
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce();
        parent::__construct($data);
    }

    /**
     * UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
     * want VMs to be located close to each other for low network latency
     * between the VMs. No placement policy will be generated when collocation
     * is UNSPECIFIED.
     *
     * Generated from protobuf field <code>string collocation = 1;</code>
     * @return string
     */
    public function getCollocation()
    {
        return $this->collocation;
    }

    /**
     * UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
     * want VMs to be located close to each other for low network latency
     * between the VMs. No placement policy will be generated when collocation
     * is UNSPECIFIED.
     *
     * Generated from protobuf field <code>string collocation = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setCollocation($var)
    {
        GPBUtil::checkString($var, True);
        $this->collocation = $var;

        return $this;
    }

    /**
     * When specified, causes the job to fail if more than max_distance logical
     * switches are required between VMs. Batch uses the most compact possible
     * placement of VMs even when max_distance is not specified. An explicit
     * max_distance makes that level of compactness a strict requirement.
     * Not yet implemented
     *
     * Generated from protobuf field <code>int64 max_distance = 2;</code>
     * @return int|string
     */
    public function getMaxDistance()
    {
        return $this->max_distance;
    }

    /**
     * When specified, causes the job to fail if more than max_distance logical
     * switches are required between VMs. Batch uses the most compact possible
     * placement of VMs even when max_distance is not specified. An explicit
     * max_distance makes that level of compactness a strict requirement.
     * Not yet implemented
     *
     * Generated from protobuf field <code>int64 max_distance = 2;</code>
     * @param int|string $var
     * @return $this
     */
    public function setMaxDistance($var)
    {
        GPBUtil::checkInt64($var);
        $this->max_distance = $var;

        return $this;
    }

}


