-
Notifications
You must be signed in to change notification settings - Fork 34
/
response.ts
119 lines (110 loc) · 2.58 KB
/
response.ts
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
undefined
MaaS stations query response schema
!!! AUTO GENERATED BY CONVERT.TS REFRAIN FROM MANUAL EDITING !!!
*/
import * as t from 'io-ts';
import * as Station_ from 'maas-schemas-ts/core/components/station';
type Defined =
| Record<string, unknown>
| Array<unknown>
| string
| boolean
| number
| null;
const Defined = t.union([
t.UnknownRecord,
t.UnknownArray,
t.string,
t.boolean,
t.number,
t.null,
]);
export const schemaId = 'http://maasglobal.com/tsp/stations-list/response.json';
// Response
// The default export. More information at the top.
export type Response = t.Branded<
{
stations?: Array<
{
id?: Station_.Id;
code?: Station_.Code;
name?: Station_.Name;
location?: Station_.Location;
agencyId?: Station_.AgencyId;
services?: Station_.Services;
address?: Station_.Address;
city?: Station_.City;
country?: Station_.Country;
zone?: Station_.Zone;
platformCode?: Station_.PlatformCode;
} & {
id: Defined;
location: Defined;
agencyId: Defined;
services: Defined;
}
>;
},
ResponseBrand
>;
export const Response = t.brand(
t.partial({
stations: t.array(
t.intersection([
t.partial({
id: Station_.Id,
code: Station_.Code,
name: Station_.Name,
location: Station_.Location,
agencyId: Station_.AgencyId,
services: Station_.Services,
address: Station_.Address,
city: Station_.City,
country: Station_.Country,
zone: Station_.Zone,
platformCode: Station_.PlatformCode,
}),
t.type({
id: Defined,
location: Defined,
agencyId: Defined,
services: Defined,
}),
]),
),
}),
(
x,
): x is t.Branded<
{
stations?: Array<
{
id?: Station_.Id;
code?: Station_.Code;
name?: Station_.Name;
location?: Station_.Location;
agencyId?: Station_.AgencyId;
services?: Station_.Services;
address?: Station_.Address;
city?: Station_.City;
country?: Station_.Country;
zone?: Station_.Zone;
platformCode?: Station_.PlatformCode;
} & {
id: Defined;
location: Defined;
agencyId: Defined;
services: Defined;
}
>;
},
ResponseBrand
> => true,
'Response',
);
export interface ResponseBrand {
readonly Response: unique symbol;
}
export default Response;
// Success