-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathuk-lords-votes.yaml
648 lines (647 loc) · 19.2 KB
/
uk-lords-votes.yaml
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
openapi: 3.0.1
info:
title: Lords Votes API
description: |
An API that allows querying of the UK parliament's Lords Votes data.
### Notes about parameters:
- The `StartDate` and `EndDate` parameters take dates of format yyyy-MM-dd.
- For any `X.Comparator`, the allowed values are : 'LessThan', 'LessThanOrEqualTo', 'EqualTo', 'GreaterThanOrEqualTo', 'GreaterThan'
contact:
name: UK Parliament
url: https://www.parliament.uk
email: [email protected]
version: v1
servers:
- url: https://lordsvotes-api.parliament.uk
paths:
/data/Divisions/{divisionId}:
get:
tags:
- Divisions
summary: Return a Division
description: Get a single Division which has the Id specified.
parameters:
- name: divisionId
in: path
description: Division with ID specified
required: true
schema:
type: integer
description: Division with ID specified
format: int32
responses:
'200':
description: Division with id matching given divisionId
content:
text/plain:
schema:
$ref: '#/components/schemas/DivisionViewModel'
application/json:
schema:
$ref: '#/components/schemas/DivisionViewModel'
text/json:
schema:
$ref: '#/components/schemas/DivisionViewModel'
'400':
description: divisionId was not valid
'404':
description: Division with given divisionId was not found
'503':
description: Temporary error occured when trying to get division
/data/Divisions/searchTotalResults:
get:
tags:
- Divisions
summary: Return total results count
description: >-
Get total count of Divisions meeting the specified query, useful for paging lists etc...
parameters:
- name: SearchTerm
in: query
description: Divisions containing search term within title or number
schema:
type: string
nullable: true
- name: MemberId
in: query
description: Divisions returning Member with Member ID voting records
schema:
type: integer
format: int32
nullable: true
- name: IncludeWhenMemberWasTeller
in: query
description: >-
Divisions where member was a teller as well as if they actually
voted
schema:
type: boolean
nullable: true
- name: StartDate
in: query
schema:
type: string
format: date-time
nullable: true
- name: EndDate
in: query
schema:
type: string
format: date-time
nullable: true
- name: DivisionNumber
in: query
description: >-
Division Number - as specified by the House, unique within a
session. This is different to the division id which uniquely
identifies a division in this system and is passed to the GET
division endpoint
schema:
type: integer
format: int32
nullable: true
- name: TotalVotesCast.Comparator
in: query
description: comparison operator to use
schema:
type: string
- name: TotalVotesCast.ValueToCompare
in: query
description: value to compare to with the operator provided
schema:
type: integer
format: int32
- name: Majority.Comparator
in: query
description: comparison operator to use
schema:
type: string
- name: Majority.ValueToCompare
in: query
description: value to compare to with the operator provided
schema:
type: integer
format: int32
responses:
'200':
description: Division with id matching given divisionId
content:
text/plain:
schema:
type: integer
format: int32
application/json:
schema:
type: integer
format: int32
text/json:
schema:
type: integer
format: int32
'400':
description: divisionId was not valid
/data/Divisions/search:
get:
tags:
- Divisions
summary: Return a list of Divisions
description: Get a list of Divisions which meet the specified criteria.
parameters:
- name: SearchTerm
in: query
description: Divisions containing search term within title or number
schema:
type: string
nullable: true
- name: MemberId
in: query
description: Divisions returning Member with Member ID voting records
schema:
type: integer
format: int32
nullable: true
- name: IncludeWhenMemberWasTeller
in: query
description: >-
Divisions where member was a teller as well as if they actually
voted
schema:
type: boolean
nullable: true
- name: StartDate
in: query
schema:
type: string
format: date-time
nullable: true
- name: EndDate
in: query
schema:
type: string
format: date-time
nullable: true
- name: DivisionNumber
in: query
description: >-
Division Number - as specified by the House, unique within a
session. This is different to the division id which uniquely
identifies a division in this system and is passed to the GET
division endpoint
schema:
type: integer
format: int32
nullable: true
- name: TotalVotesCast.Comparator
in: query
description: comparison operator to use
schema:
type: string
- name: TotalVotesCast.ValueToCompare
in: query
description: value to compare to with the operator provided
schema:
type: integer
format: int32
- name: Majority.Comparator
in: query
description: comparison operator to use
schema:
type: string
- name: Majority.ValueToCompare
in: query
description: value to compare to with the operator provided
schema:
type: integer
format: int32
- name: skip
in: query
description: >-
The number of records to skip.
schema:
type: integer
format: int32
default: 0
- name: take
in: query
description: >-
The number of records to return per page. Default is 25
schema:
type: integer
format: int32
default: 25
responses:
'200':
description: List of divisions matching specified parameters
content:
text/plain:
schema:
type: array
items:
$ref: '#/components/schemas/DivisionViewModel'
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/DivisionViewModel'
text/json:
schema:
type: array
items:
$ref: '#/components/schemas/DivisionViewModel'
'400':
description: A parameter was not valid
'503':
description: Temporary error occured when trying to get division
/data/Divisions/membervoting:
get:
tags:
- Divisions
summary: Return voting records for a Member
description: Get a list of voting records for a Member.
parameters:
- name: MemberId
in: query
description: Id number of a Member whose voting records are to be returned
required: true
schema:
maximum: 2147483647
minimum: 1
type: integer
format: int32
- name: SearchTerm
in: query
description: Divisions containing search term within title or number
schema:
type: string
nullable: true
- name: IncludeWhenMemberWasTeller
in: query
description: >-
Divisions where member was a teller as well as if they actually
voted
schema:
type: boolean
nullable: true
- name: StartDate
in: query
schema:
type: string
format: date-time
nullable: true
- name: EndDate
in: query
schema:
type: string
format: date-time
nullable: true
- name: DivisionNumber
in: query
description: >-
Division Number - as specified by the House, unique within a
session. This is different to the division id which uniquely
identifies a division in this system and is passed to the GET
division endpoint
schema:
type: integer
format: int32
nullable: true
- name: TotalVotesCast.Comparator
in: query
description: comparison operator to use
schema:
type: string
- name: TotalVotesCast.ValueToCompare
in: query
description: value to compare to with the operator provided
schema:
type: integer
format: int32
- name: Majority.Comparator
in: query
description: comparison operator to use
schema:
type: string
- name: Majority.ValueToCompare
in: query
description: value to compare to with the operator provided
schema:
type: integer
format: int32
- name: skip
in: query
description: >-
The number of records to skip.
schema:
type: integer
format: int32
default: 0
- name: take
in: query
description: >-
The number of records to return per page. Default is 25
schema:
type: integer
format: int32
default: 25
responses:
'200':
description: List of voting records for a member
content:
text/plain:
schema:
$ref: '#/components/schemas/MemberVotingRecordViewModel'
application/json:
schema:
$ref: '#/components/schemas/MemberVotingRecordViewModel'
text/json:
schema:
$ref: '#/components/schemas/MemberVotingRecordViewModel'
'400':
description: A parameter was not valid
'503':
description: Temporary error occured when trying to get division
/data/Divisions/groupedbyparty:
get:
tags:
- Divisions
summary: Return Divisions results grouped by party
description: Get a list of Divisions which contain grouped by party
parameters:
- name: SearchTerm
in: query
description: Divisions containing search term within title or number
schema:
type: string
nullable: true
- name: MemberId
in: query
description: Divisions returning Member with Member ID voting records
schema:
type: integer
format: int32
nullable: true
- name: IncludeWhenMemberWasTeller
in: query
description: >-
Divisions where member was a teller as well as if they actually
voted
schema:
type: boolean
nullable: true
- name: StartDate
in: query
schema:
type: string
format: date-time
nullable: true
- name: EndDate
in: query
schema:
type: string
format: date-time
nullable: true
- name: DivisionNumber
in: query
description: >-
Division Number - as specified by the House, unique within a
session. This is different to the division id which uniquely
identifies a division in this system and is passed to the GET
division endpoint
schema:
type: integer
format: int32
nullable: true
- name: TotalVotesCast.Comparator
in: query
description: comparison operator to use
schema:
type: string
- name: TotalVotesCast.ValueToCompare
in: query
description: value to compare to with the operator provided
schema:
type: integer
format: int32
- name: Majority.Comparator
in: query
description: comparison operator to use
schema:
type: string
- name: Majority.ValueToCompare
in: query
description: value to compare to with the operator provided
schema:
type: integer
format: int32
responses:
'200':
description: List of divisions with votes grouped by party
content:
text/plain:
schema:
$ref: '#/components/schemas/DivisionGroupByPartyViewModel'
application/json:
schema:
$ref: '#/components/schemas/DivisionGroupByPartyViewModel'
text/json:
schema:
$ref: '#/components/schemas/DivisionGroupByPartyViewModel'
'400':
description: A parameter was not valid
components:
schemas:
MemberViewModel:
type: object
properties:
memberId:
type: integer
format: int32
name:
type: string
nullable: true
listAs:
type: string
nullable: true
memberFrom:
type: string
nullable: true
party:
type: string
nullable: true
partyColour:
type: string
nullable: true
partyAbbreviation:
type: string
nullable: true
partyIsMainParty:
type: boolean
additionalProperties: false
DivisionViewModel:
type: object
properties:
divisionId:
type: integer
format: int32
date:
type: string
format: date-time
number:
type: integer
format: int32
notes:
type: string
nullable: true
title:
type: string
nullable: true
isWhipped:
type: boolean
isGovernmentContent:
type: boolean
authoritativeContentCount:
type: integer
description: >-
Authoritative content count is the official count. This is the
teller content count when tellers are present, but member content
count when there are no tellers.
format: int32
authoritativeNotContentCount:
type: integer
description: >-
Authoritative not content count is the official count. This is the
teller not content count when tellers are present, but member not
content count when there are no tellers.
format: int32
divisionHadTellers:
type: boolean
description: Whether the division had tellers or not
tellerContentCount:
type: integer
description: Content count is count recorded by the tellers
format: int32
tellerNotContentCount:
type: integer
description: Not Content count recorded by the tellers
format: int32
memberContentCount:
type: integer
description: >-
Member content count is the total tally of all members that voted
content
format: int32
memberNotContentCount:
type: integer
description: >-
Member not content count is the total tally of all members that
voted not content
format: int32
sponsoringMemberId:
type: integer
format: int32
nullable: true
isHouse:
type: boolean
nullable: true
amendmentMotionNotes:
type: string
nullable: true
isGovernmentWin:
type: boolean
nullable: true
remoteVotingStart:
type: string
format: date-time
nullable: true
remoteVotingEnd:
type: string
format: date-time
nullable: true
divisionWasExclusivelyRemote:
type: boolean
contentTellers:
type: array
items:
$ref: '#/components/schemas/MemberViewModel'
nullable: true
notContentTellers:
type: array
items:
$ref: '#/components/schemas/MemberViewModel'
nullable: true
contents:
type: array
items:
$ref: '#/components/schemas/MemberViewModel'
nullable: true
notContents:
type: array
items:
$ref: '#/components/schemas/MemberViewModel'
nullable: true
additionalProperties: false
Comparators:
enum:
- LessThan
- LessThanOrEqualTo
- EqualTo
- GreaterThanOrEqualTo
- GreaterThan
type: string
MemberVotingRecordViewModel:
type: object
properties:
memberId:
type: integer
format: int32
memberWasContent:
type: boolean
memberWasTeller:
type: boolean
publishedDivision:
$ref: '#/components/schemas/DivisionViewModel'
additionalProperties: false
PartyVoteResultViewModel:
type: object
properties:
partyName:
type: string
nullable: true
voteCount:
type: integer
format: int32
additionalProperties: false
DivisionGroupByPartyViewModel:
type: object
properties:
divisionId:
type: integer
format: int32
number:
type: integer
format: int32
title:
type: string
nullable: true
date:
type: string
format: date-time
contentCount:
type: integer
format: int32
readOnly: true
notContentCount:
type: integer
format: int32
readOnly: true
content:
type: array
items:
$ref: '#/components/schemas/PartyVoteResultViewModel'
nullable: true
notContent:
type: array
items:
$ref: '#/components/schemas/PartyVoteResultViewModel'
nullable: true
additionalProperties: false