syntax = "proto3";

option java_multiple_files = true;
option java_package = "com.example.book";

service BookService {
  // RPC function to fetch a book using its ISBN
  rpc GetBook(GetBookRequest) returns (Book) {}

}


message GetBookRequest {
  string isbn = 1;
}


message Book {
  enum Genre {
    GENRE_UNSPECIFIED = 0;
    FICTION = 1;
    NON_FICTION = 2;
    SCIENCE = 3;
    HISTORY = 4;
  }

  message Publisher {
    string name = 1;
    string location = 2;
  }

  string title = 1;
  string author = 2;
  string isbn = 3;
  int32 publication_year = 4;

  Genre genre = 5;
  Publisher publisher = 6;
}