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

namespace Google\Cloud\AIPlatform\V1;

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

/**
 * References an API call. It contains more information about long running
 * operation and Jobs that are triggered by the API call.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.UserActionReference</code>
 */
class UserActionReference extends \Google\Protobuf\Internal\Message
{
    /**
     * The method name of the API RPC call. For example,
     * "/google.cloud.aiplatform.{apiVersion}.DatasetService.CreateDataset"
     *
     * Generated from protobuf field <code>string method = 3;</code>
     */
    private $method = '';
    protected $reference;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $operation
     *           For API calls that return a long running operation.
     *           Resource name of the long running operation.
     *           Format:
     *           `projects/{project}/locations/{location}/operations/{operation}`
     *     @type string $data_labeling_job
     *           For API calls that start a LabelingJob.
     *           Resource name of the LabelingJob.
     *           Format:
     *           `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`
     *     @type string $method
     *           The method name of the API RPC call. For example,
     *           "/google.cloud.aiplatform.{apiVersion}.DatasetService.CreateDataset"
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\UserActionReference::initOnce();
        parent::__construct($data);
    }

    /**
     * For API calls that return a long running operation.
     * Resource name of the long running operation.
     * Format:
     * `projects/{project}/locations/{location}/operations/{operation}`
     *
     * Generated from protobuf field <code>string operation = 1;</code>
     * @return string
     */
    public function getOperation()
    {
        return $this->readOneof(1);
    }

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

    /**
     * For API calls that return a long running operation.
     * Resource name of the long running operation.
     * Format:
     * `projects/{project}/locations/{location}/operations/{operation}`
     *
     * Generated from protobuf field <code>string operation = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setOperation($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * For API calls that start a LabelingJob.
     * Resource name of the LabelingJob.
     * Format:
     * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`
     *
     * Generated from protobuf field <code>string data_labeling_job = 2;</code>
     * @return string
     */
    public function getDataLabelingJob()
    {
        return $this->readOneof(2);
    }

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

    /**
     * For API calls that start a LabelingJob.
     * Resource name of the LabelingJob.
     * Format:
     * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`
     *
     * Generated from protobuf field <code>string data_labeling_job = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setDataLabelingJob($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * The method name of the API RPC call. For example,
     * "/google.cloud.aiplatform.{apiVersion}.DatasetService.CreateDataset"
     *
     * Generated from protobuf field <code>string method = 3;</code>
     * @return string
     */
    public function getMethod()
    {
        return $this->method;
    }

    /**
     * The method name of the API RPC call. For example,
     * "/google.cloud.aiplatform.{apiVersion}.DatasetService.CreateDataset"
     *
     * Generated from protobuf field <code>string method = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setMethod($var)
    {
        GPBUtil::checkString($var, True);
        $this->method = $var;

        return $this;
    }

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

}

