
syntax = "proto3";

package opencloud.services.eventhistory.v0;

option go_package = "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/eventhistory/v0";

import "opencloud/messages/eventhistory/v0/eventhistory.proto";
import "protoc-gen-openapiv2/options/annotations.proto";

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
  info: {
    title: "OpenCloud eventhistory";
    version: "1.0.0";
    contact: {
      name: "OpenCloud GmbH";
      url: "https://github.com/opencloud-eu/opencloud";
      email: "support@opencloud.eu";
    };
    license: {
      name: "Apache-2.0";
      url: "https://github.com/opencloud-eu/opencloud/blob/main/LICENSE";
    };
  };
  schemes: HTTP;
  schemes: HTTPS;
  consumes: "application/json";
  produces: "application/json";
  external_docs: {
    description: "Developer Manual";
    url: "https://docs.opencloud.eu/services/eventhistory/";
  };
};

// A Service for storing events
service EventHistoryService {
    // returns the specified events
    rpc GetEvents(GetEventsRequest) returns (GetEventsResponse);
    // returns all events for the specified userID
    rpc GetEventsForUser(GetEventsForUserRequest) returns (GetEventsResponse);
}

// A request to retrieve events
message GetEventsRequest {
    // the ids of the events we want to get
    repeated string ids = 1;
}

// A request to retrieve events belonging to a userID
message GetEventsForUserRequest {
    // the userID of the events we want to get
    string userID = 1;
}

// The service response
message GetEventsResponse {
    repeated opencloud.messages.eventhistory.v0.Event events = 1;
}
