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

namespace Google\Cloud\Firestore\V1;

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

/**
 * Represents an unevaluated scalar expression.
 * For example, the expression `like(user_name, "%alice%")` is represented as:
 * ```
 * name: "like"
 * args { field_reference: "user_name" }
 * args { string_value: "%alice%" }
 * ```
 *
 * Generated from protobuf message <code>google.firestore.v1.Function</code>
 */
class PBFunction extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The name of the function to evaluate.
     * **Requires:**
     * * must be in snake case (lower case with underscore separator).
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $name = '';
    /**
     * Optional. Ordered list of arguments the given function expects.
     *
     * Generated from protobuf field <code>repeated .google.firestore.v1.Value args = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $args;
    /**
     * Optional. Optional named arguments that certain functions may support.
     *
     * Generated from protobuf field <code>map<string, .google.firestore.v1.Value> options = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $options;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Required. The name of the function to evaluate.
     *           **Requires:**
     *           * must be in snake case (lower case with underscore separator).
     *     @type \Google\Cloud\Firestore\V1\Value[] $args
     *           Optional. Ordered list of arguments the given function expects.
     *     @type array|\Google\Protobuf\Internal\MapField $options
     *           Optional. Optional named arguments that certain functions may support.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Firestore\V1\Document::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The name of the function to evaluate.
     * **Requires:**
     * * must be in snake case (lower case with underscore separator).
     *
     * 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 evaluate.
     * **Requires:**
     * * must be in snake case (lower case with underscore separator).
     *
     * 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;
    }

    /**
     * Optional. Ordered list of arguments the given function expects.
     *
     * Generated from protobuf field <code>repeated .google.firestore.v1.Value args = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return RepeatedField<\Google\Cloud\Firestore\V1\Value>
     */
    public function getArgs()
    {
        return $this->args;
    }

    /**
     * Optional. Ordered list of arguments the given function expects.
     *
     * Generated from protobuf field <code>repeated .google.firestore.v1.Value args = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Firestore\V1\Value[] $var
     * @return $this
     */
    public function setArgs($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Value::class);
        $this->args = $arr;

        return $this;
    }

    /**
     * Optional. Optional named arguments that certain functions may support.
     *
     * Generated from protobuf field <code>map<string, .google.firestore.v1.Value> options = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getOptions()
    {
        return $this->options;
    }

    /**
     * Optional. Optional named arguments that certain functions may support.
     *
     * Generated from protobuf field <code>map<string, .google.firestore.v1.Value> options = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setOptions($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Value::class);
        $this->options = $arr;

        return $this;
    }

}

