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

namespace Google\Cloud\AIPlatform\V1;

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

/**
 * The result output from a [FunctionCall] that contains a string representing
 * the [FunctionDeclaration.name] and a structured JSON object containing any
 * output from the function is used as context to the model. This should contain
 * the result of a [FunctionCall] made based on model prediction.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.FunctionResponse</code>
 */
class FunctionResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The name of the function to call.
     * Matches [FunctionDeclaration.name] and [FunctionCall.name].
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $name = '';
    /**
     * Required. The function response in JSON object format.
     * Use "output" key to specify function output and "error" key to specify
     * error details (if any). If "output" and "error" keys are not specified,
     * then whole "response" is treated as function output.
     *
     * Generated from protobuf field <code>.google.protobuf.Struct response = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $response = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Required. The name of the function to call.
     *           Matches [FunctionDeclaration.name] and [FunctionCall.name].
     *     @type \Google\Protobuf\Struct $response
     *           Required. The function response in JSON object format.
     *           Use "output" key to specify function output and "error" key to specify
     *           error details (if any). If "output" and "error" keys are not specified,
     *           then whole "response" is treated as function output.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\Tool::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The name of the function to call.
     * Matches [FunctionDeclaration.name] and [FunctionCall.name].
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Required. The name of the function to call.
     * Matches [FunctionDeclaration.name] and [FunctionCall.name].
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Required. The function response in JSON object format.
     * Use "output" key to specify function output and "error" key to specify
     * error details (if any). If "output" and "error" keys are not specified,
     * then whole "response" is treated as function output.
     *
     * Generated from protobuf field <code>.google.protobuf.Struct response = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Struct|null
     */
    public function getResponse()
    {
        return $this->response;
    }

    public function hasResponse()
    {
        return isset($this->response);
    }

    public function clearResponse()
    {
        unset($this->response);
    }

    /**
     * Required. The function response in JSON object format.
     * Use "output" key to specify function output and "error" key to specify
     * error details (if any). If "output" and "error" keys are not specified,
     * then whole "response" is treated as function output.
     *
     * Generated from protobuf field <code>.google.protobuf.Struct response = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Protobuf\Struct $var
     * @return $this
     */
    public function setResponse($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class);
        $this->response = $var;

        return $this;
    }

}

