// Copyright 2022 Lightbend Inc.

syntax = "proto3";

package kalix.timers;

import "google/protobuf/any.proto";
import "google/protobuf/descriptor.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/wrappers.proto";

option go_package = "github.com/lightbend/kalix-go-sdk/kalix/timers;timers";
option java_package = "kalix.timers";

message Call {
  // The name of the service to call.
  string service_name = 1;
  // The name of the command to call.
  string command_name = 2;
  // The payload.
  google.protobuf.Any payload = 3;
}

message SingleTimer {
  string name = 1;
  Call call = 2;
  google.protobuf.Duration delay = 3;
  uint32 max_retries = 4;
}

// service for scheduling calls that the SDKs should provide an abstraction for
service TimerService {
  rpc AddSingle(SingleTimer) returns (google.protobuf.Empty);
  rpc Remove(google.protobuf.StringValue) returns (google.protobuf.Empty);
}
