<?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;

/**
 * A predicted [FunctionCall] returned from the model that contains a string
 * representing the [FunctionDeclaration.name] and a structured JSON object
 * containing the parameters and their values.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.FunctionCall</code>
 */
class FunctionCall extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. The name of the function to call.
     * Matches [FunctionDeclaration.name].
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $name = '';
    /**
     * Optional. The function parameters and values in JSON object format.
     * See [FunctionDeclaration.parameters] for parameter details.
     *
     * Generated from protobuf field <code>.google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $args = null;
    /**
     * Optional. The partial argument value of the function call.
     * If provided, represents the arguments/fields that are streamed
     * incrementally.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.PartialArg partial_args = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $partial_args;
    /**
     * Optional. Whether this is the last part of the FunctionCall.
     * If true, another partial message for the current FunctionCall is expected
     * to follow.
     *
     * Generated from protobuf field <code>bool will_continue = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $will_continue = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Optional. The name of the function to call.
     *           Matches [FunctionDeclaration.name].
     *     @type \Google\Protobuf\Struct $args
     *           Optional. The function parameters and values in JSON object format.
     *           See [FunctionDeclaration.parameters] for parameter details.
     *     @type array<\Google\Cloud\AIPlatform\V1\PartialArg>|\Google\Protobuf\Internal\RepeatedField $partial_args
     *           Optional. The partial argument value of the function call.
     *           If provided, represents the arguments/fields that are streamed
     *           incrementally.
     *     @type bool $will_continue
     *           Optional. Whether this is the last part of the FunctionCall.
     *           If true, another partial message for the current FunctionCall is expected
     *           to follow.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\Tool::initOnce();
        parent::__construct($data);
    }

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

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

        return $this;
    }

    /**
     * Optional. The function parameters and values in JSON object format.
     * See [FunctionDeclaration.parameters] for parameter details.
     *
     * 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 function parameters and values in JSON object format.
     * See [FunctionDeclaration.parameters] for parameter details.
     *
     * 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;
    }

    /**
     * Optional. The partial argument value of the function call.
     * If provided, represents the arguments/fields that are streamed
     * incrementally.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.PartialArg partial_args = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getPartialArgs()
    {
        return $this->partial_args;
    }

    /**
     * Optional. The partial argument value of the function call.
     * If provided, represents the arguments/fields that are streamed
     * incrementally.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.PartialArg partial_args = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<\Google\Cloud\AIPlatform\V1\PartialArg>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setPartialArgs($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\PartialArg::class);
        $this->partial_args = $arr;

        return $this;
    }

    /**
     * Optional. Whether this is the last part of the FunctionCall.
     * If true, another partial message for the current FunctionCall is expected
     * to follow.
     *
     * Generated from protobuf field <code>bool will_continue = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return bool
     */
    public function getWillContinue()
    {
        return $this->will_continue;
    }

    /**
     * Optional. Whether this is the last part of the FunctionCall.
     * If true, another partial message for the current FunctionCall is expected
     * to follow.
     *
     * Generated from protobuf field <code>bool will_continue = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param bool $var
     * @return $this
     */
    public function setWillContinue($var)
    {
        GPBUtil::checkBool($var);
        $this->will_continue = $var;

        return $this;
    }

}

