syntax = "proto3";

package nominal.nominalinstro.v1;

import "google/api/annotations.proto";
import "nominal/protos/gen/v1/error.proto";

option java_multiple_files = true;
option java_package = "io.nominal.nominalinstro.v1";

enum NominalInstroPackageRegistryError {
  NOMINAL_INSTRO_PACKAGE_REGISTRY_ERROR_UNSPECIFIED = 0;
  NOMINAL_INSTRO_PACKAGE_REGISTRY_ERROR_NOT_AVAILABLE = 1 [(nominal.gen.v1.error) = {
    code: "NOT_FOUND"
    message: "nominal-instro package registry is not supported on this stack."
  }];
}

message GetPythonPackageRegistryRequest {}

message GetPythonPackageRegistryResponse {
  string registry_url = 1;
  optional string registry_token = 2;
}

// Service for accessing Nominal's private python package registry for the `nominal-instro` library.
// This private registry may be discontinue in the future if all of the packges are made public.
// Clients should prepare to handle the UNIMPLEMENTED status (http 501) by falling back to PyPi's public registry.
service NominalInstroPackageRegistryService {
  // Returns the URL for the python package registry, and a token that can be used to access it via HTTP BASIC auth.
  rpc GetPythonPackageRegistry(GetPythonPackageRegistryRequest) returns (GetPythonPackageRegistryResponse) {
    option (google.api.http) = {get: "/nominalinstro/v1/python-package-registry"};
  }
}
