nationbuilder-rb 1.3.5 → 1.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/api_spec/lib/api_spec/generator.rb +6 -11
- data/lib/api_spec/lib/api_spec/specs/basic_pages.rb +12 -22
- data/lib/api_spec/lib/api_spec/specs/blog_posts.rb +15 -28
- data/lib/api_spec/lib/api_spec/specs/blogs.rb +15 -27
- data/lib/api_spec/lib/api_spec/specs/calendars.rb +15 -27
- data/lib/api_spec/lib/api_spec/specs/campaign_data.rb +3 -7
- data/lib/api_spec/lib/api_spec/specs/contacts.rb +25 -45
- data/lib/api_spec/lib/api_spec/specs/donations.rb +15 -17
- data/lib/api_spec/lib/api_spec/specs/events.rb +31 -38
- data/lib/api_spec/lib/api_spec/specs/exports.rb +16 -11
- data/lib/api_spec/lib/api_spec/specs/imports.rb +9 -11
- data/lib/api_spec/lib/api_spec/specs/lists.rb +47 -49
- data/lib/api_spec/lib/api_spec/specs/memberships.rb +6 -8
- data/lib/api_spec/lib/api_spec/specs/page_attachments.rb +22 -24
- data/lib/api_spec/lib/api_spec/specs/people.rb +88 -92
- data/lib/api_spec/lib/api_spec/specs/people_tags.rb +6 -8
- data/lib/api_spec/lib/api_spec/specs/precincts.rb +19 -21
- data/lib/api_spec/lib/api_spec/specs/sites.rb +3 -5
- data/lib/api_spec/lib/api_spec/specs/survey_responses.rb +7 -11
- data/lib/api_spec/lib/api_spec/specs/surveys.rb +13 -23
- data/lib/api_spec/lib/api_spec/specs/webhooks.rb +12 -21
- data/lib/api_spec/spec.json +71 -64
- data/nationbuilder-rb.gemspec +3 -3
- metadata +2 -2
@@ -4,20 +4,20 @@ class ApiSpec::Spec
|
|
4
4
|
|
5
5
|
pa.method('Index') do |method|
|
6
6
|
method.synopsis = "Returns a list of a page's file attachments"
|
7
|
-
method.http_method =
|
8
|
-
method.uri =
|
7
|
+
method.http_method = 'GET'
|
8
|
+
method.uri = '/sites/:site_slug/pages/:page_slug/attachments'
|
9
9
|
|
10
10
|
method.parameter('site_slug') do |p|
|
11
11
|
p.required = 'Y'
|
12
12
|
p.type = 'string'
|
13
|
-
p.description = '
|
13
|
+
p.description = 'the slug of the site the page lives on'
|
14
14
|
end
|
15
15
|
|
16
16
|
method.parameter('page_slug') do |p|
|
17
17
|
p.required = 'Y'
|
18
18
|
p.default = '1'
|
19
19
|
p.type = 'string'
|
20
|
-
p.description =
|
20
|
+
p.description = "the page's slug"
|
21
21
|
end
|
22
22
|
|
23
23
|
method.parameter('__token') do |p|
|
@@ -41,81 +41,79 @@ class ApiSpec::Spec
|
|
41
41
|
end
|
42
42
|
|
43
43
|
pa.method('Show') do |method|
|
44
|
-
method.synopsis =
|
45
|
-
method.http_method =
|
46
|
-
method.uri =
|
44
|
+
method.synopsis = 'Creates a new file attachment for a page'
|
45
|
+
method.http_method = 'GET'
|
46
|
+
method.uri = '/sites/:site_slug/pages/:page_slug/attachments/:id'
|
47
47
|
|
48
48
|
method.parameter('site_slug') do |p|
|
49
49
|
p.required = 'Y'
|
50
50
|
p.type = 'string'
|
51
|
-
p.description = '
|
51
|
+
p.description = 'the slug of the site the page lives on'
|
52
52
|
end
|
53
53
|
|
54
54
|
method.parameter('page_slug') do |p|
|
55
55
|
p.required = 'Y'
|
56
56
|
p.default = '1'
|
57
57
|
p.type = 'string'
|
58
|
-
p.description =
|
58
|
+
p.description = "the page's slug"
|
59
59
|
end
|
60
60
|
|
61
61
|
method.parameter('id') do |p|
|
62
62
|
p.required = 'Y'
|
63
63
|
p.type = 'int'
|
64
|
-
p.description = '
|
64
|
+
p.description = 'the ID of the page attachment'
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
68
|
pa.method('Create') do |method|
|
69
|
-
method.synopsis =
|
70
|
-
method.http_method =
|
71
|
-
method.uri =
|
69
|
+
method.synopsis = 'Creates a new file attachment for a page'
|
70
|
+
method.http_method = 'POST'
|
71
|
+
method.uri = '/sites/:site_slug/pages/:page_slug/attachments'
|
72
72
|
|
73
73
|
method.parameter('site_slug') do |p|
|
74
74
|
p.required = 'Y'
|
75
75
|
p.type = 'string'
|
76
|
-
p.description = '
|
76
|
+
p.description = 'the slug of the site the page lives on'
|
77
77
|
end
|
78
78
|
|
79
79
|
method.parameter('page_slug') do |p|
|
80
80
|
p.required = 'Y'
|
81
81
|
p.default = '1'
|
82
82
|
p.type = 'string'
|
83
|
-
p.description =
|
83
|
+
p.description = "the page's slug"
|
84
84
|
end
|
85
85
|
|
86
86
|
method.parameter('body') do |p|
|
87
87
|
p.required = 'Y'
|
88
88
|
p.default = '{}'
|
89
89
|
p.type = 'json'
|
90
|
-
p.description = '
|
90
|
+
p.description = 'a JSON representation of the attachment'
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|
94
94
|
pa.method('Destroy') do |method|
|
95
|
-
method.synopsis =
|
96
|
-
method.http_method =
|
97
|
-
method.uri =
|
95
|
+
method.synopsis = 'Destroys a file attachment for a page'
|
96
|
+
method.http_method = 'DELETE'
|
97
|
+
method.uri = '/sites/:site_slug/pages/:page_slug/attachments/:id'
|
98
98
|
|
99
99
|
method.parameter('site_slug') do |p|
|
100
100
|
p.required = 'Y'
|
101
101
|
p.type = 'string'
|
102
|
-
p.description = '
|
102
|
+
p.description = 'the slug of the site the page lives on'
|
103
103
|
end
|
104
104
|
|
105
105
|
method.parameter('page_slug') do |p|
|
106
106
|
p.required = 'Y'
|
107
107
|
p.default = '1'
|
108
108
|
p.type = 'string'
|
109
|
-
p.description =
|
109
|
+
p.description = "the page's slug"
|
110
110
|
end
|
111
111
|
|
112
112
|
method.parameter('id') do |p|
|
113
113
|
p.required = 'Y'
|
114
114
|
p.type = 'int'
|
115
|
-
p.description = '
|
115
|
+
p.description = 'the ID of the page attachment'
|
116
116
|
end
|
117
117
|
end
|
118
|
-
|
119
118
|
end
|
120
|
-
|
121
119
|
end
|
@@ -3,9 +3,9 @@ class ApiSpec::Spec
|
|
3
3
|
endpoint 'People' do |people|
|
4
4
|
|
5
5
|
people.method('Index') do |method|
|
6
|
-
method.synopsis =
|
7
|
-
method.http_method =
|
8
|
-
method.uri =
|
6
|
+
method.synopsis = 'Returns a list of people'
|
7
|
+
method.http_method = 'GET'
|
8
|
+
method.uri = '/people'
|
9
9
|
|
10
10
|
method.parameter('__token') do |p|
|
11
11
|
p.required = 'N'
|
@@ -28,106 +28,105 @@ class ApiSpec::Spec
|
|
28
28
|
end
|
29
29
|
|
30
30
|
people.method('Count') do |method|
|
31
|
-
method.synopsis =
|
32
|
-
method.http_method =
|
33
|
-
method.uri =
|
31
|
+
method.synopsis = 'Returns a count of people in the nation'
|
32
|
+
method.http_method = 'GET'
|
33
|
+
method.uri = '/people/count'
|
34
34
|
end
|
35
35
|
|
36
36
|
people.method('Show') do |method|
|
37
|
-
method.synopsis =
|
38
|
-
method.http_method =
|
39
|
-
method.uri =
|
37
|
+
method.synopsis = 'Returns a full representation of the person'
|
38
|
+
method.http_method = 'GET'
|
39
|
+
method.uri = '/people/:id'
|
40
40
|
|
41
41
|
method.parameter('id') do |p|
|
42
42
|
p.required = 'Y'
|
43
43
|
p.default = '1'
|
44
44
|
p.type = 'int'
|
45
|
-
p.description =
|
45
|
+
p.description = "the person's id"
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
49
|
people.method('Match') do |method|
|
50
|
-
method.synopsis =
|
51
|
-
method.http_method =
|
52
|
-
method.uri =
|
50
|
+
method.synopsis = 'Finds people that match certain attributes exactly'
|
51
|
+
method.http_method = 'GET'
|
52
|
+
method.uri = '/people/match'
|
53
53
|
|
54
|
-
method.parameter(
|
54
|
+
method.parameter('email') do |p|
|
55
55
|
p.required = 'N'
|
56
56
|
p.type = 'string'
|
57
57
|
end
|
58
58
|
|
59
|
-
method.parameter(
|
59
|
+
method.parameter('first_name') do |p|
|
60
60
|
p.required = 'N'
|
61
61
|
p.type = 'string'
|
62
62
|
p.description = 'deprecated'
|
63
63
|
end
|
64
64
|
|
65
|
-
method.parameter(
|
65
|
+
method.parameter('last_name') do |p|
|
66
66
|
p.required = 'N'
|
67
67
|
p.type = 'string'
|
68
68
|
p.description = 'deprecated'
|
69
69
|
end
|
70
70
|
|
71
|
-
method.parameter(
|
71
|
+
method.parameter('phone') do |p|
|
72
72
|
p.required = 'N'
|
73
73
|
p.type = 'string'
|
74
74
|
p.description = 'deprecated'
|
75
75
|
end
|
76
76
|
|
77
|
-
method.parameter(
|
77
|
+
method.parameter('mobile') do |p|
|
78
78
|
p.required = 'N'
|
79
79
|
p.type = 'string'
|
80
80
|
p.description = 'deprecated'
|
81
81
|
end
|
82
|
-
|
83
82
|
end
|
84
83
|
|
85
84
|
people.method('Search') do |method|
|
86
|
-
method.synopsis =
|
87
|
-
method.http_method =
|
88
|
-
method.uri =
|
85
|
+
method.synopsis = 'Search for people using non-unique traits'
|
86
|
+
method.http_method = 'GET'
|
87
|
+
method.uri = '/people/search'
|
89
88
|
|
90
|
-
method.parameter(
|
89
|
+
method.parameter('first_name') do |p|
|
91
90
|
p.required = 'N'
|
92
91
|
p.type = 'string'
|
93
92
|
end
|
94
93
|
|
95
|
-
method.parameter(
|
94
|
+
method.parameter('last_name') do |p|
|
96
95
|
p.required = 'N'
|
97
96
|
p.type = 'string'
|
98
97
|
end
|
99
98
|
|
100
|
-
method.parameter(
|
99
|
+
method.parameter('city') do |p|
|
101
100
|
p.required = 'N'
|
102
101
|
p.type = 'string'
|
103
102
|
end
|
104
103
|
|
105
|
-
method.parameter(
|
104
|
+
method.parameter('state') do |p|
|
106
105
|
p.required = 'N'
|
107
106
|
p.type = 'string'
|
108
107
|
end
|
109
108
|
|
110
|
-
method.parameter(
|
109
|
+
method.parameter('sex') do |p|
|
111
110
|
p.required = 'N'
|
112
111
|
p.type = 'string'
|
113
112
|
end
|
114
113
|
|
115
|
-
method.parameter(
|
114
|
+
method.parameter('birthdate') do |p|
|
116
115
|
p.required = 'N'
|
117
116
|
p.type = 'string'
|
118
117
|
end
|
119
118
|
|
120
|
-
method.parameter(
|
119
|
+
method.parameter('updated_since') do |p|
|
121
120
|
p.required = 'N'
|
122
121
|
p.type = 'string'
|
123
122
|
end
|
124
123
|
|
125
|
-
method.parameter(
|
124
|
+
method.parameter('with_mobile') do |p|
|
126
125
|
p.required = 'N'
|
127
126
|
p.type = 'string'
|
128
127
|
end
|
129
128
|
|
130
|
-
method.parameter(
|
129
|
+
method.parameter('custom_values') do |p|
|
131
130
|
p.required = 'N'
|
132
131
|
p.type = 'string'
|
133
132
|
end
|
@@ -223,15 +222,15 @@ class ApiSpec::Spec
|
|
223
222
|
end
|
224
223
|
|
225
224
|
people.method('Nearby') do |method|
|
226
|
-
method.synopsis =
|
227
|
-
method.http_method =
|
228
|
-
method.uri =
|
225
|
+
method.synopsis = 'Searches for people near a location defined by latitude and longitude'
|
226
|
+
method.http_method = 'GET'
|
227
|
+
method.uri = '/people/nearby'
|
229
228
|
|
230
229
|
method.parameter('location') do |p|
|
231
230
|
p.required = 'Y'
|
232
231
|
p.default = '34.049031,-118.251399'
|
233
232
|
p.type = 'string'
|
234
|
-
p.description =
|
233
|
+
p.description = "origin of search in the format 'latitude,longitude'"
|
235
234
|
end
|
236
235
|
|
237
236
|
method.parameter('distance') do |p|
|
@@ -263,43 +262,43 @@ class ApiSpec::Spec
|
|
263
262
|
|
264
263
|
people.method('Me') do |method|
|
265
264
|
method.synopsis = "Returns the access token's resource owner's representation"
|
266
|
-
method.http_method =
|
267
|
-
method.uri =
|
265
|
+
method.http_method = 'GET'
|
266
|
+
method.uri = '/people/me'
|
268
267
|
end
|
269
268
|
|
270
269
|
people.method('Register') do |method|
|
271
|
-
method.synopsis =
|
272
|
-
method.http_method =
|
273
|
-
method.uri =
|
270
|
+
method.synopsis = 'Starts user registration person for the given person'
|
271
|
+
method.http_method = 'GET'
|
272
|
+
method.uri = '/people/:id/register'
|
274
273
|
|
275
274
|
method.parameter('id') do |p|
|
276
275
|
p.required = 'Y'
|
277
276
|
p.type = 'int'
|
278
|
-
p.description = "
|
277
|
+
p.description = "the person's id"
|
279
278
|
end
|
280
279
|
end
|
281
280
|
|
282
281
|
people.method('Taggings') do |method|
|
283
|
-
method.synopsis =
|
284
|
-
method.http_method =
|
285
|
-
method.uri =
|
282
|
+
method.synopsis = 'Returns all taggings for a given person'
|
283
|
+
method.http_method = 'GET'
|
284
|
+
method.uri = '/people/:id/taggings'
|
286
285
|
|
287
286
|
method.parameter('id') do |p|
|
288
287
|
p.required = 'Y'
|
289
288
|
p.type = 'int'
|
290
|
-
p.description =
|
289
|
+
p.description = "the person's id"
|
291
290
|
end
|
292
291
|
end
|
293
292
|
|
294
293
|
people.method('Tag Person') do |method|
|
295
|
-
method.synopsis =
|
296
|
-
method.http_method =
|
297
|
-
method.uri =
|
294
|
+
method.synopsis = 'Tags a person'
|
295
|
+
method.http_method = 'PUT'
|
296
|
+
method.uri = '/people/:id/taggings'
|
298
297
|
|
299
298
|
method.parameter('id') do |p|
|
300
299
|
p.required = 'Y'
|
301
300
|
p.type = 'int'
|
302
|
-
p.description =
|
301
|
+
p.description = "the person's id"
|
303
302
|
end
|
304
303
|
|
305
304
|
method.parameter('body') do |p|
|
@@ -310,14 +309,14 @@ class ApiSpec::Spec
|
|
310
309
|
end
|
311
310
|
|
312
311
|
people.method('Tag Removal') do |method|
|
313
|
-
method.synopsis =
|
314
|
-
method.http_method =
|
315
|
-
method.uri =
|
312
|
+
method.synopsis = 'Removes a tag from a person'
|
313
|
+
method.http_method = 'DELETE'
|
314
|
+
method.uri = '/people/:id/taggings/:tag'
|
316
315
|
|
317
316
|
method.parameter('id') do |p|
|
318
317
|
p.required = 'Y'
|
319
318
|
p.type = 'int'
|
320
|
-
p.description =
|
319
|
+
p.description = "the person's ID"
|
321
320
|
end
|
322
321
|
|
323
322
|
method.parameter('tag') do |p|
|
@@ -325,18 +324,17 @@ class ApiSpec::Spec
|
|
325
324
|
p.type = 'string'
|
326
325
|
p.description = 'the name of the tag'
|
327
326
|
end
|
328
|
-
|
329
327
|
end
|
330
328
|
|
331
329
|
people.method('Bulk Tag Removal') do |method|
|
332
|
-
method.synopsis =
|
333
|
-
method.http_method =
|
334
|
-
method.uri =
|
330
|
+
method.synopsis = 'Removes tags from a person'
|
331
|
+
method.http_method = 'DELETE'
|
332
|
+
method.uri = '/people/:id/taggings'
|
335
333
|
|
336
334
|
method.parameter('id') do |p|
|
337
335
|
p.required = 'Y'
|
338
336
|
p.type = 'int'
|
339
|
-
p.description =
|
337
|
+
p.description = "the person's ID"
|
340
338
|
end
|
341
339
|
|
342
340
|
method.parameter('body') do |p|
|
@@ -348,13 +346,13 @@ class ApiSpec::Spec
|
|
348
346
|
|
349
347
|
people.method('Political Capital') do |method|
|
350
348
|
method.synopsis = "Returns a paginated list of a person's capitals"
|
351
|
-
method.http_method =
|
352
|
-
method.uri =
|
349
|
+
method.http_method = 'GET'
|
350
|
+
method.uri = '/people/:id/capitals'
|
353
351
|
|
354
352
|
method.parameter('id') do |p|
|
355
353
|
p.required = 'Y'
|
356
354
|
p.type = 'int'
|
357
|
-
p.description = "the ID
|
355
|
+
p.description = "the person's ID"
|
358
356
|
end
|
359
357
|
|
360
358
|
method.parameter('__token') do |p|
|
@@ -378,14 +376,14 @@ class ApiSpec::Spec
|
|
378
376
|
end
|
379
377
|
|
380
378
|
people.method('Political Capital Create') do |method|
|
381
|
-
method.synopsis =
|
382
|
-
method.http_method =
|
383
|
-
method.uri =
|
379
|
+
method.synopsis = 'Creates capital for the given person'
|
380
|
+
method.http_method = 'POST'
|
381
|
+
method.uri = '/people/:id/capitals'
|
384
382
|
|
385
383
|
method.parameter('id') do |p|
|
386
384
|
p.required = 'Y'
|
387
385
|
p.type = 'int'
|
388
|
-
p.description = "the ID
|
386
|
+
p.description = "the person's ID"
|
389
387
|
end
|
390
388
|
|
391
389
|
method.parameter('body') do |p|
|
@@ -396,14 +394,14 @@ class ApiSpec::Spec
|
|
396
394
|
end
|
397
395
|
|
398
396
|
people.method('Political Capital Destroy') do |method|
|
399
|
-
method.synopsis =
|
400
|
-
method.http_method =
|
401
|
-
method.uri =
|
397
|
+
method.synopsis = 'Destroys capital for a person'
|
398
|
+
method.http_method = 'DELETE'
|
399
|
+
method.uri = '/people/:person_id/capitals/:capital_id'
|
402
400
|
|
403
401
|
method.parameter('person_id') do |p|
|
404
402
|
p.required = 'Y'
|
405
403
|
p.type = 'int'
|
406
|
-
p.description =
|
404
|
+
p.description = "the person's ID"
|
407
405
|
end
|
408
406
|
|
409
407
|
method.parameter('capital_id') do |p|
|
@@ -414,27 +412,27 @@ class ApiSpec::Spec
|
|
414
412
|
end
|
415
413
|
|
416
414
|
people.method('Create') do |method|
|
417
|
-
method.synopsis =
|
418
|
-
method.http_method =
|
419
|
-
method.uri =
|
415
|
+
method.synopsis = 'Creates a person with the provided data'
|
416
|
+
method.http_method = 'POST'
|
417
|
+
method.uri = '/people'
|
420
418
|
|
421
419
|
method.parameter('body') do |p|
|
422
420
|
p.required = 'Y'
|
423
421
|
p.default = '{}'
|
424
422
|
p.type = 'json'
|
425
|
-
p.description = 'JSON representation of the person to create'
|
423
|
+
p.description = 'a JSON representation of the person to create'
|
426
424
|
end
|
427
425
|
end
|
428
426
|
|
429
427
|
people.method('Update') do |method|
|
430
|
-
method.synopsis =
|
431
|
-
method.http_method =
|
432
|
-
method.uri =
|
428
|
+
method.synopsis = 'Updates a person with the provided data'
|
429
|
+
method.http_method = 'PUT'
|
430
|
+
method.uri = '/people/:id'
|
433
431
|
|
434
432
|
method.parameter('id') do |p|
|
435
433
|
p.required = 'Y'
|
436
434
|
p.type = 'int'
|
437
|
-
p.description = "
|
435
|
+
p.description = "the person's ID"
|
438
436
|
end
|
439
437
|
|
440
438
|
method.parameter('body') do |p|
|
@@ -447,8 +445,8 @@ class ApiSpec::Spec
|
|
447
445
|
|
448
446
|
people.method('Push') do |method|
|
449
447
|
method.synopsis = "Updates a matched person or creates a new one if the person doesn't exist"
|
450
|
-
method.http_method =
|
451
|
-
method.uri =
|
448
|
+
method.http_method = 'PUT'
|
449
|
+
method.uri = '/people/push'
|
452
450
|
|
453
451
|
method.parameter('body') do |p|
|
454
452
|
p.required = 'Y'
|
@@ -460,8 +458,8 @@ class ApiSpec::Spec
|
|
460
458
|
|
461
459
|
people.method('Add') do |method|
|
462
460
|
method.synopsis = "Updates a matched person (without overriding data) or creates a new one if the person doesn't exist"
|
463
|
-
method.http_method =
|
464
|
-
method.uri =
|
461
|
+
method.http_method = 'PUT'
|
462
|
+
method.uri = '/people/add'
|
465
463
|
|
466
464
|
method.parameter('body') do |p|
|
467
465
|
p.required = 'Y'
|
@@ -472,35 +470,33 @@ class ApiSpec::Spec
|
|
472
470
|
end
|
473
471
|
|
474
472
|
people.method('Destroy') do |method|
|
475
|
-
method.synopsis =
|
476
|
-
method.http_method =
|
477
|
-
method.uri =
|
473
|
+
method.synopsis = 'Removes the person with the matching ID'
|
474
|
+
method.http_method = 'DELETE'
|
475
|
+
method.uri = '/people/:id'
|
478
476
|
|
479
477
|
method.parameter('id') do |p|
|
480
478
|
p.required = 'Y'
|
481
479
|
p.type = 'int'
|
482
|
-
p.description = "
|
480
|
+
p.description = "the person's ID"
|
483
481
|
end
|
484
482
|
end
|
485
483
|
|
486
484
|
people.method('Private Note Create') do |method|
|
487
|
-
method.synopsis =
|
488
|
-
method.http_method =
|
489
|
-
method.uri =
|
485
|
+
method.synopsis = 'Creates a private note for the given person'
|
486
|
+
method.http_method = 'POST'
|
487
|
+
method.uri = '/people/:id/notes'
|
490
488
|
|
491
489
|
method.parameter('id') do |p|
|
492
490
|
p.required = 'Y'
|
493
491
|
p.type = 'int'
|
494
|
-
p.description = "the ID
|
492
|
+
p.description = "the person's ID"
|
495
493
|
end
|
496
494
|
|
497
495
|
method.parameter('body') do |p|
|
498
496
|
p.required = 'Y'
|
499
497
|
p.type = 'json'
|
500
|
-
p.description = 'JSON representation of the note to create'
|
498
|
+
p.description = 'a JSON representation of the note to create'
|
501
499
|
end
|
502
500
|
end
|
503
|
-
|
504
501
|
end
|
505
|
-
|
506
502
|
end
|
@@ -3,9 +3,9 @@ class ApiSpec::Spec
|
|
3
3
|
endpoint 'People Tags' do |tags|
|
4
4
|
|
5
5
|
tags.method('Index') do |method|
|
6
|
-
method.synopsis =
|
7
|
-
method.http_method =
|
8
|
-
method.uri =
|
6
|
+
method.synopsis = 'Returns a list of previously used tags'
|
7
|
+
method.http_method = 'GET'
|
8
|
+
method.uri = '/tags'
|
9
9
|
|
10
10
|
method.parameter('__token') do |p|
|
11
11
|
p.required = 'N'
|
@@ -28,9 +28,9 @@ class ApiSpec::Spec
|
|
28
28
|
end
|
29
29
|
|
30
30
|
tags.method('People') do |method|
|
31
|
-
method.synopsis =
|
32
|
-
method.http_method =
|
33
|
-
method.uri =
|
31
|
+
method.synopsis = 'Searches for people with the given tag'
|
32
|
+
method.http_method = 'GET'
|
33
|
+
method.uri = '/tags/:tag/people'
|
34
34
|
|
35
35
|
method.parameter('tag') do |p|
|
36
36
|
p.required = 'Y'
|
@@ -57,7 +57,5 @@ class ApiSpec::Spec
|
|
57
57
|
p.description = 'maximum number of results to return'
|
58
58
|
end
|
59
59
|
end
|
60
|
-
|
61
60
|
end
|
62
|
-
|
63
61
|
end
|
@@ -3,9 +3,9 @@ class ApiSpec::Spec
|
|
3
3
|
endpoint 'Precincts' do |precinct|
|
4
4
|
|
5
5
|
precinct.method('Index') do |method|
|
6
|
-
method.synopsis =
|
7
|
-
method.http_method =
|
8
|
-
method.uri =
|
6
|
+
method.synopsis = 'Returns a list of current precincts'
|
7
|
+
method.http_method = 'GET'
|
8
|
+
method.uri = '/precincts'
|
9
9
|
|
10
10
|
method.parameter('__token') do |p|
|
11
11
|
p.required = 'N'
|
@@ -28,40 +28,40 @@ class ApiSpec::Spec
|
|
28
28
|
end
|
29
29
|
|
30
30
|
precinct.method('Show') do |method|
|
31
|
-
method.synopsis =
|
32
|
-
method.http_method =
|
33
|
-
method.uri =
|
31
|
+
method.synopsis = 'Returns a representation of the precinct'
|
32
|
+
method.http_method = 'GET'
|
33
|
+
method.uri = '/precincts/:id'
|
34
34
|
|
35
35
|
method.parameter('id') do |p|
|
36
36
|
p.required = 'Y'
|
37
37
|
p.default = '1'
|
38
38
|
p.type = 'int'
|
39
|
-
p.description = "the precinct's
|
39
|
+
p.description = "the precinct's ID"
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
43
|
precinct.method('Create') do |method|
|
44
|
-
method.synopsis =
|
45
|
-
method.http_method =
|
46
|
-
method.uri =
|
44
|
+
method.synopsis = 'Creates a precinct with the provided data'
|
45
|
+
method.http_method = 'POST'
|
46
|
+
method.uri = '/precincts'
|
47
47
|
|
48
48
|
method.parameter('body') do |p|
|
49
49
|
p.required = 'Y'
|
50
50
|
p.default = '{}'
|
51
51
|
p.type = 'json'
|
52
|
-
p.description = 'JSON representation of the precinct to create'
|
52
|
+
p.description = 'a JSON representation of the precinct to create'
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
56
|
precinct.method('Update') do |method|
|
57
|
-
method.synopsis =
|
58
|
-
method.http_method =
|
59
|
-
method.uri =
|
57
|
+
method.synopsis = 'Updates a precinct with the provided data'
|
58
|
+
method.http_method = 'PUT'
|
59
|
+
method.uri = '/precincts/:id'
|
60
60
|
|
61
61
|
method.parameter('id') do |p|
|
62
62
|
p.required = 'Y'
|
63
63
|
p.type = 'int'
|
64
|
-
p.description = "
|
64
|
+
p.description = "the precinct's ID"
|
65
65
|
end
|
66
66
|
|
67
67
|
method.parameter('body') do |p|
|
@@ -73,17 +73,15 @@ class ApiSpec::Spec
|
|
73
73
|
end
|
74
74
|
|
75
75
|
precinct.method('Destroy') do |method|
|
76
|
-
method.synopsis =
|
77
|
-
method.http_method =
|
78
|
-
method.uri =
|
76
|
+
method.synopsis = 'Removes the precinct with the matching ID'
|
77
|
+
method.http_method = 'DELETE'
|
78
|
+
method.uri = '/precincts/:id'
|
79
79
|
|
80
80
|
method.parameter('id') do |p|
|
81
81
|
p.required = 'Y'
|
82
82
|
p.type = 'int'
|
83
|
-
p.description = "
|
83
|
+
p.description = "the precinct's ID"
|
84
84
|
end
|
85
85
|
end
|
86
|
-
|
87
86
|
end
|
88
|
-
|
89
87
|
end
|