import "logbroker/public/api/protos/config_manager.proto";
import "saas/library/persqueue/configuration/proto/types.proto";


package NSaasLB;

enum EChangeAction {
    CREATE = 0;
    MODIFY = 1;
    REMOVE = 2;
}

message TNamespaceModifyRequest {
    required EChangeAction Action = 1;
    required string Name = 2;
    optional TNamespaceConfig Config = 3;
}

message TServiceMetaModifyRequest {
    required EChangeAction Action = 1;
    required string Path = 2;
    optional TServiceConfig Config = 3;
}

message TServiceMetaModifyRequests {
    repeated TServiceMetaModifyRequest Request = 1;
}

message TLockModifyRequest {
    required EChangeAction Action = 1;
    required TLock Lock = 2;
}

message TLocksModifyRequests {
    repeated TLockModifyRequest Request = 1;
}

message TLogbrokerModifyRequests {
    repeated NLogBroker.SingleModifyRequest Request = 1;
    required ELogbrokerName Logbroker = 2;
    required bool AddingMirrorRules = 3;
    required bool RemovingMirrorRules = 4;
}

message TStage {
    oneof stage {
        TServiceMetaModifyRequests ServiceMeta = 1;
        TLocksModifyRequests Locks = 2;
        TLogbrokerModifyRequests Logbroker = 3;
        TLogbrokerModifyRequests LogbrokerMirror = 4;
    }

    repeated string Warnings = 5;
}

message TServiceChanges {
    repeated TStage Stages = 1;
}
