<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: temporal/api/workflow/v1/message.proto

namespace Temporal\Api\Workflow\V1\VersioningOverride;

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

/**
 * Generated from protobuf message <code>temporal.api.workflow.v1.VersioningOverride.PinnedOverride</code>
 */
class PinnedOverride extends \Google\Protobuf\Internal\Message
{
    /**
     * Defaults to PINNED_OVERRIDE_BEHAVIOR_UNSPECIFIED.
     * See `PinnedOverrideBehavior` for details.
     *
     * Generated from protobuf field <code>.temporal.api.workflow.v1.VersioningOverride.PinnedOverrideBehavior behavior = 1;</code>
     */
    protected $behavior = 0;
    /**
     * Required.
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.WorkerDeploymentVersion version = 2;</code>
     */
    protected $version = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $behavior
     *           Defaults to PINNED_OVERRIDE_BEHAVIOR_UNSPECIFIED.
     *           See `PinnedOverrideBehavior` for details.
     *     @type \Temporal\Api\Deployment\V1\WorkerDeploymentVersion $version
     *           Required.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Workflow\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * Defaults to PINNED_OVERRIDE_BEHAVIOR_UNSPECIFIED.
     * See `PinnedOverrideBehavior` for details.
     *
     * Generated from protobuf field <code>.temporal.api.workflow.v1.VersioningOverride.PinnedOverrideBehavior behavior = 1;</code>
     * @return int
     */
    public function getBehavior()
    {
        return $this->behavior;
    }

    /**
     * Defaults to PINNED_OVERRIDE_BEHAVIOR_UNSPECIFIED.
     * See `PinnedOverrideBehavior` for details.
     *
     * Generated from protobuf field <code>.temporal.api.workflow.v1.VersioningOverride.PinnedOverrideBehavior behavior = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setBehavior($var)
    {
        GPBUtil::checkEnum($var, \Temporal\Api\Workflow\V1\VersioningOverride\PinnedOverrideBehavior::class);
        $this->behavior = $var;

        return $this;
    }

    /**
     * Required.
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.WorkerDeploymentVersion version = 2;</code>
     * @return \Temporal\Api\Deployment\V1\WorkerDeploymentVersion|null
     */
    public function getVersion()
    {
        return $this->version;
    }

    public function hasVersion()
    {
        return isset($this->version);
    }

    public function clearVersion()
    {
        unset($this->version);
    }

    /**
     * Required.
     *
     * Generated from protobuf field <code>.temporal.api.deployment.v1.WorkerDeploymentVersion version = 2;</code>
     * @param \Temporal\Api\Deployment\V1\WorkerDeploymentVersion $var
     * @return $this
     */
    public function setVersion($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Deployment\V1\WorkerDeploymentVersion::class);
        $this->version = $var;

        return $this;
    }

}

