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

namespace Google\Cloud\Dialogflow\V2\Tool\ConnectorTool\Action;

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

/**
 * Entity CRUD operation specification.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperation</code>
 */
class EntityOperation extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. ID of the entity.
     *
     * Generated from protobuf field <code>string entity_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $entity_id = '';
    /**
     * Required. Operation to perform on the entity.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperation.OperationType operation = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $operation = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $entity_id
     *           Required. ID of the entity.
     *     @type int $operation
     *           Required. Operation to perform on the entity.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. ID of the entity.
     *
     * Generated from protobuf field <code>string entity_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getEntityId()
    {
        return $this->entity_id;
    }

    /**
     * Required. ID of the entity.
     *
     * Generated from protobuf field <code>string entity_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setEntityId($var)
    {
        GPBUtil::checkString($var, True);
        $this->entity_id = $var;

        return $this;
    }

    /**
     * Required. Operation to perform on the entity.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperation.OperationType operation = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getOperation()
    {
        return $this->operation;
    }

    /**
     * Required. Operation to perform on the entity.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperation.OperationType operation = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setOperation($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Tool\ConnectorTool\Action\EntityOperation\OperationType::class);
        $this->operation = $var;

        return $this;
    }

}

