syntax = "proto3";

package golem.apidefinition.v1;

import "golem/common/empty.proto";
import "golem/apidefinition/api_definition.proto";

message ApiDefinitionRequest {
  ApiDefinitionId id = 1;
  string version = 2;
  oneof definition {
    HttpApiDefinition http = 3;
  }
  bool draft = 4;
}

message CreateApiDefinitionRequest {
  oneof api_definition {
    ApiDefinitionRequest definition = 1;
    string openapi = 2;
  }
}

message UpdateApiDefinitionRequest {
  oneof api_definition {
    ApiDefinitionRequest definition = 1;
    string openapi = 2;
  }
}

message GetApiDefinitionRequest {
  ApiDefinitionId api_definition_id = 1;
  string version = 2;
}


message GetApiDefinitionVersionsRequest {
  ApiDefinitionId api_definition_id = 1;
}

message DeleteApiDefinitionRequest {
  ApiDefinitionId api_definition_id = 1;
  string version = 2;
}

message GetAllApiDefinitionsRequest {}
