<?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 a target of an invocation over HTTP.
 *
 * Generated from protobuf message <code>google.cloud.eventarc.v1.Destination</code>
 */
class Destination extends \Google\Protobuf\Internal\Message
{
    protected $descriptor;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Eventarc\V1\CloudRun $cloud_run
     *           Cloud Run fully-managed service that receives the events. The service
     *           should be running in the same project of the trigger.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Eventarc\V1\Trigger::initOnce();
        parent::__construct($data);
    }

    /**
     * Cloud Run fully-managed service that receives the events. The service
     * should be running in the same project of the trigger.
     *
     * Generated from protobuf field <code>.google.cloud.eventarc.v1.CloudRun cloud_run = 1;</code>
     * @return \Google\Cloud\Eventarc\V1\CloudRun|null
     */
    public function getCloudRun()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Cloud Run fully-managed service that receives the events. The service
     * should be running in the same project of the trigger.
     *
     * Generated from protobuf field <code>.google.cloud.eventarc.v1.CloudRun cloud_run = 1;</code>
     * @param \Google\Cloud\Eventarc\V1\CloudRun $var
     * @return $this
     */
    public function setCloudRun($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\CloudRun::class);
        $this->writeOneof(1, $var);

        return $this;
    }

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

}

