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

namespace Google\Cloud\Functions\V2;

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

/**
 * Request for the `CreateFunction` method.
 *
 * Generated from protobuf message <code>google.cloud.functions.v2.CreateFunctionRequest</code>
 */
class CreateFunctionRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The project and location in which the function should be created, specified
     * in the format `projects/&#42;&#47;locations/&#42;`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * Required. Function to be created.
     *
     * Generated from protobuf field <code>.google.cloud.functions.v2.Function function = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $function = null;
    /**
     * The ID to use for the function, which will become the final component of
     * the function's resource name.
     * This value should be 4-63 characters, and valid characters
     * are /[a-z][0-9]-/.
     *
     * Generated from protobuf field <code>string function_id = 3;</code>
     */
    private $function_id = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The project and location in which the function should be created, specified
     *           in the format `projects/&#42;&#47;locations/&#42;`
     *     @type \Google\Cloud\Functions\V2\PBFunction $function
     *           Required. Function to be created.
     *     @type string $function_id
     *           The ID to use for the function, which will become the final component of
     *           the function's resource name.
     *           This value should be 4-63 characters, and valid characters
     *           are /[a-z][0-9]-/.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Functions\V2\Functions::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The project and location in which the function should be created, specified
     * in the format `projects/&#42;&#47;locations/&#42;`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. The project and location in which the function should be created, specified
     * in the format `projects/&#42;&#47;locations/&#42;`
     *
     * Generated from protobuf field <code>string parent = 1 [(.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;
    }

    /**
     * Required. Function to be created.
     *
     * Generated from protobuf field <code>.google.cloud.functions.v2.Function function = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Functions\V2\PBFunction|null
     */
    public function getFunction()
    {
        return $this->function;
    }

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

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

    /**
     * Required. Function to be created.
     *
     * Generated from protobuf field <code>.google.cloud.functions.v2.Function function = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Functions\V2\PBFunction $var
     * @return $this
     */
    public function setFunction($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Functions\V2\PBFunction::class);
        $this->function = $var;

        return $this;
    }

    /**
     * The ID to use for the function, which will become the final component of
     * the function's resource name.
     * This value should be 4-63 characters, and valid characters
     * are /[a-z][0-9]-/.
     *
     * Generated from protobuf field <code>string function_id = 3;</code>
     * @return string
     */
    public function getFunctionId()
    {
        return $this->function_id;
    }

    /**
     * The ID to use for the function, which will become the final component of
     * the function's resource name.
     * This value should be 4-63 characters, and valid characters
     * are /[a-z][0-9]-/.
     *
     * Generated from protobuf field <code>string function_id = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setFunctionId($var)
    {
        GPBUtil::checkString($var, True);
        $this->function_id = $var;

        return $this;
    }

}

