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

namespace Google\Cloud\WebRisk\V1;

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

/**
 * Describes an API diff request.
 *
 * Generated from protobuf message <code>google.cloud.webrisk.v1.ComputeThreatListDiffRequest</code>
 */
class ComputeThreatListDiffRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The threat list to update. Only a single ThreatType should be specified
     * per request. If you want to handle multiple ThreatTypes, you must make one
     * request per ThreatType.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1.ThreatType threat_type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $threat_type = 0;
    /**
     * The current version token of the client for the requested list (the
     * client version that was received from the last successful diff).
     * If the client does not have a version token (this is the first time calling
     * ComputeThreatListDiff), this may be left empty and a full database
     * snapshot will be returned.
     *
     * Generated from protobuf field <code>bytes version_token = 2;</code>
     */
    private $version_token = '';
    /**
     * Required. The constraints associated with this request.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints constraints = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $constraints = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $threat_type
     *           Required. The threat list to update. Only a single ThreatType should be specified
     *           per request. If you want to handle multiple ThreatTypes, you must make one
     *           request per ThreatType.
     *     @type string $version_token
     *           The current version token of the client for the requested list (the
     *           client version that was received from the last successful diff).
     *           If the client does not have a version token (this is the first time calling
     *           ComputeThreatListDiff), this may be left empty and a full database
     *           snapshot will be returned.
     *     @type \Google\Cloud\WebRisk\V1\ComputeThreatListDiffRequest\Constraints $constraints
     *           Required. The constraints associated with this request.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Webrisk\V1\Webrisk::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The threat list to update. Only a single ThreatType should be specified
     * per request. If you want to handle multiple ThreatTypes, you must make one
     * request per ThreatType.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1.ThreatType threat_type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getThreatType()
    {
        return $this->threat_type;
    }

    /**
     * Required. The threat list to update. Only a single ThreatType should be specified
     * per request. If you want to handle multiple ThreatTypes, you must make one
     * request per ThreatType.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1.ThreatType threat_type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setThreatType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\WebRisk\V1\ThreatType::class);
        $this->threat_type = $var;

        return $this;
    }

    /**
     * The current version token of the client for the requested list (the
     * client version that was received from the last successful diff).
     * If the client does not have a version token (this is the first time calling
     * ComputeThreatListDiff), this may be left empty and a full database
     * snapshot will be returned.
     *
     * Generated from protobuf field <code>bytes version_token = 2;</code>
     * @return string
     */
    public function getVersionToken()
    {
        return $this->version_token;
    }

    /**
     * The current version token of the client for the requested list (the
     * client version that was received from the last successful diff).
     * If the client does not have a version token (this is the first time calling
     * ComputeThreatListDiff), this may be left empty and a full database
     * snapshot will be returned.
     *
     * Generated from protobuf field <code>bytes version_token = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setVersionToken($var)
    {
        GPBUtil::checkString($var, False);
        $this->version_token = $var;

        return $this;
    }

    /**
     * Required. The constraints associated with this request.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints constraints = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\WebRisk\V1\ComputeThreatListDiffRequest\Constraints|null
     */
    public function getConstraints()
    {
        return $this->constraints;
    }

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

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

    /**
     * Required. The constraints associated with this request.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints constraints = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\WebRisk\V1\ComputeThreatListDiffRequest\Constraints $var
     * @return $this
     */
    public function setConstraints($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1\ComputeThreatListDiffRequest\Constraints::class);
        $this->constraints = $var;

        return $this;
    }

}

