-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathpokemon-common.smithy
98 lines (85 loc) · 1.98 KB
/
pokemon-common.smithy
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
$version: "2"
namespace com.aws.example
use smithy.framework#ValidationException
/// A Pokémon species forms the basis for at least one Pokémon.
@title("Pokémon Species")
resource PokemonSpecies {
identifiers: {
name: String
}
read: GetPokemonSpecies
}
/// Retrieve information about a Pokémon species.
@readonly
@http(uri: "/pokemon-species/{name}", method: "GET")
operation GetPokemonSpecies {
input := {
@required
@httpLabel
name: String
}
output := {
/// The name for this resource.
@required
name: String
/// A list of flavor text entries for this Pokémon species.
@required
flavorTextEntries: FlavorTextEntries
}
errors: [
ResourceNotFoundException
ValidationException
]
}
/// Retrieve HTTP server statistiscs, such as calls count.
@readonly
@http(uri: "/stats", method: "GET")
operation GetServerStatistics {
input := {}
output := {
/// The number of calls executed by the server.
@required
calls_count: Long
}
}
list FlavorTextEntries {
member: FlavorText
}
structure FlavorText {
/// The localized flavor text for an API resource in a specific language.
@required
flavorText: String
/// The language this name is in.
@required
language: Language
}
/// Supported languages for FlavorText entries.
enum Language {
/// American English.
ENGLISH = "en"
/// Español.
SPANISH = "es"
/// Italiano.
ITALIAN = "it"
/// 日本語。
JAPANESE = "jp"
}
/// DoNothing operation, used to stress test the framework.
@readonly
@http(uri: "/do-nothing", method: "GET")
operation DoNothing {
input := {}
output := {}
}
/// Health check operation, to check the service is up
/// Not yet a deep check
@readonly
@http(uri: "/ping", method: "GET")
operation CheckHealth {
}
@error("client")
@httpError(404)
structure ResourceNotFoundException {
@required
message: String
}