// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0

syntax = "proto3";

package channels.v1;

import "common/v1/common.proto";

option go_package = "github.com/absmach/magistrala/api/grpc/channels/v1";

service ChannelsService {
  rpc Authorize(AuthzReq)
    returns(AuthzRes) {}

  rpc RemoveClientConnections(RemoveClientConnectionsReq)
    returns(RemoveClientConnectionsRes) {}

  rpc UnsetParentGroupFromChannels(UnsetParentGroupFromChannelsReq)
    returns(UnsetParentGroupFromChannelsRes){}

  rpc RetrieveEntity(common.v1.RetrieveEntityReq)
    returns (common.v1.RetrieveEntityRes) {}

  rpc RetrieveIDByRoute(common.v1.RetrieveIDByRouteReq)
    returns (common.v1.RetrieveEntityRes) {}
}

message RemoveClientConnectionsReq {
  string client_id = 1;
}

message RemoveClientConnectionsRes {

}

message UnsetParentGroupFromChannelsReq {
  string parent_group_id = 1;
}

message UnsetParentGroupFromChannelsRes {

}

message AuthzReq {
  string domain_id = 1;
  string client_id = 2;
  string client_type = 3;
  string channel_id = 4;
  uint32 type = 5;
}

message AuthzRes {
  bool authorized = 1;
}

