<?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;

/**
 * Generated from protobuf message <code>google.cloud.webrisk.v1.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.v1.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.v1.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.v1.ThreatEntryRemovals removals = 6;</code>
     */
    private $removals = null;
    /**
     * The new opaque client version token. This should be retained by the client
     * and passed into the next call of ComputeThreatListDiff as 'version_token'.
     * A separate version token should be stored and used for each threatList.
     *
     * 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
     * discard this diff and retry later.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1.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\V1\ThreatEntryAdditions $additions
     *           A set of entries to add to a local threat type's list.
     *     @type \Google\Cloud\WebRisk\V1\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. This should be retained by the client
     *           and passed into the next call of ComputeThreatListDiff as 'version_token'.
     *           A separate version token should be stored and used for each threatList.
     *     @type \Google\Cloud\WebRisk\V1\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
     *           discard 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\V1\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.v1.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.v1.ComputeThreatListDiffResponse.ResponseType response_type = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setResponseType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\WebRisk\V1\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.v1.ThreatEntryAdditions additions = 5;</code>
     * @return \Google\Cloud\WebRisk\V1\ThreatEntryAdditions
     */
    public function getAdditions()
    {
        return $this->additions;
    }

    /**
     * A set of entries to add to a local threat type's list.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1.ThreatEntryAdditions additions = 5;</code>
     * @param \Google\Cloud\WebRisk\V1\ThreatEntryAdditions $var
     * @return $this
     */
    public function setAdditions($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1\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.v1.ThreatEntryRemovals removals = 6;</code>
     * @return \Google\Cloud\WebRisk\V1\ThreatEntryRemovals
     */
    public function getRemovals()
    {
        return $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.v1.ThreatEntryRemovals removals = 6;</code>
     * @param \Google\Cloud\WebRisk\V1\ThreatEntryRemovals $var
     * @return $this
     */
    public function setRemovals($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1\ThreatEntryRemovals::class);
        $this->removals = $var;

        return $this;
    }

    /**
     * The new opaque client version token. This should be retained by the client
     * and passed into the next call of ComputeThreatListDiff as 'version_token'.
     * A separate version token should be stored and used for each threatList.
     *
     * 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. This should be retained by the client
     * and passed into the next call of ComputeThreatListDiff as 'version_token'.
     * A separate version token should be stored and used for each threatList.
     *
     * 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
     * discard this diff and retry later.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum checksum = 8;</code>
     * @return \Google\Cloud\WebRisk\V1\ComputeThreatListDiffResponse\Checksum
     */
    public function getChecksum()
    {
        return $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
     * discard this diff and retry later.
     *
     * Generated from protobuf field <code>.google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum checksum = 8;</code>
     * @param \Google\Cloud\WebRisk\V1\ComputeThreatListDiffResponse\Checksum $var
     * @return $this
     */
    public function setChecksum($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\WebRisk\V1\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
     */
    public function getRecommendedNextDiff()
    {
        return $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;
    }

}

