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

namespace Google\Cloud\Dialogflow\V2;

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

/**
 * Represents a tool.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.Tool</code>
 */
class Tool extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. Identifier. The resource name of the tool. Format:
     * `projects/<Project ID>/locations/<Location ID>/tools/<Tool ID>`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $name = '';
    /**
     * Required. A human readable short name of the tool, which should be unique
     * within the project. It should only contain letters, numbers, and
     * underscores, and it will be used by LLM to identify the tool.
     *
     * Generated from protobuf field <code>string tool_key = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $tool_key = '';
    /**
     * Optional. A human readable short name of the tool, to be shown on the UI.
     *
     * Generated from protobuf field <code>string display_name = 19 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $display_name = '';
    /**
     * Optional. A human readable description of the tool.
     *
     * Generated from protobuf field <code>string description = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $description = '';
    /**
     * Optional. Confirmation requirement for the actions. Each key is an action
     * name in the action_schemas. If an action's confirmation requirement is
     * unspecified (either the key is not present, or its value is
     * CONFIRMATION_REQUIREMENT_UNSPECIFIED), the requirement is inferred from the
     * action's method_type - confirmation is not required if and only if
     * method_type is GET.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.dialogflow.v2.Tool.ConfirmationRequirement> action_confirmation_requirement = 17 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $action_confirmation_requirement;
    /**
     * Output only. Creation time of this tool.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Output only. Update time of this tool.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $update_time = null;
    /**
     * Output only. A read only boolean field reflecting Zone Separation
     * status of the tool. If the field is absent, it means the status is unknown.
     *
     * Generated from protobuf field <code>optional bool satisfies_pzs = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $satisfies_pzs = null;
    /**
     * Output only. A read only boolean field reflecting Zone Isolation status
     * of the tool. If the field is absent, it means the status is unknown.
     *
     * Generated from protobuf field <code>optional bool satisfies_pzi = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $satisfies_pzi = null;
    protected $specification;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. Identifier. The resource name of the tool. Format:
     *           `projects/<Project ID>/locations/<Location ID>/tools/<Tool ID>`.
     *     @type string $tool_key
     *           Required. A human readable short name of the tool, which should be unique
     *           within the project. It should only contain letters, numbers, and
     *           underscores, and it will be used by LLM to identify the tool.
     *     @type string $display_name
     *           Optional. A human readable short name of the tool, to be shown on the UI.
     *     @type string $description
     *           Optional. A human readable description of the tool.
     *     @type array|\Google\Protobuf\Internal\MapField $action_confirmation_requirement
     *           Optional. Confirmation requirement for the actions. Each key is an action
     *           name in the action_schemas. If an action's confirmation requirement is
     *           unspecified (either the key is not present, or its value is
     *           CONFIRMATION_REQUIREMENT_UNSPECIFIED), the requirement is inferred from the
     *           action's method_type - confirmation is not required if and only if
     *           method_type is GET.
     *     @type \Google\Cloud\Dialogflow\V2\Tool\ExtensionTool $extension_spec
     *           Vertex extension tool specification.
     *     @type \Google\Cloud\Dialogflow\V2\Tool\FunctionTool $function_spec
     *           Client side executed function specification.
     *     @type \Google\Cloud\Dialogflow\V2\Tool\ConnectorTool $connector_spec
     *           Integration connectors tool specification.
     *     @type \Google\Cloud\Dialogflow\V2\Tool\OpenApiTool $open_api_spec
     *           OpenAPI tool.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. Creation time of this tool.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. Update time of this tool.
     *     @type bool $satisfies_pzs
     *           Output only. A read only boolean field reflecting Zone Separation
     *           status of the tool. If the field is absent, it means the status is unknown.
     *     @type bool $satisfies_pzi
     *           Output only. A read only boolean field reflecting Zone Isolation status
     *           of the tool. If the field is absent, it means the status is unknown.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. Identifier. The resource name of the tool. Format:
     * `projects/<Project ID>/locations/<Location ID>/tools/<Tool ID>`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. Identifier. The resource name of the tool. Format:
     * `projects/<Project ID>/locations/<Location ID>/tools/<Tool ID>`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Required. A human readable short name of the tool, which should be unique
     * within the project. It should only contain letters, numbers, and
     * underscores, and it will be used by LLM to identify the tool.
     *
     * Generated from protobuf field <code>string tool_key = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getToolKey()
    {
        return $this->tool_key;
    }

    /**
     * Required. A human readable short name of the tool, which should be unique
     * within the project. It should only contain letters, numbers, and
     * underscores, and it will be used by LLM to identify the tool.
     *
     * Generated from protobuf field <code>string tool_key = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setToolKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->tool_key = $var;

        return $this;
    }

    /**
     * Optional. A human readable short name of the tool, to be shown on the UI.
     *
     * Generated from protobuf field <code>string display_name = 19 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * Optional. A human readable short name of the tool, to be shown on the UI.
     *
     * Generated from protobuf field <code>string display_name = 19 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDisplayName($var)
    {
        GPBUtil::checkString($var, True);
        $this->display_name = $var;

        return $this;
    }

    /**
     * Optional. A human readable description of the tool.
     *
     * Generated from protobuf field <code>string description = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Optional. A human readable description of the tool.
     *
     * Generated from protobuf field <code>string description = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * Optional. Confirmation requirement for the actions. Each key is an action
     * name in the action_schemas. If an action's confirmation requirement is
     * unspecified (either the key is not present, or its value is
     * CONFIRMATION_REQUIREMENT_UNSPECIFIED), the requirement is inferred from the
     * action's method_type - confirmation is not required if and only if
     * method_type is GET.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.dialogflow.v2.Tool.ConfirmationRequirement> action_confirmation_requirement = 17 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getActionConfirmationRequirement()
    {
        return $this->action_confirmation_requirement;
    }

    /**
     * Optional. Confirmation requirement for the actions. Each key is an action
     * name in the action_schemas. If an action's confirmation requirement is
     * unspecified (either the key is not present, or its value is
     * CONFIRMATION_REQUIREMENT_UNSPECIFIED), the requirement is inferred from the
     * action's method_type - confirmation is not required if and only if
     * method_type is GET.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.dialogflow.v2.Tool.ConfirmationRequirement> action_confirmation_requirement = 17 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setActionConfirmationRequirement($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\Tool\ConfirmationRequirement::class);
        $this->action_confirmation_requirement = $arr;

        return $this;
    }

    /**
     * Vertex extension tool specification.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.ExtensionTool extension_spec = 4 [deprecated = true];</code>
     * @return \Google\Cloud\Dialogflow\V2\Tool\ExtensionTool|null
     * @deprecated
     */
    public function getExtensionSpec()
    {
        if ($this->hasOneof(4)) {
            @trigger_error('extension_spec is deprecated.', E_USER_DEPRECATED);
        }
        return $this->readOneof(4);
    }

    public function hasExtensionSpec()
    {
        if ($this->hasOneof(4)) {
            @trigger_error('extension_spec is deprecated.', E_USER_DEPRECATED);
        }
        return $this->hasOneof(4);
    }

    /**
     * Vertex extension tool specification.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.ExtensionTool extension_spec = 4 [deprecated = true];</code>
     * @param \Google\Cloud\Dialogflow\V2\Tool\ExtensionTool $var
     * @return $this
     * @deprecated
     */
    public function setExtensionSpec($var)
    {
        @trigger_error('extension_spec is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool\ExtensionTool::class);
        $this->writeOneof(4, $var);

        return $this;
    }

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

        return $this;
    }

    /**
     * Integration connectors tool specification.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.ConnectorTool connector_spec = 18;</code>
     * @return \Google\Cloud\Dialogflow\V2\Tool\ConnectorTool|null
     */
    public function getConnectorSpec()
    {
        return $this->readOneof(18);
    }

    public function hasConnectorSpec()
    {
        return $this->hasOneof(18);
    }

    /**
     * Integration connectors tool specification.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.ConnectorTool connector_spec = 18;</code>
     * @param \Google\Cloud\Dialogflow\V2\Tool\ConnectorTool $var
     * @return $this
     */
    public function setConnectorSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool\ConnectorTool::class);
        $this->writeOneof(18, $var);

        return $this;
    }

    /**
     * OpenAPI tool.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.OpenApiTool open_api_spec = 20;</code>
     * @return \Google\Cloud\Dialogflow\V2\Tool\OpenApiTool|null
     */
    public function getOpenApiSpec()
    {
        return $this->readOneof(20);
    }

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

    /**
     * OpenAPI tool.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.OpenApiTool open_api_spec = 20;</code>
     * @param \Google\Cloud\Dialogflow\V2\Tool\OpenApiTool $var
     * @return $this
     */
    public function setOpenApiSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Tool\OpenApiTool::class);
        $this->writeOneof(20, $var);

        return $this;
    }

    /**
     * Output only. Creation time of this tool.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. Creation time of this tool.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Output only. Update time of this tool.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * Output only. Update time of this tool.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

    /**
     * Output only. A read only boolean field reflecting Zone Separation
     * status of the tool. If the field is absent, it means the status is unknown.
     *
     * Generated from protobuf field <code>optional bool satisfies_pzs = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return bool
     */
    public function getSatisfiesPzs()
    {
        return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false;
    }

    public function hasSatisfiesPzs()
    {
        return isset($this->satisfies_pzs);
    }

    public function clearSatisfiesPzs()
    {
        unset($this->satisfies_pzs);
    }

    /**
     * Output only. A read only boolean field reflecting Zone Separation
     * status of the tool. If the field is absent, it means the status is unknown.
     *
     * Generated from protobuf field <code>optional bool satisfies_pzs = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param bool $var
     * @return $this
     */
    public function setSatisfiesPzs($var)
    {
        GPBUtil::checkBool($var);
        $this->satisfies_pzs = $var;

        return $this;
    }

    /**
     * Output only. A read only boolean field reflecting Zone Isolation status
     * of the tool. If the field is absent, it means the status is unknown.
     *
     * Generated from protobuf field <code>optional bool satisfies_pzi = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return bool
     */
    public function getSatisfiesPzi()
    {
        return isset($this->satisfies_pzi) ? $this->satisfies_pzi : false;
    }

    public function hasSatisfiesPzi()
    {
        return isset($this->satisfies_pzi);
    }

    public function clearSatisfiesPzi()
    {
        unset($this->satisfies_pzi);
    }

    /**
     * Output only. A read only boolean field reflecting Zone Isolation status
     * of the tool. If the field is absent, it means the status is unknown.
     *
     * Generated from protobuf field <code>optional bool satisfies_pzi = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param bool $var
     * @return $this
     */
    public function setSatisfiesPzi($var)
    {
        GPBUtil::checkBool($var);
        $this->satisfies_pzi = $var;

        return $this;
    }

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

}

