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

namespace Temporal\Api\Common\V1;

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

/**
 * Callback to attach to various events in the system, e.g. workflow run completion.
 *
 * Generated from protobuf message <code>temporal.api.common.v1.Callback</code>
 */
class Callback extends \Google\Protobuf\Internal\Message
{
    /**
     * Links associated with the callback. It can be used to link to underlying resources of the
     * callback.
     *
     * Generated from protobuf field <code>repeated .temporal.api.common.v1.Link links = 100;</code>
     */
    private $links;
    protected $variant;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Temporal\Api\Common\V1\Callback\Nexus $nexus
     *     @type \Temporal\Api\Common\V1\Callback\Internal $internal
     *     @type \Temporal\Api\Common\V1\Link[] $links
     *           Links associated with the callback. It can be used to link to underlying resources of the
     *           callback.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Common\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.Callback.Nexus nexus = 2;</code>
     * @return \Temporal\Api\Common\V1\Callback\Nexus|null
     */
    public function getNexus()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.Callback.Nexus nexus = 2;</code>
     * @param \Temporal\Api\Common\V1\Callback\Nexus $var
     * @return $this
     */
    public function setNexus($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\Callback\Nexus::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.Callback.Internal internal = 3;</code>
     * @return \Temporal\Api\Common\V1\Callback\Internal|null
     */
    public function getInternal()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Generated from protobuf field <code>.temporal.api.common.v1.Callback.Internal internal = 3;</code>
     * @param \Temporal\Api\Common\V1\Callback\Internal $var
     * @return $this
     */
    public function setInternal($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\Callback\Internal::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Links associated with the callback. It can be used to link to underlying resources of the
     * callback.
     *
     * Generated from protobuf field <code>repeated .temporal.api.common.v1.Link links = 100;</code>
     * @return RepeatedField<\Temporal\Api\Common\V1\Link>
     */
    public function getLinks()
    {
        return $this->links;
    }

    /**
     * Links associated with the callback. It can be used to link to underlying resources of the
     * callback.
     *
     * Generated from protobuf field <code>repeated .temporal.api.common.v1.Link links = 100;</code>
     * @param \Temporal\Api\Common\V1\Link[] $var
     * @return $this
     */
    public function setLinks($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Temporal\Api\Common\V1\Link::class);
        $this->links = $arr;

        return $this;
    }

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

}

