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

namespace Google\Cloud\Ces\V1;

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

/**
 * Request message for
 * [ToolService.ExecuteTool][google.cloud.ces.v1.ToolService.ExecuteTool].
 *
 * Generated from protobuf message <code>google.cloud.ces.v1.ExecuteToolRequest</code>
 */
class ExecuteToolRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The resource name of the app which the tool/toolset belongs to.
     * Format: `projects/{project}/locations/{location}/apps/{app}`
     *
     * Generated from protobuf field <code>string parent = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Optional. The input parameters and values for the tool in JSON object
     * format.
     *
     * Generated from protobuf field <code>.google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $args = null;
    protected $tool_identifier;
    protected $tool_execution_context;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $tool
     *           Optional. The name of the tool to execute.
     *           Format:
     *           projects/{project}/locations/{location}/apps/{app}/tools/{tool}
     *     @type \Google\Cloud\Ces\V1\ToolsetTool $toolset_tool
     *           Optional. The toolset tool to execute. Only one tool should match the
     *           predicate from the toolset. Otherwise, an error will be returned.
     *     @type \Google\Protobuf\Struct $variables
     *           Optional. The variables that are available for the tool execution.
     *     @type \Google\Protobuf\Struct $context
     *           Optional. The
     *           [ToolCallContext](https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps/tool/python#environment
     *           for details) to be passed to the Python tool.
     *     @type string $parent
     *           Required. The resource name of the app which the tool/toolset belongs to.
     *           Format: `projects/{project}/locations/{location}/apps/{app}`
     *     @type \Google\Protobuf\Struct $args
     *           Optional. The input parameters and values for the tool in JSON object
     *           format.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Ces\V1\ToolService::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. The name of the tool to execute.
     * Format:
     * projects/{project}/locations/{location}/apps/{app}/tools/{tool}
     *
     * Generated from protobuf field <code>string tool = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getTool()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Optional. The name of the tool to execute.
     * Format:
     * projects/{project}/locations/{location}/apps/{app}/tools/{tool}
     *
     * Generated from protobuf field <code>string tool = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setTool($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Optional. The toolset tool to execute. Only one tool should match the
     * predicate from the toolset. Otherwise, an error will be returned.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.ToolsetTool toolset_tool = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Ces\V1\ToolsetTool|null
     */
    public function getToolsetTool()
    {
        return $this->readOneof(3);
    }

    public function hasToolsetTool()
    {
        return $this->hasOneof(3);
    }

    /**
     * Optional. The toolset tool to execute. Only one tool should match the
     * predicate from the toolset. Otherwise, an error will be returned.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.ToolsetTool toolset_tool = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Ces\V1\ToolsetTool $var
     * @return $this
     */
    public function setToolsetTool($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Ces\V1\ToolsetTool::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Optional. The variables that are available for the tool execution.
     *
     * Generated from protobuf field <code>.google.protobuf.Struct variables = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Struct|null
     */
    public function getVariables()
    {
        return $this->readOneof(5);
    }

    public function hasVariables()
    {
        return $this->hasOneof(5);
    }

    /**
     * Optional. The variables that are available for the tool execution.
     *
     * Generated from protobuf field <code>.google.protobuf.Struct variables = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\Struct $var
     * @return $this
     */
    public function setVariables($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Optional. The
     * [ToolCallContext](https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps/tool/python#environment
     * for details) to be passed to the Python tool.
     *
     * Generated from protobuf field <code>.google.protobuf.Struct context = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Struct|null
     */
    public function getContext()
    {
        return $this->readOneof(6);
    }

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

    /**
     * Optional. The
     * [ToolCallContext](https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps/tool/python#environment
     * for details) to be passed to the Python tool.
     *
     * Generated from protobuf field <code>.google.protobuf.Struct context = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\Struct $var
     * @return $this
     */
    public function setContext($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * Required. The resource name of the app which the tool/toolset belongs to.
     * Format: `projects/{project}/locations/{location}/apps/{app}`
     *
     * Generated from protobuf field <code>string parent = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. The resource name of the app which the tool/toolset belongs to.
     * Format: `projects/{project}/locations/{location}/apps/{app}`
     *
     * Generated from protobuf field <code>string parent = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Optional. The input parameters and values for the tool in JSON object
     * format.
     *
     * Generated from protobuf field <code>.google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Struct|null
     */
    public function getArgs()
    {
        return $this->args;
    }

    public function hasArgs()
    {
        return isset($this->args);
    }

    public function clearArgs()
    {
        unset($this->args);
    }

    /**
     * Optional. The input parameters and values for the tool in JSON object
     * format.
     *
     * Generated from protobuf field <code>.google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\Struct $var
     * @return $this
     */
    public function setArgs($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class);
        $this->args = $var;

        return $this;
    }

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

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

}

