syntax = "proto2";

package wix.api;

import "google/protobuf/descriptor.proto";
import "wix/api/callback.proto";

option java_multiple_files = true;
option java_outer_classname = "SubscriptionProto";
option java_package = "com.wix.api";

/*
Marks a method as a topic consumer.
service BlooperService {
   rpc Update (BlooperUpdateNotification) returns (google.protobuf.Empty) {
       option (wix.api.subscription) = {
           topic: "Blooper.Update"
       };
   };
}
*/
extend google.protobuf.MethodOptions {
    optional Subscription subscription = 50400;
}

message Subscription {
    optional string topic = 1;
    optional Segment.SegmentName segment = 4; // currently defaults to "legacy", will be `required` when legacy cluster is removed
    optional bool batch = 2 [deprecated = true];
    optional string entity = 3;
    optional bool dynamic = 5 [deprecated = true];
}
