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

namespace Google\Cloud\Eventarc\V1;

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

/**
 * Represents the transport intermediaries created for the trigger to
 * deliver events.
 *
 * Generated from protobuf message <code>google.cloud.eventarc.v1.Transport</code>
 */
class Transport extends \Google\Protobuf\Internal\Message
{
    protected $intermediary;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Eventarc\V1\Pubsub $pubsub
     *           The Pub/Sub topic and subscription used by Eventarc as a transport
     *           intermediary.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Eventarc\V1\Trigger::initOnce();
        parent::__construct($data);
    }

    /**
     * The Pub/Sub topic and subscription used by Eventarc as a transport
     * intermediary.
     *
     * Generated from protobuf field <code>.google.cloud.eventarc.v1.Pubsub pubsub = 1;</code>
     * @return \Google\Cloud\Eventarc\V1\Pubsub|null
     */
    public function getPubsub()
    {
        return $this->readOneof(1);
    }

    public function hasPubsub()
    {
        return $this->hasOneof(1);
    }

    /**
     * The Pub/Sub topic and subscription used by Eventarc as a transport
     * intermediary.
     *
     * Generated from protobuf field <code>.google.cloud.eventarc.v1.Pubsub pubsub = 1;</code>
     * @param \Google\Cloud\Eventarc\V1\Pubsub $var
     * @return $this
     */
    public function setPubsub($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\Pubsub::class);
        $this->writeOneof(1, $var);

        return $this;
    }

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

}

