// Copyright 2022 Google LLC
//
// 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 = "proto3";

package fcp.client.cache;

import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";

option java_package = "com.google.intelligence.fcp.client";
option java_multiple_files = true;

// Maps cache IDs to CachedResource protos containing metadata and
// the file name of the cached resource.
message CacheManifest {
  // A map of `cache_id` to `CachedResource`.
  map<string, CachedResource> cache = 1;
}

message CachedResource {
  // Name of the file holding the cached resource.
  string file_name = 1;
  // Serialized metadata proto. This proto should be small.
  google.protobuf.Any metadata = 2;
  // Timestamp of when the cached resource should be deleted.
  google.protobuf.Timestamp expiry_time = 3;
  // Timestamp of when the cached resource was last accessed.
  google.protobuf.Timestamp last_accessed_time = 4;
}
