syntax = "proto3";

option go_package = "v1";
option java_package = "io.stackrox.proto.api.v1";

import "google/api/annotations.proto";
import "api/v1/common.proto";
import "api/v1/empty.proto";
import "storage/notifier.proto";

package v1;

message GetNotifiersRequest {
    string name = 1;
    string type = 2;
}

message GetNotifiersResponse {
    repeated storage.Notifier notifiers = 1;
}

message DeleteNotifierRequest {
    string id  = 1;
    bool force = 2;
}

service NotifierService {

    rpc GetNotifier (ResourceByID) returns (storage.Notifier) {
        option (google.api.http) = {
            get: "/v1/notifiers/{id}"
        };
    }

    rpc GetNotifiers (GetNotifiersRequest) returns (GetNotifiersResponse) {
        option (google.api.http) = {
            get: "/v1/notifiers"
        };
    }

    rpc PutNotifier (storage.Notifier) returns (Empty) {
        option (google.api.http) = {
            put: "/v1/notifiers/{id}"
            body: "*"
        };
    }

    rpc PostNotifier (storage.Notifier) returns (storage.Notifier) {
        option (google.api.http) = {
            post: "/v1/notifiers"
            body: "*"
        };
    }

    rpc TestNotifier (storage.Notifier) returns (Empty) {
        option (google.api.http) = {
            post: "/v1/notifiers/test"
            body: "*"
        };
    }

    rpc DeleteNotifier (DeleteNotifierRequest) returns (Empty) {
        option (google.api.http) = {
            delete: "/v1/notifiers/{id}"
        };
    }

}
