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

namespace Google\Cloud\Commerce\Consumer\Procurement\V1;

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

/**
 * Assignment protocol for a license pool.
 *
 * Generated from protobuf message <code>google.cloud.commerce.consumer.procurement.v1.AssignmentProtocol</code>
 */
class AssignmentProtocol extends \Google\Protobuf\Internal\Message
{
    protected $assignment_type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol\ManualAssignmentType $manual_assignment_type
     *           Allow manual assignments triggered by administrative operations only.
     *     @type \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol\AutoAssignmentType $auto_assignment_type
     *           Allow automatic assignments triggered by data plane operations.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\LicenseManagementService::initOnce();
        parent::__construct($data);
    }

    /**
     * Allow manual assignments triggered by administrative operations only.
     *
     * Generated from protobuf field <code>.google.cloud.commerce.consumer.procurement.v1.AssignmentProtocol.ManualAssignmentType manual_assignment_type = 2;</code>
     * @return \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol\ManualAssignmentType|null
     */
    public function getManualAssignmentType()
    {
        return $this->readOneof(2);
    }

    public function hasManualAssignmentType()
    {
        return $this->hasOneof(2);
    }

    /**
     * Allow manual assignments triggered by administrative operations only.
     *
     * Generated from protobuf field <code>.google.cloud.commerce.consumer.procurement.v1.AssignmentProtocol.ManualAssignmentType manual_assignment_type = 2;</code>
     * @param \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol\ManualAssignmentType $var
     * @return $this
     */
    public function setManualAssignmentType($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol\ManualAssignmentType::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Allow automatic assignments triggered by data plane operations.
     *
     * Generated from protobuf field <code>.google.cloud.commerce.consumer.procurement.v1.AssignmentProtocol.AutoAssignmentType auto_assignment_type = 3;</code>
     * @return \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol\AutoAssignmentType|null
     */
    public function getAutoAssignmentType()
    {
        return $this->readOneof(3);
    }

    public function hasAutoAssignmentType()
    {
        return $this->hasOneof(3);
    }

    /**
     * Allow automatic assignments triggered by data plane operations.
     *
     * Generated from protobuf field <code>.google.cloud.commerce.consumer.procurement.v1.AssignmentProtocol.AutoAssignmentType auto_assignment_type = 3;</code>
     * @param \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol\AutoAssignmentType $var
     * @return $this
     */
    public function setAutoAssignmentType($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol\AutoAssignmentType::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getAssignmentType()
    {
        return $this->whichOneof("assignment_type");
    }

}

