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

namespace Google\Cloud\DataCatalog\V1;

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

/**
 * Specification that applies to a routine. Valid only for
 * entries with the `ROUTINE` type.
 *
 * Generated from protobuf message <code>google.cloud.datacatalog.v1.RoutineSpec</code>
 */
class RoutineSpec extends \Google\Protobuf\Internal\Message
{
    /**
     * The type of the routine.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.RoutineSpec.RoutineType routine_type = 1;</code>
     */
    protected $routine_type = 0;
    /**
     * The language the routine is written in. The exact value depends on the
     * source system. For BigQuery routines, possible values are:
     * * `SQL`
     * * `JAVASCRIPT`
     *
     * Generated from protobuf field <code>string language = 2;</code>
     */
    protected $language = '';
    /**
     * Arguments of the routine.
     *
     * Generated from protobuf field <code>repeated .google.cloud.datacatalog.v1.RoutineSpec.Argument routine_arguments = 3;</code>
     */
    private $routine_arguments;
    /**
     * Return type of the argument. The exact value depends on the source system
     * and the language.
     *
     * Generated from protobuf field <code>string return_type = 4;</code>
     */
    protected $return_type = '';
    /**
     * The body of the routine.
     *
     * Generated from protobuf field <code>string definition_body = 5;</code>
     */
    protected $definition_body = '';
    protected $system_spec;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $routine_type
     *           The type of the routine.
     *     @type string $language
     *           The language the routine is written in. The exact value depends on the
     *           source system. For BigQuery routines, possible values are:
     *           * `SQL`
     *           * `JAVASCRIPT`
     *     @type array<\Google\Cloud\DataCatalog\V1\RoutineSpec\Argument>|\Google\Protobuf\Internal\RepeatedField $routine_arguments
     *           Arguments of the routine.
     *     @type string $return_type
     *           Return type of the argument. The exact value depends on the source system
     *           and the language.
     *     @type string $definition_body
     *           The body of the routine.
     *     @type \Google\Cloud\DataCatalog\V1\BigQueryRoutineSpec $bigquery_routine_spec
     *           Fields specific for BigQuery routines.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Datacatalog\V1\Datacatalog::initOnce();
        parent::__construct($data);
    }

    /**
     * The type of the routine.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.RoutineSpec.RoutineType routine_type = 1;</code>
     * @return int
     */
    public function getRoutineType()
    {
        return $this->routine_type;
    }

    /**
     * The type of the routine.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.RoutineSpec.RoutineType routine_type = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setRoutineType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\V1\RoutineSpec\RoutineType::class);
        $this->routine_type = $var;

        return $this;
    }

    /**
     * The language the routine is written in. The exact value depends on the
     * source system. For BigQuery routines, possible values are:
     * * `SQL`
     * * `JAVASCRIPT`
     *
     * Generated from protobuf field <code>string language = 2;</code>
     * @return string
     */
    public function getLanguage()
    {
        return $this->language;
    }

    /**
     * The language the routine is written in. The exact value depends on the
     * source system. For BigQuery routines, possible values are:
     * * `SQL`
     * * `JAVASCRIPT`
     *
     * Generated from protobuf field <code>string language = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setLanguage($var)
    {
        GPBUtil::checkString($var, True);
        $this->language = $var;

        return $this;
    }

    /**
     * Arguments of the routine.
     *
     * Generated from protobuf field <code>repeated .google.cloud.datacatalog.v1.RoutineSpec.Argument routine_arguments = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRoutineArguments()
    {
        return $this->routine_arguments;
    }

    /**
     * Arguments of the routine.
     *
     * Generated from protobuf field <code>repeated .google.cloud.datacatalog.v1.RoutineSpec.Argument routine_arguments = 3;</code>
     * @param array<\Google\Cloud\DataCatalog\V1\RoutineSpec\Argument>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setRoutineArguments($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\V1\RoutineSpec\Argument::class);
        $this->routine_arguments = $arr;

        return $this;
    }

    /**
     * Return type of the argument. The exact value depends on the source system
     * and the language.
     *
     * Generated from protobuf field <code>string return_type = 4;</code>
     * @return string
     */
    public function getReturnType()
    {
        return $this->return_type;
    }

    /**
     * Return type of the argument. The exact value depends on the source system
     * and the language.
     *
     * Generated from protobuf field <code>string return_type = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setReturnType($var)
    {
        GPBUtil::checkString($var, True);
        $this->return_type = $var;

        return $this;
    }

    /**
     * The body of the routine.
     *
     * Generated from protobuf field <code>string definition_body = 5;</code>
     * @return string
     */
    public function getDefinitionBody()
    {
        return $this->definition_body;
    }

    /**
     * The body of the routine.
     *
     * Generated from protobuf field <code>string definition_body = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setDefinitionBody($var)
    {
        GPBUtil::checkString($var, True);
        $this->definition_body = $var;

        return $this;
    }

    /**
     * Fields specific for BigQuery routines.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.BigQueryRoutineSpec bigquery_routine_spec = 6;</code>
     * @return \Google\Cloud\DataCatalog\V1\BigQueryRoutineSpec|null
     */
    public function getBigqueryRoutineSpec()
    {
        return $this->readOneof(6);
    }

    public function hasBigqueryRoutineSpec()
    {
        return $this->hasOneof(6);
    }

    /**
     * Fields specific for BigQuery routines.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.BigQueryRoutineSpec bigquery_routine_spec = 6;</code>
     * @param \Google\Cloud\DataCatalog\V1\BigQueryRoutineSpec $var
     * @return $this
     */
    public function setBigqueryRoutineSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\V1\BigQueryRoutineSpec::class);
        $this->writeOneof(6, $var);

        return $this;
    }

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

}

