nationbuilder-rb 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/README.md +9 -0
- data/VERSION +1 -1
- data/lib/api_spec/.ruby-gemset +1 -0
- data/lib/api_spec/.ruby-version +1 -0
- data/lib/api_spec/Gemfile +3 -0
- data/lib/api_spec/Gemfile.lock +13 -0
- data/lib/api_spec/LICENSE.txt +20 -0
- data/lib/api_spec/README.md +20 -0
- data/lib/api_spec/Rakefile +9 -0
- data/lib/api_spec/lib/api_spec.rb +26 -0
- data/lib/api_spec/lib/api_spec/generator.rb +113 -0
- data/lib/api_spec/lib/api_spec/specs/basic_pages.rb +106 -0
- data/lib/api_spec/lib/api_spec/specs/blog_posts.rb +160 -0
- data/lib/api_spec/lib/api_spec/specs/blogs.rb +128 -0
- data/lib/api_spec/lib/api_spec/specs/calendars.rb +128 -0
- data/lib/api_spec/lib/api_spec/specs/campaign_data.rb +15 -0
- data/lib/api_spec/lib/api_spec/specs/contacts.rb +155 -0
- data/lib/api_spec/lib/api_spec/specs/donations.rb +76 -0
- data/lib/api_spec/lib/api_spec/specs/events.rb +238 -0
- data/lib/api_spec/lib/api_spec/specs/exports.rb +42 -0
- data/lib/api_spec/lib/api_spec/specs/imports.rb +43 -0
- data/lib/api_spec/lib/api_spec/specs/lists.rb +215 -0
- data/lib/api_spec/lib/api_spec/specs/memberships.rb +94 -0
- data/lib/api_spec/lib/api_spec/specs/page_attachments.rb +121 -0
- data/lib/api_spec/lib/api_spec/specs/people.rb +500 -0
- data/lib/api_spec/lib/api_spec/specs/people_tags.rb +63 -0
- data/lib/api_spec/lib/api_spec/specs/precincts.rb +89 -0
- data/lib/api_spec/lib/api_spec/specs/sites.rb +32 -0
- data/lib/api_spec/lib/api_spec/specs/survey_responses.rb +64 -0
- data/lib/api_spec/lib/api_spec/specs/surveys.rb +106 -0
- data/lib/api_spec/lib/api_spec/specs/webhooks.rb +75 -0
- data/lib/{nationbuilder/api_spec.json → api_spec/spec.json} +143 -5
- data/lib/nationbuilder/client.rb +1 -1
- data/nationbuilder-rb.gemspec +35 -5
- data/spec/nationbuilder_client_spec.rb +1 -0
- data/update_subtree.sh +1 -0
- metadata +33 -3
@@ -0,0 +1,94 @@
|
|
1
|
+
class ApiSpec::Spec
|
2
|
+
|
3
|
+
endpoint 'Memberships' do |memberships|
|
4
|
+
|
5
|
+
memberships.method('Index') do |method|
|
6
|
+
method.synopsis = 'Lists all memberships for a person'
|
7
|
+
method.http_method = 'GET'
|
8
|
+
method.uri = '/people/:person_id/memberships'
|
9
|
+
|
10
|
+
method.parameter('person_id') do |p|
|
11
|
+
p.required = 'Y'
|
12
|
+
p.type = 'int'
|
13
|
+
p.description = 'The person\'s ID'
|
14
|
+
end
|
15
|
+
|
16
|
+
method.parameter('__token') do |p|
|
17
|
+
p.required = 'N'
|
18
|
+
p.type = 'string'
|
19
|
+
p.description = 'pagination token'
|
20
|
+
end
|
21
|
+
|
22
|
+
method.parameter('__nonce') do |p|
|
23
|
+
p.required = 'N'
|
24
|
+
p.type = 'string'
|
25
|
+
p.description = 'pagination nonce'
|
26
|
+
end
|
27
|
+
|
28
|
+
method.parameter('limit') do |p|
|
29
|
+
p.required = 'N'
|
30
|
+
p.default = '10'
|
31
|
+
p.type = 'int'
|
32
|
+
p.description = 'maximum number of results to return'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
memberships.method('Create') do |method|
|
37
|
+
method.synopsis = 'Creates a membership'
|
38
|
+
method.http_method = 'POST'
|
39
|
+
method.uri = '/people/:person_id/memberships'
|
40
|
+
|
41
|
+
method.parameter('person_id') do |p|
|
42
|
+
p.required = 'Y'
|
43
|
+
p.type = 'int'
|
44
|
+
p.description = 'The person\'s ID'
|
45
|
+
end
|
46
|
+
|
47
|
+
method.parameter('body') do |p|
|
48
|
+
p.required = 'Y'
|
49
|
+
p.default = '{}'
|
50
|
+
p.type = 'json'
|
51
|
+
p.description = 'JSON attributes for the new membership'
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
memberships.method('Update') do |method|
|
56
|
+
method.synopsis = 'Updates a membership'
|
57
|
+
method.http_method = 'PUT'
|
58
|
+
method.uri = '/people/:person_id/memberships'
|
59
|
+
|
60
|
+
method.parameter('person_id') do |p|
|
61
|
+
p.required = 'Y'
|
62
|
+
p.type = 'int'
|
63
|
+
p.description = 'The person\'s ID'
|
64
|
+
end
|
65
|
+
|
66
|
+
method.parameter('body') do |p|
|
67
|
+
p.required = 'Y'
|
68
|
+
p.default = '{}'
|
69
|
+
p.type = 'json'
|
70
|
+
p.description = 'JSON attributes for updating a membership'
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
memberships.method('Destroy') do |method|
|
75
|
+
method.synopsis = 'Removes a membership from the person'
|
76
|
+
method.http_method = 'DELETE'
|
77
|
+
method.uri = '/people/:person_id/memberships/:name'
|
78
|
+
|
79
|
+
method.parameter('person_id') do |p|
|
80
|
+
p.required = 'Y'
|
81
|
+
p.type = 'int'
|
82
|
+
p.description = 'The person\'s ID'
|
83
|
+
end
|
84
|
+
|
85
|
+
method.parameter('name') do |p|
|
86
|
+
p.required = 'Y'
|
87
|
+
p.type = 'string'
|
88
|
+
p.description = 'The name of the membership'
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
@@ -0,0 +1,121 @@
|
|
1
|
+
class ApiSpec::Spec
|
2
|
+
|
3
|
+
endpoint 'Page Attachments' do |pa|
|
4
|
+
|
5
|
+
pa.method('Index') do |method|
|
6
|
+
method.synopsis = "Returns a list of a page's file attachments"
|
7
|
+
method.http_method = "GET"
|
8
|
+
method.uri = "/sites/:site_slug/pages/:page_slug/attachments"
|
9
|
+
|
10
|
+
method.parameter('site_slug') do |p|
|
11
|
+
p.required = 'Y'
|
12
|
+
p.type = 'string'
|
13
|
+
p.description = 'The slug of the site the page lives on'
|
14
|
+
end
|
15
|
+
|
16
|
+
method.parameter('page_slug') do |p|
|
17
|
+
p.required = 'Y'
|
18
|
+
p.default = '1'
|
19
|
+
p.type = 'string'
|
20
|
+
p.description = 'The page\'s slug'
|
21
|
+
end
|
22
|
+
|
23
|
+
method.parameter('__token') do |p|
|
24
|
+
p.required = 'N'
|
25
|
+
p.type = 'string'
|
26
|
+
p.description = 'pagination token'
|
27
|
+
end
|
28
|
+
|
29
|
+
method.parameter('__nonce') do |p|
|
30
|
+
p.required = 'N'
|
31
|
+
p.type = 'string'
|
32
|
+
p.description = 'pagination nonce'
|
33
|
+
end
|
34
|
+
|
35
|
+
method.parameter('limit') do |p|
|
36
|
+
p.required = 'N'
|
37
|
+
p.default = '10'
|
38
|
+
p.type = 'int'
|
39
|
+
p.description = 'maximum number of results to return'
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
pa.method('Show') do |method|
|
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
|
+
|
48
|
+
method.parameter('site_slug') do |p|
|
49
|
+
p.required = 'Y'
|
50
|
+
p.type = 'string'
|
51
|
+
p.description = 'The slug of the site the page lives on'
|
52
|
+
end
|
53
|
+
|
54
|
+
method.parameter('page_slug') do |p|
|
55
|
+
p.required = 'Y'
|
56
|
+
p.default = '1'
|
57
|
+
p.type = 'string'
|
58
|
+
p.description = 'The page\'s slug'
|
59
|
+
end
|
60
|
+
|
61
|
+
method.parameter('id') do |p|
|
62
|
+
p.required = 'Y'
|
63
|
+
p.type = 'int'
|
64
|
+
p.description = 'The ID of the page attachment'
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
pa.method('Create') do |method|
|
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
|
+
|
73
|
+
method.parameter('site_slug') do |p|
|
74
|
+
p.required = 'Y'
|
75
|
+
p.type = 'string'
|
76
|
+
p.description = 'The slug of the site the page lives on'
|
77
|
+
end
|
78
|
+
|
79
|
+
method.parameter('page_slug') do |p|
|
80
|
+
p.required = 'Y'
|
81
|
+
p.default = '1'
|
82
|
+
p.type = 'string'
|
83
|
+
p.description = 'The page\'s slug'
|
84
|
+
end
|
85
|
+
|
86
|
+
method.parameter('body') do |p|
|
87
|
+
p.required = 'Y'
|
88
|
+
p.default = '{}'
|
89
|
+
p.type = 'json'
|
90
|
+
p.description = 'A JSON representation of the attachment'
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
pa.method('Destroy') do |method|
|
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
|
+
|
99
|
+
method.parameter('site_slug') do |p|
|
100
|
+
p.required = 'Y'
|
101
|
+
p.type = 'string'
|
102
|
+
p.description = 'The slug of the site the page lives on'
|
103
|
+
end
|
104
|
+
|
105
|
+
method.parameter('page_slug') do |p|
|
106
|
+
p.required = 'Y'
|
107
|
+
p.default = '1'
|
108
|
+
p.type = 'string'
|
109
|
+
p.description = 'The page\'s slug'
|
110
|
+
end
|
111
|
+
|
112
|
+
method.parameter('id') do |p|
|
113
|
+
p.required = 'Y'
|
114
|
+
p.type = 'int'
|
115
|
+
p.description = 'The ID of the page attachment'
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
end
|
120
|
+
|
121
|
+
end
|
@@ -0,0 +1,500 @@
|
|
1
|
+
class ApiSpec::Spec
|
2
|
+
|
3
|
+
endpoint 'People' do |people|
|
4
|
+
|
5
|
+
people.method('Index') do |method|
|
6
|
+
method.synopsis = "Returns a list of people"
|
7
|
+
method.http_method = "GET"
|
8
|
+
method.uri = "/people"
|
9
|
+
|
10
|
+
method.parameter('__token') do |p|
|
11
|
+
p.required = 'N'
|
12
|
+
p.type = 'string'
|
13
|
+
p.description = 'pagination token'
|
14
|
+
end
|
15
|
+
|
16
|
+
method.parameter('__nonce') do |p|
|
17
|
+
p.required = 'N'
|
18
|
+
p.type = 'string'
|
19
|
+
p.description = 'pagination nonce'
|
20
|
+
end
|
21
|
+
|
22
|
+
method.parameter('limit') do |p|
|
23
|
+
p.required = 'N'
|
24
|
+
p.default = '10'
|
25
|
+
p.type = 'int'
|
26
|
+
p.description = 'maximum number of results to return'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
people.method('Show') do |method|
|
31
|
+
method.synopsis = "Returns a full representation of the person"
|
32
|
+
method.http_method = "GET"
|
33
|
+
method.uri = "/people/:id"
|
34
|
+
|
35
|
+
method.parameter('id') do |p|
|
36
|
+
p.required = 'Y'
|
37
|
+
p.default = '1'
|
38
|
+
p.type = 'int'
|
39
|
+
p.description = 'the person\'s id'
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
people.method('Match') do |method|
|
44
|
+
method.synopsis = "Finds people that match certain attributes exactly"
|
45
|
+
method.http_method = "GET"
|
46
|
+
method.uri = "/people/match"
|
47
|
+
|
48
|
+
method.parameter("email") do |p|
|
49
|
+
p.required = 'N'
|
50
|
+
p.type = 'string'
|
51
|
+
end
|
52
|
+
|
53
|
+
method.parameter("first_name") do |p|
|
54
|
+
p.required = 'N'
|
55
|
+
p.type = 'string'
|
56
|
+
p.description = 'deprecated'
|
57
|
+
end
|
58
|
+
|
59
|
+
method.parameter("last_name") do |p|
|
60
|
+
p.required = 'N'
|
61
|
+
p.type = 'string'
|
62
|
+
p.description = 'deprecated'
|
63
|
+
end
|
64
|
+
|
65
|
+
method.parameter("phone") do |p|
|
66
|
+
p.required = 'N'
|
67
|
+
p.type = 'string'
|
68
|
+
p.description = 'deprecated'
|
69
|
+
end
|
70
|
+
|
71
|
+
method.parameter("mobile") do |p|
|
72
|
+
p.required = 'N'
|
73
|
+
p.type = 'string'
|
74
|
+
p.description = 'deprecated'
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
78
|
+
|
79
|
+
people.method('Search') do |method|
|
80
|
+
method.synopsis = "Search for people using non-unique traits"
|
81
|
+
method.http_method = "GET"
|
82
|
+
method.uri = "/people/search"
|
83
|
+
|
84
|
+
method.parameter("first_name") do |p|
|
85
|
+
p.required = 'N'
|
86
|
+
p.type = 'string'
|
87
|
+
end
|
88
|
+
|
89
|
+
method.parameter("last_name") do |p|
|
90
|
+
p.required = 'N'
|
91
|
+
p.type = 'string'
|
92
|
+
end
|
93
|
+
|
94
|
+
method.parameter("city") do |p|
|
95
|
+
p.required = 'N'
|
96
|
+
p.type = 'string'
|
97
|
+
end
|
98
|
+
|
99
|
+
method.parameter("state") do |p|
|
100
|
+
p.required = 'N'
|
101
|
+
p.type = 'string'
|
102
|
+
end
|
103
|
+
|
104
|
+
method.parameter("sex") do |p|
|
105
|
+
p.required = 'N'
|
106
|
+
p.type = 'string'
|
107
|
+
end
|
108
|
+
|
109
|
+
method.parameter("birthdate") do |p|
|
110
|
+
p.required = 'N'
|
111
|
+
p.type = 'string'
|
112
|
+
end
|
113
|
+
|
114
|
+
method.parameter("updated_since") do |p|
|
115
|
+
p.required = 'N'
|
116
|
+
p.type = 'string'
|
117
|
+
end
|
118
|
+
|
119
|
+
method.parameter("with_mobile") do |p|
|
120
|
+
p.required = 'N'
|
121
|
+
p.type = 'string'
|
122
|
+
end
|
123
|
+
|
124
|
+
method.parameter("custom_values") do |p|
|
125
|
+
p.required = 'N'
|
126
|
+
p.type = 'string'
|
127
|
+
end
|
128
|
+
|
129
|
+
method.parameter('civicrm_id') do |p|
|
130
|
+
p.required = 'N'
|
131
|
+
p.type = 'string'
|
132
|
+
end
|
133
|
+
|
134
|
+
method.parameter('county_file_id') do |p|
|
135
|
+
p.required = 'N'
|
136
|
+
p.type = 'string'
|
137
|
+
end
|
138
|
+
|
139
|
+
method.parameter('datatrust_id') do |p|
|
140
|
+
p.required = 'N'
|
141
|
+
p.type = 'string'
|
142
|
+
end
|
143
|
+
|
144
|
+
method.parameter('dw_id') do |p|
|
145
|
+
p.required = 'N'
|
146
|
+
p.type = 'string'
|
147
|
+
end
|
148
|
+
|
149
|
+
method.parameter('external_id') do |p|
|
150
|
+
p.required = 'N'
|
151
|
+
p.type = 'string'
|
152
|
+
end
|
153
|
+
|
154
|
+
method.parameter('media_market_id') do |p|
|
155
|
+
p.required = 'N'
|
156
|
+
p.type = 'string'
|
157
|
+
end
|
158
|
+
|
159
|
+
method.parameter('membership_level_id') do |p|
|
160
|
+
p.required = 'N'
|
161
|
+
p.type = 'string'
|
162
|
+
end
|
163
|
+
|
164
|
+
method.parameter('ngp_id') do |p|
|
165
|
+
p.required = 'N'
|
166
|
+
p.type = 'string'
|
167
|
+
end
|
168
|
+
|
169
|
+
method.parameter('pf_strat_id') do |p|
|
170
|
+
p.required = 'N'
|
171
|
+
p.type = 'string'
|
172
|
+
end
|
173
|
+
|
174
|
+
method.parameter('rnc_id') do |p|
|
175
|
+
p.required = 'N'
|
176
|
+
p.type = 'string'
|
177
|
+
end
|
178
|
+
|
179
|
+
method.parameter('rnc_regid') do |p|
|
180
|
+
p.required = 'N'
|
181
|
+
p.type = 'string'
|
182
|
+
end
|
183
|
+
|
184
|
+
method.parameter('salesforce_id') do |p|
|
185
|
+
p.required = 'N'
|
186
|
+
p.type = 'string'
|
187
|
+
end
|
188
|
+
|
189
|
+
method.parameter('state_file_id') do |p|
|
190
|
+
p.required = 'N'
|
191
|
+
p.type = 'string'
|
192
|
+
end
|
193
|
+
|
194
|
+
method.parameter('van_id') do |p|
|
195
|
+
p.required = 'N'
|
196
|
+
p.type = 'string'
|
197
|
+
end
|
198
|
+
|
199
|
+
method.parameter('__token') do |p|
|
200
|
+
p.required = 'N'
|
201
|
+
p.type = 'string'
|
202
|
+
p.description = 'pagination token'
|
203
|
+
end
|
204
|
+
|
205
|
+
method.parameter('__nonce') do |p|
|
206
|
+
p.required = 'N'
|
207
|
+
p.type = 'string'
|
208
|
+
p.description = 'pagination nonce'
|
209
|
+
end
|
210
|
+
|
211
|
+
method.parameter('limit') do |p|
|
212
|
+
p.required = 'N'
|
213
|
+
p.default = '10'
|
214
|
+
p.type = 'int'
|
215
|
+
p.description = 'maximum number of results to return'
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
people.method('Nearby') do |method|
|
220
|
+
method.synopsis = "Searches for people near a location defined by latitude and longitude"
|
221
|
+
method.http_method = "GET"
|
222
|
+
method.uri = "/people/nearby"
|
223
|
+
|
224
|
+
method.parameter('location') do |p|
|
225
|
+
p.required = 'Y'
|
226
|
+
p.default = '34.049031,-118.251399'
|
227
|
+
p.type = 'string'
|
228
|
+
p.description = 'origin of search in the format "latitude,longitude"'
|
229
|
+
end
|
230
|
+
|
231
|
+
method.parameter('distance') do |p|
|
232
|
+
p.required = 'N'
|
233
|
+
p.default = '1'
|
234
|
+
p.type = 'int'
|
235
|
+
p.description = 'radius in miles for which to include results'
|
236
|
+
end
|
237
|
+
|
238
|
+
method.parameter('__token') do |p|
|
239
|
+
p.required = 'N'
|
240
|
+
p.type = 'string'
|
241
|
+
p.description = 'pagination token'
|
242
|
+
end
|
243
|
+
|
244
|
+
method.parameter('__nonce') do |p|
|
245
|
+
p.required = 'N'
|
246
|
+
p.type = 'string'
|
247
|
+
p.description = 'pagination nonce'
|
248
|
+
end
|
249
|
+
|
250
|
+
method.parameter('limit') do |p|
|
251
|
+
p.required = 'N'
|
252
|
+
p.default = '10'
|
253
|
+
p.type = 'int'
|
254
|
+
p.description = 'maximum number of results to return'
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
people.method('Me') do |method|
|
259
|
+
method.synopsis = "Returns the access token's resource owner's representation"
|
260
|
+
method.http_method = "GET"
|
261
|
+
method.uri = "/people/me"
|
262
|
+
end
|
263
|
+
|
264
|
+
people.method('Register') do |method|
|
265
|
+
method.synopsis = "Starts user registration person for the given person"
|
266
|
+
method.http_method = "GET"
|
267
|
+
method.uri = "/people/:id/register"
|
268
|
+
|
269
|
+
method.parameter('id') do |p|
|
270
|
+
p.required = 'Y'
|
271
|
+
p.type = 'int'
|
272
|
+
p.description = "The person's ID"
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
276
|
+
people.method('Taggings') do |method|
|
277
|
+
method.synopsis = "Returns all taggings for a given person"
|
278
|
+
method.http_method = "GET"
|
279
|
+
method.uri = "/people/:id/taggings"
|
280
|
+
|
281
|
+
method.parameter('id') do |p|
|
282
|
+
p.required = 'Y'
|
283
|
+
p.type = 'int'
|
284
|
+
p.description = 'the ID of the person'
|
285
|
+
end
|
286
|
+
end
|
287
|
+
|
288
|
+
people.method('Tag Person') do |method|
|
289
|
+
method.synopsis = "Tags a person"
|
290
|
+
method.http_method = "PUT"
|
291
|
+
method.uri = "/people/:id/taggings"
|
292
|
+
|
293
|
+
method.parameter('id') do |p|
|
294
|
+
p.required = 'Y'
|
295
|
+
p.type = 'int'
|
296
|
+
p.description = 'the ID of the person'
|
297
|
+
end
|
298
|
+
|
299
|
+
method.parameter('body') do |p|
|
300
|
+
p.required = 'Y'
|
301
|
+
p.type = 'json'
|
302
|
+
p.description = 'JSON with tagging information'
|
303
|
+
end
|
304
|
+
end
|
305
|
+
|
306
|
+
people.method('Tag Removal') do |method|
|
307
|
+
method.synopsis = "Removes a tag from a person"
|
308
|
+
method.http_method = "DELETE"
|
309
|
+
method.uri = "/people/:id/taggings/:tag"
|
310
|
+
|
311
|
+
method.parameter('id') do |p|
|
312
|
+
p.required = 'Y'
|
313
|
+
p.type = 'int'
|
314
|
+
p.description = 'the ID of the person'
|
315
|
+
end
|
316
|
+
|
317
|
+
method.parameter('tag') do |p|
|
318
|
+
p.required = 'Y'
|
319
|
+
p.type = 'string'
|
320
|
+
p.description = 'the name of the tag'
|
321
|
+
end
|
322
|
+
|
323
|
+
end
|
324
|
+
|
325
|
+
people.method('Bulk Tag Removal') do |method|
|
326
|
+
method.synopsis = "Removes tags from a person"
|
327
|
+
method.http_method = "DELETE"
|
328
|
+
method.uri = "/people/:id/taggings"
|
329
|
+
|
330
|
+
method.parameter('id') do |p|
|
331
|
+
p.required = 'Y'
|
332
|
+
p.type = 'int'
|
333
|
+
p.description = 'the ID of the person'
|
334
|
+
end
|
335
|
+
|
336
|
+
method.parameter('body') do |p|
|
337
|
+
p.required = 'Y'
|
338
|
+
p.type = 'json'
|
339
|
+
p.description = 'the tagging resource'
|
340
|
+
end
|
341
|
+
end
|
342
|
+
|
343
|
+
people.method('Political Capital') do |method|
|
344
|
+
method.synopsis = "Returns a paginated list of a person's capitals"
|
345
|
+
method.http_method = "GET"
|
346
|
+
method.uri = "/people/:id/capitals"
|
347
|
+
|
348
|
+
method.parameter('id') do |p|
|
349
|
+
p.required = 'Y'
|
350
|
+
p.type = 'int'
|
351
|
+
p.description = "the ID of the person"
|
352
|
+
end
|
353
|
+
|
354
|
+
method.parameter('__token') do |p|
|
355
|
+
p.required = 'N'
|
356
|
+
p.type = 'string'
|
357
|
+
p.description = 'pagination token'
|
358
|
+
end
|
359
|
+
|
360
|
+
method.parameter('__nonce') do |p|
|
361
|
+
p.required = 'N'
|
362
|
+
p.type = 'string'
|
363
|
+
p.description = 'pagination nonce'
|
364
|
+
end
|
365
|
+
|
366
|
+
method.parameter('limit') do |p|
|
367
|
+
p.required = 'N'
|
368
|
+
p.default = '10'
|
369
|
+
p.type = 'int'
|
370
|
+
p.description = 'maximum number of results to return'
|
371
|
+
end
|
372
|
+
end
|
373
|
+
|
374
|
+
people.method('Political Capital Create') do |method|
|
375
|
+
method.synopsis = "Creates capital for the given person"
|
376
|
+
method.http_method = "POST"
|
377
|
+
method.uri = "/people/:id/capitals"
|
378
|
+
|
379
|
+
method.parameter('id') do |p|
|
380
|
+
p.required = 'Y'
|
381
|
+
p.type = 'int'
|
382
|
+
p.description = "the ID of the person"
|
383
|
+
end
|
384
|
+
|
385
|
+
method.parameter('body') do |p|
|
386
|
+
p.required = 'Y'
|
387
|
+
p.type = 'json'
|
388
|
+
p.description = 'JSON representation of the capital to create'
|
389
|
+
end
|
390
|
+
end
|
391
|
+
|
392
|
+
people.method('Political Capital Destroy') do |method|
|
393
|
+
method.synopsis = "Destroys capital for a person"
|
394
|
+
method.http_method = "DELETE"
|
395
|
+
method.uri = "/people/:person_id/capitals/:capital_id"
|
396
|
+
|
397
|
+
method.parameter('person_id') do |p|
|
398
|
+
p.required = 'Y'
|
399
|
+
p.type = 'int'
|
400
|
+
p.description = 'the ID of the person'
|
401
|
+
end
|
402
|
+
|
403
|
+
method.parameter('capital_id') do |p|
|
404
|
+
p.required = 'Y'
|
405
|
+
p.type = 'int'
|
406
|
+
p.description = 'the ID of the capital to destroy'
|
407
|
+
end
|
408
|
+
end
|
409
|
+
|
410
|
+
people.method('Create') do |method|
|
411
|
+
method.synopsis = "Creates a person with the provided data"
|
412
|
+
method.http_method = "POST"
|
413
|
+
method.uri = "/people"
|
414
|
+
|
415
|
+
method.parameter('body') do |p|
|
416
|
+
p.required = 'Y'
|
417
|
+
p.default = '{}'
|
418
|
+
p.type = 'json'
|
419
|
+
p.description = 'JSON representation of the person to create'
|
420
|
+
end
|
421
|
+
end
|
422
|
+
|
423
|
+
people.method('Update') do |method|
|
424
|
+
method.synopsis = "Updates a person with the provided data"
|
425
|
+
method.http_method = "PUT"
|
426
|
+
method.uri = "/people/:id"
|
427
|
+
|
428
|
+
method.parameter('id') do |p|
|
429
|
+
p.required = 'Y'
|
430
|
+
p.type = 'int'
|
431
|
+
p.description = "The person's ID"
|
432
|
+
end
|
433
|
+
|
434
|
+
method.parameter('body') do |p|
|
435
|
+
p.required = 'Y'
|
436
|
+
p.default = '{}'
|
437
|
+
p.type = 'json'
|
438
|
+
p.description = 'JSON attributes for updating the person'
|
439
|
+
end
|
440
|
+
end
|
441
|
+
|
442
|
+
people.method('Push') do |method|
|
443
|
+
method.synopsis = "Updates a matched person or creates a new one if the person doesn't exist"
|
444
|
+
method.http_method = "PUT"
|
445
|
+
method.uri = "/people/push"
|
446
|
+
|
447
|
+
method.parameter('body') do |p|
|
448
|
+
p.required = 'Y'
|
449
|
+
p.default = '{}'
|
450
|
+
p.type = 'json'
|
451
|
+
p.description = 'JSON attributes for updating/matching the person'
|
452
|
+
end
|
453
|
+
end
|
454
|
+
|
455
|
+
people.method('Add') do |method|
|
456
|
+
method.synopsis = "Updates a matched person (without overriding data) or creates a new one if the person doesn't exist"
|
457
|
+
method.http_method = "PUT"
|
458
|
+
method.uri = "/people/add"
|
459
|
+
|
460
|
+
method.parameter('body') do |p|
|
461
|
+
p.required = 'Y'
|
462
|
+
p.default = '{}'
|
463
|
+
p.type = 'json'
|
464
|
+
p.description = 'JSON attributes for updating/matching the person'
|
465
|
+
end
|
466
|
+
end
|
467
|
+
|
468
|
+
people.method('Destroy') do |method|
|
469
|
+
method.synopsis = "Removes the person with the matching ID"
|
470
|
+
method.http_method = "DELETE"
|
471
|
+
method.uri = "/people/:id"
|
472
|
+
|
473
|
+
method.parameter('id') do |p|
|
474
|
+
p.required = 'Y'
|
475
|
+
p.type = 'int'
|
476
|
+
p.description = "The person's ID"
|
477
|
+
end
|
478
|
+
end
|
479
|
+
|
480
|
+
people.method('Private Note Create') do |method|
|
481
|
+
method.synopsis = "Creates a private note for the given person"
|
482
|
+
method.http_method = "POST"
|
483
|
+
method.uri = "/people/:id/notes"
|
484
|
+
|
485
|
+
method.parameter('id') do |p|
|
486
|
+
p.required = 'Y'
|
487
|
+
p.type = 'int'
|
488
|
+
p.description = "the ID of the person"
|
489
|
+
end
|
490
|
+
|
491
|
+
method.parameter('body') do |p|
|
492
|
+
p.required = 'Y'
|
493
|
+
p.type = 'json'
|
494
|
+
p.description = 'JSON representation of the note to create'
|
495
|
+
end
|
496
|
+
end
|
497
|
+
|
498
|
+
end
|
499
|
+
|
500
|
+
end
|