// Proposed contract, version 1. Status: proposal for review, not confirmed design.
//
// Callers: farm (when a sync client reports the installation it runs as, to check that the installation
// exists, belongs to the sync client application and to the same Organization; req 67.2, 118).
// Deadline: 2 s.
// The callers listed are authentication only (decided 2026-11-11): each RPC below names who may call it and what
// it sees, and refuses anyone else with PERMISSION_DENIED.
// x-moonitoring-callers: farm
// x-moonitoring-requirements: 67.2, 118
syntax = "proto3";

package moonitoring.releases.installations.v1;

import "google/protobuf/timestamp.proto";

service InstallationsService {
  // Whether an installation exists and what it is.
  // Callers: farm only. Sees: the answer for the installation it asks about; it cannot list installations.
  rpc VerifyInstallation(VerifyInstallationRequest) returns (VerifyInstallationResponse);
}

message VerifyInstallationRequest {
  string installation_id = 1;
}

message VerifyInstallationResponse {
  bool exists = 1;
  string application_id = 2;
  string application_slug = 3;
  string channel_id = 4;
  string organization_id = 5;
  string current_build_id = 6;
  string version_label = 7;
  google.protobuf.Timestamp last_seen_at = 8;
}
