-
Notifications
You must be signed in to change notification settings - Fork 2
/
contract.go
41 lines (36 loc) · 1.59 KB
/
contract.go
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
package recipe
// ErrorResponse models the error response from cantabular
type ErrorResponse struct {
Message string `json:"message"`
}
// Recipe holds the response body for GET /recipes/{id}
type Recipe struct {
ID string `json:"id,omitempty"`
Alias string `json:"alias,omitempty"`
Format string `json:"format,omitempty"`
InputFiles []file `json:"files,omitempty"`
OutputInstances []Instance `json:"output_instances,omitempty"`
CantabularBlob string `json:"cantabular_blob,omitempty"`
PopulationType string `json:"population_type,omitempty"`
}
// CodeList holds one of the codelists corresponding to a recipe
type CodeList struct {
ID string `json:"id,omitempty"`
HRef string `json:"href,omitempty"`
Name string `json:"name,omitempty"`
IsHierarchy *bool `json:"is_hierarchy,omitempty"`
IsCantabularGeography *bool `json:"is_cantabular_geography,omitempty"`
IsCantabularDefaultGeography *bool `json:"is_cantabular_default_geography,omitempty"`
}
// Instance holds one of the output_instances corresponding to a recipe
type Instance struct {
DatasetID string `json:"dataset_id,omitempty"`
Editions []string `json:"editions,omitempty"`
Title string `json:"title,omitempty"`
CodeLists []CodeList `json:"code_lists,omitempty"`
LowestGeography string `json:"lowest_geography,omitempty"`
}
// file holds one of the file descriptions corresponding to a recipe
type file struct {
Description string `json:"description,omitempty"`
}