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

namespace Google\Cloud\WebRisk\V1beta1;

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

/**
 * Generated from protobuf message <code>google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse</code>
 */
class ComputeThreatListDiffResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * The type of response. This may indicate that an action must be taken by the
     * client when the response is received.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.ResponseType response_type = 4;</code>
     */
    private $response_type = 0;
    /**
     * A set of entries to add to a local threat type's list.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1beta1.ThreatEntryAdditions additions = 5;</code>
     */
    private $additions = null;
    /**
     * A set of entries to remove from a local threat type's list.
     * This field may be empty.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1beta1.ThreatEntryRemovals removals = 6;</code>
     */
    private $removals = null;
    /**
     * The new opaque client version token.
     *
     * Generated from protobuf field <code>bytes new_version_token = 7;</code>
     */
    private $new_version_token = '';
    /**
     * The expected SHA256 hash of the client state; that is, of the sorted list
     * of all hashes present in the database after applying the provided diff.
     * If the client state doesn't match the expected state, the client must
     * disregard this diff and retry later.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum checksum = 8;</code>
     */
    private $checksum = null;
    /**
     * The soonest the client should wait before issuing any diff
     * request. Querying sooner is unlikely to produce a meaningful diff.
     * Waiting longer is acceptable considering the use case.
     * If this field is not set clients may update as soon as they want.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp recommended_next_diff = 2;</code>
     */
    private $recommended_next_diff = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $response_type
     *           The type of response. This may indicate that an action must be taken by the
     *           client when the response is received.
     *     @type \Google\Cloud\WebRisk\V1beta1\ThreatEntryAdditions $additions
     *           A set of entries to add to a local threat type's list.
     *     @type \Google\Cloud\WebRisk\V1beta1\ThreatEntryRemovals $removals
     *           A set of entries to remove from a local threat type's list.
     *           This field may be empty.
     *     @type string $new_version_token
     *           The new opaque client version token.
     *     @type \Google\Cloud\WebRisk\V1beta1\ComputeThreatListDiffResponse\Checksum $checksum
     *           The expected SHA256 hash of the client state; that is, of the sorted list
     *           of all hashes present in the database after applying the provided diff.
     *           If the client state doesn't match the expected state, the client must
     *           disregard this diff and retry later.
     *     @type \Google\Protobuf\Timestamp $recommended_next_diff
     *           The soonest the client should wait before issuing any diff
     *           request. Querying sooner is unlikely to produce a meaningful diff.
     *           Waiting longer is acceptable considering the use case.
     *           If this field is not set clients may update as soon as they want.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Webrisk\V1Beta1\Webrisk::initOnce();
        parent::__construct($data);
    }

    /**
     * The type of response. This may indicate that an action must be taken by the
     * client when the response is received.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.ResponseType response_type = 4;</code>
     * @return int
     */
    public function getResponseType()
    {
        return $this->response_type;
    }

    /**
     * The type of response. This may indicate that an action must be taken by the
     * client when the response is received.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.ResponseType response_type = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setResponseType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\WebRisk\V1beta1\ComputeThreatListDiffResponse\ResponseType::class);
        $this->response_type = $var;

        return $this;
    }

    /**
     * A set of entries to add to a local threat type's list.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1beta1.ThreatEntryAdditions additions = 5;</code>
     * @return \Google\Cloud\WebRisk\V1beta1\ThreatEntryAdditions|null
     */
    public function getAdditions()
    {
        return isset($this->additions) ? $this->additions : null;
    }

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

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

    /**
     * A set of entries to add to a local threat type's list.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1beta1.ThreatEntryAdditions additions = 5;</code>
     * @param \Google\Cloud\WebRisk\V1beta1\ThreatEntryAdditions $var
     * @return $this
     */
    public function setAdditions($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1beta1\ThreatEntryAdditions::class);
        $this->additions = $var;

        return $this;
    }

    /**
     * A set of entries to remove from a local threat type's list.
     * This field may be empty.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1beta1.ThreatEntryRemovals removals = 6;</code>
     * @return \Google\Cloud\WebRisk\V1beta1\ThreatEntryRemovals|null
     */
    public function getRemovals()
    {
        return isset($this->removals) ? $this->removals : null;
    }

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

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

    /**
     * A set of entries to remove from a local threat type's list.
     * This field may be empty.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1beta1.ThreatEntryRemovals removals = 6;</code>
     * @param \Google\Cloud\WebRisk\V1beta1\ThreatEntryRemovals $var
     * @return $this
     */
    public function setRemovals($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1beta1\ThreatEntryRemovals::class);
        $this->removals = $var;

        return $this;
    }

    /**
     * The new opaque client version token.
     *
     * Generated from protobuf field <code>bytes new_version_token = 7;</code>
     * @return string
     */
    public function getNewVersionToken()
    {
        return $this->new_version_token;
    }

    /**
     * The new opaque client version token.
     *
     * Generated from protobuf field <code>bytes new_version_token = 7;</code>
     * @param string $var
     * @return $this
     */
    public function setNewVersionToken($var)
    {
        GPBUtil::checkString($var, False);
        $this->new_version_token = $var;

        return $this;
    }

    /**
     * The expected SHA256 hash of the client state; that is, of the sorted list
     * of all hashes present in the database after applying the provided diff.
     * If the client state doesn't match the expected state, the client must
     * disregard this diff and retry later.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum checksum = 8;</code>
     * @return \Google\Cloud\WebRisk\V1beta1\ComputeThreatListDiffResponse\Checksum|null
     */
    public function getChecksum()
    {
        return isset($this->checksum) ? $this->checksum : null;
    }

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

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

    /**
     * The expected SHA256 hash of the client state; that is, of the sorted list
     * of all hashes present in the database after applying the provided diff.
     * If the client state doesn't match the expected state, the client must
     * disregard this diff and retry later.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum checksum = 8;</code>
     * @param \Google\Cloud\WebRisk\V1beta1\ComputeThreatListDiffResponse\Checksum $var
     * @return $this
     */
    public function setChecksum($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1beta1\ComputeThreatListDiffResponse\Checksum::class);
        $this->checksum = $var;

        return $this;
    }

    /**
     * The soonest the client should wait before issuing any diff
     * request. Querying sooner is unlikely to produce a meaningful diff.
     * Waiting longer is acceptable considering the use case.
     * If this field is not set clients may update as soon as they want.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp recommended_next_diff = 2;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getRecommendedNextDiff()
    {
        return isset($this->recommended_next_diff) ? $this->recommended_next_diff : null;
    }

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

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

    /**
     * The soonest the client should wait before issuing any diff
     * request. Querying sooner is unlikely to produce a meaningful diff.
     * Waiting longer is acceptable considering the use case.
     * If this field is not set clients may update as soon as they want.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp recommended_next_diff = 2;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setRecommendedNextDiff($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->recommended_next_diff = $var;

        return $this;
    }

}

