// Copyright 2021 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto2";

package android.downloader;

option java_multiple_files = true;
option java_package = "com.google.android.downloader";
option java_outer_classname = "DownloadMetadataProtoOuter";

// Message encoding download metadata. May be persisted by implementations of
// DownloadDestination (e.g. ProtoFileDownloadDestination) so that interrupted
// downloads can be safely resumed.
message DownloadMetadataProto {
  // The opaque content tag associated with the download. Commonly this
  // is a checksum or hash of the actual data. However, the client should never
  // attempt to infer any properties about this string, and should instead
  // treat it as a token to be persisted and returned unaltered. This tag
  // is used to ensure the underlying HTTP resource did not change across
  // requests.
  optional string content_tag = 1;

  // The UNIX epoch timestamp, in seconds, for when the resource the download
  // targets was last modified. This timestamp is used to determine if the
  // underlying HTTP resource changed across requests.
  optional int64 last_modified_time_seconds = 2;
}