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

namespace Google\Cloud\Dialogflow\V2;

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

/**
 * Request message of CreateGenerator.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.CreateGeneratorRequest</code>
 */
class CreateGeneratorRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The project/location to create generator for. Format:
     * `projects/<Project ID>/locations/<Location ID>`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Required. The generator to create.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Generator generator = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $generator = null;
    /**
     * Optional. The ID to use for the generator, which will become the final
     * component of the generator's resource name.
     * The generator ID must be compliant with the regression formula
     * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64].
     * If the field is not provided, an Id will be auto-generated.
     * If the field is provided, the caller is responsible for
     * 1. the uniqueness of the ID, otherwise the request will be rejected.
     * 2. the consistency for whether to use custom ID or not under a project to
     * better ensure uniqueness.
     *
     * Generated from protobuf field <code>string generator_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $generator_id = '';

    /**
     * @param string                                $parent      Required. The project/location to create generator for. Format:
     *                                                           `projects/<Project ID>/locations/<Location ID>`
     *                                                           Please see {@see GeneratorsClient::projectName()} for help formatting this field.
     * @param \Google\Cloud\Dialogflow\V2\Generator $generator   Required. The generator to create.
     * @param string                                $generatorId Optional. The ID to use for the generator, which will become the final
     *                                                           component of the generator's resource name.
     *
     *                                                           The generator ID must be compliant with the regression formula
     *                                                           `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64].
     *                                                           If the field is not provided, an Id will be auto-generated.
     *                                                           If the field is provided, the caller is responsible for
     *                                                           1. the uniqueness of the ID, otherwise the request will be rejected.
     *                                                           2. the consistency for whether to use custom ID or not under a project to
     *                                                           better ensure uniqueness.
     *
     * @return \Google\Cloud\Dialogflow\V2\CreateGeneratorRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Cloud\Dialogflow\V2\Generator $generator, string $generatorId): self
    {
        return (new self())
            ->setParent($parent)
            ->setGenerator($generator)
            ->setGeneratorId($generatorId);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The project/location to create generator for. Format:
     *           `projects/<Project ID>/locations/<Location ID>`
     *     @type \Google\Cloud\Dialogflow\V2\Generator $generator
     *           Required. The generator to create.
     *     @type string $generator_id
     *           Optional. The ID to use for the generator, which will become the final
     *           component of the generator's resource name.
     *           The generator ID must be compliant with the regression formula
     *           `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64].
     *           If the field is not provided, an Id will be auto-generated.
     *           If the field is provided, the caller is responsible for
     *           1. the uniqueness of the ID, otherwise the request will be rejected.
     *           2. the consistency for whether to use custom ID or not under a project to
     *           better ensure uniqueness.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The project/location to create generator for. Format:
     * `projects/<Project ID>/locations/<Location ID>`
     *
     * 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/location to create generator for. Format:
     * `projects/<Project ID>/locations/<Location ID>`
     *
     * 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. The generator to create.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Generator generator = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Dialogflow\V2\Generator|null
     */
    public function getGenerator()
    {
        return $this->generator;
    }

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

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

    /**
     * Required. The generator to create.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Generator generator = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Dialogflow\V2\Generator $var
     * @return $this
     */
    public function setGenerator($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Generator::class);
        $this->generator = $var;

        return $this;
    }

    /**
     * Optional. The ID to use for the generator, which will become the final
     * component of the generator's resource name.
     * The generator ID must be compliant with the regression formula
     * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64].
     * If the field is not provided, an Id will be auto-generated.
     * If the field is provided, the caller is responsible for
     * 1. the uniqueness of the ID, otherwise the request will be rejected.
     * 2. the consistency for whether to use custom ID or not under a project to
     * better ensure uniqueness.
     *
     * Generated from protobuf field <code>string generator_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getGeneratorId()
    {
        return $this->generator_id;
    }

    /**
     * Optional. The ID to use for the generator, which will become the final
     * component of the generator's resource name.
     * The generator ID must be compliant with the regression formula
     * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64].
     * If the field is not provided, an Id will be auto-generated.
     * If the field is provided, the caller is responsible for
     * 1. the uniqueness of the ID, otherwise the request will be rejected.
     * 2. the consistency for whether to use custom ID or not under a project to
     * better ensure uniqueness.
     *
     * Generated from protobuf field <code>string generator_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setGeneratorId($var)
    {
        GPBUtil::checkString($var, True);
        $this->generator_id = $var;

        return $this;
    }

}

