<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/dialogflow/cx/v3/tool.proto

namespace Google\Cloud\Dialogflow\Cx\V3;

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

/**
 * A tool provides a list of actions which are available to the
 * [Playbook][google.cloud.dialogflow.cx.v3.Playbook] to attain its goal. A Tool
 * consists of a description of the tool's usage and a specification of the tool
 * which contains the schema and authentication information.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.cx.v3.Tool</code>
 */
class Tool extends \Google\Protobuf\Internal\Message
{
    /**
     * The unique identifier of the Tool.
     * Format:
     * `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/tools/<ToolID>`.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    protected $name = '';
    /**
     * Required. The human-readable name of the Tool, unique within an agent.
     *
     * Generated from protobuf field <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $display_name = '';
    /**
     * Required. High level description of the Tool and its usage.
     *
     * Generated from protobuf field <code>string description = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $description = '';
    /**
     * Output only. The tool type.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.Tool.ToolType tool_type = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $tool_type = 0;
    protected $specification;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           The unique identifier of the Tool.
     *           Format:
     *           `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/tools/<ToolID>`.
     *     @type string $display_name
     *           Required. The human-readable name of the Tool, unique within an agent.
     *     @type string $description
     *           Required. High level description of the Tool and its usage.
     *     @type \Google\Cloud\Dialogflow\Cx\V3\Tool\OpenApiTool $open_api_spec
     *           OpenAPI specification of the Tool.
     *     @type \Google\Cloud\Dialogflow\Cx\V3\Tool\DataStoreTool $data_store_spec
     *           Data store search tool specification.
     *     @type \Google\Cloud\Dialogflow\Cx\V3\Tool\FunctionTool $function_spec
     *           Client side executed function specification.
     *     @type int $tool_type
     *           Output only. The tool type.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\Cx\V3\Tool::initOnce();
        parent::__construct($data);
    }

    /**
     * The unique identifier of the Tool.
     * Format:
     * `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/tools/<ToolID>`.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * The unique identifier of the Tool.
     * Format:
     * `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/tools/<ToolID>`.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Required. The human-readable name of the Tool, unique within an agent.
     *
     * Generated from protobuf field <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * Required. The human-readable name of the Tool, unique within an agent.
     *
     * Generated from protobuf field <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setDisplayName($var)
    {
        GPBUtil::checkString($var, True);
        $this->display_name = $var;

        return $this;
    }

    /**
     * Required. High level description of the Tool and its usage.
     *
     * Generated from protobuf field <code>string description = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Required. High level description of the Tool and its usage.
     *
     * Generated from protobuf field <code>string description = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * OpenAPI specification of the Tool.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.Tool.OpenApiTool open_api_spec = 4;</code>
     * @return \Google\Cloud\Dialogflow\Cx\V3\Tool\OpenApiTool|null
     */
    public function getOpenApiSpec()
    {
        return $this->readOneof(4);
    }

    public function hasOpenApiSpec()
    {
        return $this->hasOneof(4);
    }

    /**
     * OpenAPI specification of the Tool.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.Tool.OpenApiTool open_api_spec = 4;</code>
     * @param \Google\Cloud\Dialogflow\Cx\V3\Tool\OpenApiTool $var
     * @return $this
     */
    public function setOpenApiSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\Cx\V3\Tool\OpenApiTool::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Data store search tool specification.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.Tool.DataStoreTool data_store_spec = 8;</code>
     * @return \Google\Cloud\Dialogflow\Cx\V3\Tool\DataStoreTool|null
     */
    public function getDataStoreSpec()
    {
        return $this->readOneof(8);
    }

    public function hasDataStoreSpec()
    {
        return $this->hasOneof(8);
    }

    /**
     * Data store search tool specification.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.Tool.DataStoreTool data_store_spec = 8;</code>
     * @param \Google\Cloud\Dialogflow\Cx\V3\Tool\DataStoreTool $var
     * @return $this
     */
    public function setDataStoreSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\Cx\V3\Tool\DataStoreTool::class);
        $this->writeOneof(8, $var);

        return $this;
    }

    /**
     * Client side executed function specification.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.Tool.FunctionTool function_spec = 13;</code>
     * @return \Google\Cloud\Dialogflow\Cx\V3\Tool\FunctionTool|null
     */
    public function getFunctionSpec()
    {
        return $this->readOneof(13);
    }

    public function hasFunctionSpec()
    {
        return $this->hasOneof(13);
    }

    /**
     * Client side executed function specification.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.Tool.FunctionTool function_spec = 13;</code>
     * @param \Google\Cloud\Dialogflow\Cx\V3\Tool\FunctionTool $var
     * @return $this
     */
    public function setFunctionSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\Cx\V3\Tool\FunctionTool::class);
        $this->writeOneof(13, $var);

        return $this;
    }

    /**
     * Output only. The tool type.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.Tool.ToolType tool_type = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getToolType()
    {
        return $this->tool_type;
    }

    /**
     * Output only. The tool type.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.Tool.ToolType tool_type = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setToolType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\Cx\V3\Tool\ToolType::class);
        $this->tool_type = $var;

        return $this;
    }

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

}

