/
pokedex.proto
53 lines (44 loc) · 896 Bytes
/
pokedex.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
syntax = "proto3";
package pokedex;
message Error {
int32 code = 1;
string message = 2;
}
enum PokemonType {
NORMAL = 0;
FIRE = 1;
GROUND = 2;
WATER = 3;
GRASS = 4;
PSYCHIC = 5;
GHOST = 6;
ICE = 7;
STEEL = 8;
POISON = 9;
FLYING = 10;
FIGHTING = 11;
ELECTRIC = 12;
}
message Query {
string value = 1;
}
message Pokemon {
string name = 1;
repeated PokemonType pokemonType = 2;
}
message PokemonResponse {
int32 id = 1;
string name = 2;
repeated PokemonType pokemonType = 3;
}
message PokemonsResponse {
repeated PokemonResponse pokemons = 1;
}
message PokedexEntryResponse {
int32 id = 1;
}
service PokeDex {
rpc GetPokemonByName(Query) returns (PokemonResponse);
rpc GetPokemonsByType(Query) returns (PokemonsResponse);
rpc MakePokedexEntry(Pokemon) returns (PokedexEntryResponse);
}