certificate-factory 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +3 -0
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +19 -0
  5. data/Gemfile +6 -0
  6. data/Gemfile.lock +154 -0
  7. data/LICENSE.md +10 -0
  8. data/README.md +54 -0
  9. data/Rakefile +114 -0
  10. data/certificate-factory.gemspec +33 -0
  11. data/env.example +3 -0
  12. data/lib/certificate-factory.rb +14 -0
  13. data/lib/certificate-factory/api.rb +19 -0
  14. data/lib/certificate-factory/certificate.rb +112 -0
  15. data/lib/certificate-factory/factory.rb +89 -0
  16. data/lib/certificate-factory/version.rb +3 -0
  17. data/spec/api_spec.rb +12 -0
  18. data/spec/cassettes/CertificateFactory_API/returns_the_correct_URL_for_a_dataset.yml +107 -0
  19. data/spec/cassettes/CertificateFactory_Certificate/keeps_trying_for_a_result_until_it_gets_one.yml +64 -0
  20. data/spec/cassettes/CertificateFactory_Certificate/requests_and_gets_a_certificate.yml +781 -0
  21. data/spec/cassettes/CertificateFactory_Certificate/requests_certificate_creation.yml +39 -0
  22. data/spec/cassettes/CertificateFactory_Certificate/returns_an_error_if_dataset_already_exists.yml +106 -0
  23. data/spec/cassettes/CertificateFactory_Factory/builds_certificates_correctly.yml +726 -0
  24. data/spec/cassettes/CertificateFactory_Factory/creates_the_correct_number_of_certificates_going_over_multiple_pages.yml +4900 -0
  25. data/spec/cassettes/CertificateFactory_Factory/creates_the_correct_number_of_certificates_when_querying_a_single_page.yml +696 -0
  26. data/spec/cassettes/CertificateFactory_Factory/stops_when_it_gets_to_the_end_of_a_feed.yml +126 -0
  27. data/spec/certificate_spec.rb +93 -0
  28. data/spec/factory_spec.rb +88 -0
  29. data/spec/fixtures/certificate.json +1 -0
  30. data/spec/fixtures/feed.atom +97 -0
  31. data/spec/fixtures/one-page.atom +23 -0
  32. data/spec/fixtures/single-feed-1.atom +26 -0
  33. data/spec/fixtures/single-feed-2.atom +32 -0
  34. data/spec/fixtures/single-feed.atom +24 -0
  35. data/spec/spec_helper.rb +43 -0
  36. metadata +254 -0
@@ -0,0 +1,696 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://data.gov.uk/api/2/rest/package/cambridgeshire-county-council-management-band-pay-scales
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Server:
16
+ - nginx/1.6.0
17
+ Date:
18
+ - Fri, 19 Sep 2014 08:23:15 GMT
19
+ Content-Type:
20
+ - application/json;charset=utf-8
21
+ Content-Length:
22
+ - '2770'
23
+ Connection:
24
+ - keep-alive
25
+ Vary:
26
+ - Accept-Encoding
27
+ - Cookie
28
+ Pragma:
29
+ - no-cache
30
+ Cache-Control:
31
+ - no-cache
32
+ Access-Control-Allow-Origin:
33
+ - "*"
34
+ Access-Control-Allow-Methods:
35
+ - POST, PUT, GET, DELETE, OPTIONS
36
+ Access-Control-Allow-Headers:
37
+ - X-CKAN-API-KEY, Authorization, Content-Type
38
+ Accept-Ranges:
39
+ - bytes
40
+ X-Varnish:
41
+ - '2133354772'
42
+ Age:
43
+ - '0'
44
+ Via:
45
+ - 1.1 varnish
46
+ X-App:
47
+ - ckan
48
+ X-Varnish-Cache:
49
+ - MISS
50
+ body:
51
+ encoding: UTF-8
52
+ string: "{\"license_title\": \"UK Open Government Licence (OGL)\", \"maintainer\":
53
+ null, \"private\": false, \"maintainer_email\": null, \"id\": \"4820b7ee-e960-4d65-9bbd-bf05fdd5dd26\",
54
+ \"metadata_created\": \"2014-09-11T08:45:05.302023\", \"relationships\": [],
55
+ \"license\": \"UK Open Government Licence (OGL)\", \"metadata_modified\":
56
+ \"2014-09-11T08:45:05.313103\", \"author\": null, \"author_email\": null,
57
+ \"state\": \"active\", \"version\": null, \"creator_user_id\": \"edec0bc8-46b1-4266-94e0-77257e6ee87e\",
58
+ \"type\": \"dataset\", \"resources\": [{\"resource_group_id\": \"dd82640b-e02d-4921-9258-fb711bc5153c\",
59
+ \"cache_last_updated\": null, \"package_id\": \"4820b7ee-e960-4d65-9bbd-bf05fdd5dd26\",
60
+ \"webstore_last_updated\": null, \"id\": \"ae142d42-3456-4132-996b-df5c99bbf836\",
61
+ \"size\": null, \"last_modified\": null, \"hash\": \"\", \"description\":
62
+ \"Cambridgeshire County Council Management Band pay scales 2014\", \"format\":
63
+ \"CSV\", \"mimetype_inner\": null, \"url_type\": null, \"date\": \"2014-04-01\",
64
+ \"mimetype\": null, \"cache_url\": null, \"name\": null, \"created\": \"2014-09-11T09:45:05.351967\",
65
+ \"url\": \"http://www.cambridgeshire.gov.uk/download/downloads/id/3110/management_band_payscales.csv\",
66
+ \"webstore_url\": null, \"position\": 0, \"resource_type\": \"file\"}], \"num_resources\":
67
+ 1, \"tags\": [], \"groups\": [], \"license_id\": \"uk-ogl\", \"num_tags\":
68
+ 0, \"organization\": {\"description\": \"\", \"title\": \"Cambridgeshire County
69
+ Council\", \"created\": \"2012-06-27T14:49:31.613796\", \"approval_status\":
70
+ \"pending\", \"revision_timestamp\": \"2014-07-22T11:35:00.168201\", \"is_organization\":
71
+ true, \"state\": \"active\", \"image_url\": \"\", \"revision_id\": \"85796520-5663-4477-b49a-b4d4c3514ce7\",
72
+ \"type\": \"organization\", \"id\": \"d0149ce5-e526-4c09-8230-c8cc6a687f6a\",
73
+ \"name\": \"cambridgeshire-county-council\"}, \"name\": \"cambridgeshire-county-council-management-band-pay-scales\",
74
+ \"isopen\": true, \"notes_rendered\": \"<p>This dataset contains the pay scale
75
+ for Management Band roles within Cambridgeshire County Council.\\n</p>\",
76
+ \"url\": null, \"ckan_url\": \"http://data.gov.uk/dataset/cambridgeshire-county-council-management-band-pay-scales\",
77
+ \"notes\": \"This dataset contains the pay scale for Management Band roles
78
+ within Cambridgeshire County Council.\", \"owner_org\": \"d0149ce5-e526-4c09-8230-c8cc6a687f6a\",
79
+ \"ratings_average\": null, \"extras\": {\"contact-name\": \"\", \"temporal_coverage-from\":
80
+ \"\", \"contact-email\": \"\", \"foi-web\": \"\", \"foi-name\": \"\", \"temporal_coverage-to\":
81
+ \"\", \"foi-email\": \"\", \"contact-phone\": \"\", \"mandate\": \"\", \"date\":
82
+ \"01/04/2014\", \"update_frequency\": \"annual\", \"foi-phone\": \"\", \"unpublished\":
83
+ \"false\", \"theme-primary\": \"Government\"}, \"license_url\": \"http://www.nationalarchives.gov.uk/doc/open-government-licence/version/2/\",
84
+ \"ratings_count\": 0, \"title\": \"Cambridgeshire County Council Management
85
+ Band pay scales\", \"revision_id\": \"2cdcc85e-1f97-4520-a453-dede54ab81e2\"}"
86
+ http_version:
87
+ recorded_at: Fri, 19 Sep 2014 08:23:15 GMT
88
+ - request:
89
+ method: post
90
+ uri: http://api%40example.com:<ODC_API_KEY>@open-data-certificate.dev/datasets
91
+ body:
92
+ encoding: UTF-8
93
+ string: "{\"jurisdiction\":\"gb\",\"create_user\":\"true\",\"dataset\":{\"documentationUrl\":\"http://data.gov.uk/dataset/cambridgeshire-county-council-management-band-pay-scales\"}}"
94
+ headers:
95
+ Content-Type:
96
+ - application/json
97
+ response:
98
+ status:
99
+ code: 202
100
+ message: Accepted
101
+ headers:
102
+ Date:
103
+ - Fri, 19 Sep 2014 08:23:17 GMT
104
+ Content-Type:
105
+ - application/json; charset=utf-8
106
+ X-Ua-Compatible:
107
+ - IE=Edge
108
+ Cache-Control:
109
+ - no-cache
110
+ X-Request-Id:
111
+ - ea65aef060dccacdb5b5fbc2628e7ac0
112
+ X-Runtime:
113
+ - '1.769639'
114
+ Set-Cookie:
115
+ - _open-data-certificate_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTljNDMwZjIwOTFhYjVhZTI0NjZiOGI0MjBhNmIxN2I4BjsAVA%3D%3D--35d73bdba91a4439b0f2b0db68985d9768ca6c92;
116
+ path=/; HttpOnly
117
+ Transfer-Encoding:
118
+ - chunked
119
+ body:
120
+ encoding: UTF-8
121
+ string: "{\"success\":\"pending\",\"dataset_id\":2668,\"dataset_url\":\"<BASE_URI>/datasets/2668.json\"}"
122
+ http_version:
123
+ recorded_at: Fri, 19 Sep 2014 08:23:17 GMT
124
+ - request:
125
+ method: get
126
+ uri: http://api%40example.com:<ODC_API_KEY>@open-data-certificate.dev/datasets/2668.json
127
+ body:
128
+ encoding: US-ASCII
129
+ string: ''
130
+ headers:
131
+ Content-Type:
132
+ - application/json
133
+ response:
134
+ status:
135
+ code: 200
136
+ message: OK
137
+ headers:
138
+ Date:
139
+ - Fri, 19 Sep 2014 08:23:17 GMT
140
+ Content-Type:
141
+ - application/json; charset=utf-8
142
+ X-Ua-Compatible:
143
+ - IE=Edge
144
+ Etag:
145
+ - "\"5947bef7f8ffe8bc23e46b69ac6539c0\""
146
+ Cache-Control:
147
+ - max-age=0, private, must-revalidate
148
+ X-Request-Id:
149
+ - 76f955c56ceba5007a0dae1dd9c387bb
150
+ X-Runtime:
151
+ - '0.030530'
152
+ Transfer-Encoding:
153
+ - chunked
154
+ body:
155
+ encoding: UTF-8
156
+ string: "{\"success\":\"pending\",\"dataset_id\":2668,\"dataset_url\":\"<BASE_URI>/datasets/2668.json\"}"
157
+ http_version:
158
+ recorded_at: Fri, 19 Sep 2014 08:23:17 GMT
159
+ - request:
160
+ method: get
161
+ uri: http://api%40example.com:<ODC_API_KEY>@open-data-certificate.dev/datasets/2668.json
162
+ body:
163
+ encoding: US-ASCII
164
+ string: ''
165
+ headers:
166
+ Content-Type:
167
+ - application/json
168
+ response:
169
+ status:
170
+ code: 200
171
+ message: OK
172
+ headers:
173
+ Date:
174
+ - Fri, 19 Sep 2014 08:23:22 GMT
175
+ Content-Type:
176
+ - application/json; charset=utf-8
177
+ X-Ua-Compatible:
178
+ - IE=Edge
179
+ Etag:
180
+ - "\"5947bef7f8ffe8bc23e46b69ac6539c0\""
181
+ Cache-Control:
182
+ - max-age=0, private, must-revalidate
183
+ X-Request-Id:
184
+ - 576c3fae77a579c066b7f43bd0bdd25d
185
+ X-Runtime:
186
+ - '0.027218'
187
+ Transfer-Encoding:
188
+ - chunked
189
+ body:
190
+ encoding: UTF-8
191
+ string: "{\"success\":\"pending\",\"dataset_id\":2668,\"dataset_url\":\"<BASE_URI>/datasets/2668.json\"}"
192
+ http_version:
193
+ recorded_at: Fri, 19 Sep 2014 08:23:22 GMT
194
+ - request:
195
+ method: get
196
+ uri: http://api%40example.com:<ODC_API_KEY>@open-data-certificate.dev/datasets/2668.json
197
+ body:
198
+ encoding: US-ASCII
199
+ string: ''
200
+ headers:
201
+ Content-Type:
202
+ - application/json
203
+ response:
204
+ status:
205
+ code: 200
206
+ message: OK
207
+ headers:
208
+ Date:
209
+ - Fri, 19 Sep 2014 08:23:27 GMT
210
+ Content-Type:
211
+ - application/json; charset=utf-8
212
+ X-Ua-Compatible:
213
+ - IE=Edge
214
+ Etag:
215
+ - "\"5947bef7f8ffe8bc23e46b69ac6539c0\""
216
+ Cache-Control:
217
+ - max-age=0, private, must-revalidate
218
+ X-Request-Id:
219
+ - 32679c0e1408ea0a6376869fc82ba11f
220
+ X-Runtime:
221
+ - '0.029172'
222
+ Transfer-Encoding:
223
+ - chunked
224
+ body:
225
+ encoding: UTF-8
226
+ string: "{\"success\":\"pending\",\"dataset_id\":2668,\"dataset_url\":\"<BASE_URI>/datasets/2668.json\"}"
227
+ http_version:
228
+ recorded_at: Fri, 19 Sep 2014 08:23:27 GMT
229
+ - request:
230
+ method: get
231
+ uri: http://api%40example.com:<ODC_API_KEY>@open-data-certificate.dev/datasets/2668.json
232
+ body:
233
+ encoding: US-ASCII
234
+ string: ''
235
+ headers:
236
+ Content-Type:
237
+ - application/json
238
+ response:
239
+ status:
240
+ code: 200
241
+ message: OK
242
+ headers:
243
+ Date:
244
+ - Fri, 19 Sep 2014 08:23:32 GMT
245
+ Content-Type:
246
+ - application/json; charset=utf-8
247
+ X-Ua-Compatible:
248
+ - IE=Edge
249
+ Etag:
250
+ - "\"5947bef7f8ffe8bc23e46b69ac6539c0\""
251
+ Cache-Control:
252
+ - max-age=0, private, must-revalidate
253
+ X-Request-Id:
254
+ - f9a77f32929c173f092a836410ede4fe
255
+ X-Runtime:
256
+ - '0.032632'
257
+ Transfer-Encoding:
258
+ - chunked
259
+ body:
260
+ encoding: UTF-8
261
+ string: "{\"success\":\"pending\",\"dataset_id\":2668,\"dataset_url\":\"<BASE_URI>/datasets/2668.json\"}"
262
+ http_version:
263
+ recorded_at: Fri, 19 Sep 2014 08:23:32 GMT
264
+ - request:
265
+ method: get
266
+ uri: http://api%40example.com:<ODC_API_KEY>@open-data-certificate.dev/datasets/2668.json
267
+ body:
268
+ encoding: US-ASCII
269
+ string: ''
270
+ headers:
271
+ Content-Type:
272
+ - application/json
273
+ response:
274
+ status:
275
+ code: 200
276
+ message: OK
277
+ headers:
278
+ Date:
279
+ - Fri, 19 Sep 2014 08:23:37 GMT
280
+ Content-Type:
281
+ - application/json; charset=utf-8
282
+ X-Ua-Compatible:
283
+ - IE=Edge
284
+ Etag:
285
+ - "\"5947bef7f8ffe8bc23e46b69ac6539c0\""
286
+ Cache-Control:
287
+ - max-age=0, private, must-revalidate
288
+ X-Request-Id:
289
+ - 5c13edab811f20e7135ec07cf6d2154e
290
+ X-Runtime:
291
+ - '0.037112'
292
+ Transfer-Encoding:
293
+ - chunked
294
+ body:
295
+ encoding: UTF-8
296
+ string: "{\"success\":\"pending\",\"dataset_id\":2668,\"dataset_url\":\"<BASE_URI>/datasets/2668.json\"}"
297
+ http_version:
298
+ recorded_at: Fri, 19 Sep 2014 08:23:37 GMT
299
+ - request:
300
+ method: get
301
+ uri: http://api%40example.com:<ODC_API_KEY>@open-data-certificate.dev/datasets/2668.json
302
+ body:
303
+ encoding: US-ASCII
304
+ string: ''
305
+ headers:
306
+ Content-Type:
307
+ - application/json
308
+ response:
309
+ status:
310
+ code: 200
311
+ message: OK
312
+ headers:
313
+ Date:
314
+ - Fri, 19 Sep 2014 08:23:43 GMT
315
+ Content-Type:
316
+ - application/json; charset=utf-8
317
+ X-Ua-Compatible:
318
+ - IE=Edge
319
+ Etag:
320
+ - "\"9c60b75fe80a3621ff52ed81f36cd442\""
321
+ Cache-Control:
322
+ - max-age=0, private, must-revalidate
323
+ X-Request-Id:
324
+ - 09b5b3b89dc2ba54b66a37055b7bc5db
325
+ X-Runtime:
326
+ - '0.169052'
327
+ Transfer-Encoding:
328
+ - chunked
329
+ body:
330
+ encoding: UTF-8
331
+ string: "{\"success\":true,\"dataset_id\":2668,\"published\":true,\"owner_email\":\"<ODC_USERNAME>\",\"errors\":[\"The
332
+ question 'webpage' is mandatory\",\"The question 'thirdPartyOrigin' is mandatory\",\"The
333
+ question 'thirdPartyOpen' is mandatory\",\"The question 'reference' is mandatory\",\"The
334
+ question 'currentDatasetUrl' is mandatory\",\"The question 'versionsTemplateUrl'
335
+ is mandatory\",\"The question 'crowdsourced' is mandatory\",\"The question
336
+ 'serviceType' is mandatory\",\"The question 'crowdsourcedContent' is mandatory\",\"The
337
+ question 'claUrl' is mandatory\",\"The question 'cldsRecorded' is mandatory\",\"The
338
+ question 'seriesType' is mandatory\",\"The question 'currentDumpUrl' is mandatory\",\"The
339
+ question 'dumpsTemplateUrl' is mandatory\",\"The question 'dumpsUrl' is mandatory\",\"The
340
+ question 'changeFeedUrl' is mandatory\",\"The question 'dataNotApplicable'
341
+ is mandatory\",\"The question 'dataWaiver' is mandatory\",\"The question 'dataOtherWaiver'
342
+ is mandatory\",\"The question 'otherDataLicenceName' is mandatory\",\"The
343
+ question 'otherDataLicenceURL' is mandatory\",\"The question 'otherDataLicenceOpen'
344
+ is mandatory\",\"The question 'contentNotApplicable' is mandatory\",\"The
345
+ question 'contentWaiver' is mandatory\",\"The question 'contentOtherWaiver'
346
+ is mandatory\",\"The question 'account' is mandatory\",\"The question 'otherContentLicenceName'
347
+ is mandatory\",\"The question 'otherContentLicenceURL' is mandatory\",\"The
348
+ question 'otherContentLicenceOpen' is mandatory\",\"The question 'contentRightsURL'
349
+ is mandatory\",\"The question 'engagementTeamUrl' is mandatory\",\"The question
350
+ 'existingExternalUrls' is mandatory\",\"The question 'reliableExternalUrls'
351
+ is mandatory\",\"The question 'appliedAnon' is mandatory\",\"The question
352
+ 'dpStaff' is mandatory\"]}"
353
+ http_version:
354
+ recorded_at: Fri, 19 Sep 2014 08:23:43 GMT
355
+ - request:
356
+ method: get
357
+ uri: http://data.gov.uk/api/2/rest/package/great_britain_tourism_survey
358
+ body:
359
+ encoding: US-ASCII
360
+ string: ''
361
+ headers: {}
362
+ response:
363
+ status:
364
+ code: 200
365
+ message: OK
366
+ headers:
367
+ Server:
368
+ - nginx/1.6.0
369
+ Date:
370
+ - Fri, 19 Sep 2014 08:23:42 GMT
371
+ Content-Type:
372
+ - application/json;charset=utf-8
373
+ Content-Length:
374
+ - '5874'
375
+ Connection:
376
+ - keep-alive
377
+ Vary:
378
+ - Accept-Encoding
379
+ - Cookie
380
+ Pragma:
381
+ - no-cache
382
+ Cache-Control:
383
+ - no-cache
384
+ Access-Control-Allow-Origin:
385
+ - "*"
386
+ Access-Control-Allow-Methods:
387
+ - POST, PUT, GET, DELETE, OPTIONS
388
+ Access-Control-Allow-Headers:
389
+ - X-CKAN-API-KEY, Authorization, Content-Type
390
+ Accept-Ranges:
391
+ - bytes
392
+ X-Varnish:
393
+ - '2133354952'
394
+ Age:
395
+ - '0'
396
+ Via:
397
+ - 1.1 varnish
398
+ X-App:
399
+ - ckan
400
+ X-Varnish-Cache:
401
+ - MISS
402
+ body:
403
+ encoding: UTF-8
404
+ string: "{\"license_title\": \"UK Open Government Licence (OGL)\", \"maintainer\":
405
+ null, \"private\": false, \"maintainer_email\": null, \"id\": \"cae16900-ec34-47cf-adc1-fd8c20930b4f\",
406
+ \"metadata_created\": \"2014-08-11T11:00:05.652163\", \"relationships\": [],
407
+ \"license\": \"UK Open Government Licence (OGL)\", \"metadata_modified\":
408
+ \"2014-09-11T08:40:14.201877\", \"author\": null, \"author_email\": null,
409
+ \"state\": \"active\", \"version\": null, \"creator_user_id\": \"fe27eda4-4fcf-46e5-8818-5fdb2b0a52f9\",
410
+ \"type\": \"dataset\", \"resources\": [{\"resource_group_id\": \"fa88bd2b-405e-4e78-a354-65816609835a\",
411
+ \"cache_last_updated\": null, \"publish-date\": \"2014-08-11\", \"hub-id\":
412
+ \"119-74608\", \"package_id\": \"cae16900-ec34-47cf-adc1-fd8c20930b4f\", \"webstore_last_updated\":
413
+ null, \"id\": \"ad1145d9-f25d-47cd-9611-2156c9d0176c\", \"size\": null, \"last_modified\":
414
+ null, \"hash\": \"\", \"description\": \"Results for Wales - January to March
415
+ 2014\", \"format\": \"\", \"mimetype_inner\": null, \"url_type\": null, \"mimetype\":
416
+ null, \"cache_url\": null, \"name\": null, \"created\": \"2014-08-12T09:40:16.062896\",
417
+ \"url\": \"http://wales.gov.uk/statistics-and-research/great-britain-tourist-survey/?lang=en\",
418
+ \"webstore_url\": null, \"position\": 0, \"resource_type\": null}, {\"resource_group_id\":
419
+ \"fa88bd2b-405e-4e78-a354-65816609835a\", \"cache_last_updated\": null, \"publish-date\":
420
+ \"2014-09-02\", \"hub-id\": \"119-74655\", \"package_id\": \"cae16900-ec34-47cf-adc1-fd8c20930b4f\",
421
+ \"webstore_last_updated\": null, \"id\": \"0b4aab6f-4034-43ec-a596-404ca6831403\",
422
+ \"size\": null, \"last_modified\": null, \"hash\": \"\", \"description\":
423
+ \"Results for Wales - 2013\", \"format\": \"\", \"mimetype_inner\": null,
424
+ \"url_type\": null, \"mimetype\": null, \"cache_url\": null, \"name\": null,
425
+ \"created\": \"2014-09-02T09:40:10.149478\", \"url\": \"http://wales.gov.uk/statistics-and-research/great-britain-tourist-survey/?lang=en\",
426
+ \"webstore_url\": null, \"position\": 1, \"resource_type\": null}, {\"resource_group_id\":
427
+ \"fa88bd2b-405e-4e78-a354-65816609835a\", \"cache_last_updated\": null, \"publish-date\":
428
+ \"2014-09-11\", \"hub-id\": \"119-74883\", \"package_id\": \"cae16900-ec34-47cf-adc1-fd8c20930b4f\",
429
+ \"webstore_last_updated\": null, \"id\": \"f4e4f1cc-8417-4759-9bde-55d23c459bde\",
430
+ \"size\": null, \"last_modified\": null, \"hash\": \"\", \"description\":
431
+ \"Results for Wales - January to April 2014\", \"format\": \"\", \"mimetype_inner\":
432
+ null, \"url_type\": null, \"mimetype\": null, \"cache_url\": null, \"name\":
433
+ null, \"created\": \"2014-09-11T09:40:13.637947\", \"url\": \"http://wales.gov.uk/statistics-and-research/great-britain-tourist-survey/?lang=en\",
434
+ \"webstore_url\": null, \"position\": 2, \"resource_type\": null}, {\"resource_group_id\":
435
+ \"fa88bd2b-405e-4e78-a354-65816609835a\", \"cache_last_updated\": null, \"publish-date\":
436
+ \"2014-09-11\", \"hub-id\": \"119-74885\", \"package_id\": \"cae16900-ec34-47cf-adc1-fd8c20930b4f\",
437
+ \"webstore_last_updated\": null, \"id\": \"1d8f1b99-7cec-4f3d-83c7-de281d1cc4d3\",
438
+ \"size\": null, \"last_modified\": null, \"hash\": \"\", \"description\":
439
+ \"Results for Wales - January to May 2014\", \"format\": \"\", \"mimetype_inner\":
440
+ null, \"url_type\": null, \"mimetype\": null, \"cache_url\": null, \"name\":
441
+ null, \"created\": \"2014-09-11T09:40:14.254250\", \"url\": \"http://wales.gov.uk/statistics-and-research/great-britain-tourist-survey/?lang=en\",
442
+ \"webstore_url\": null, \"position\": 3, \"resource_type\": null}], \"num_resources\":
443
+ 4, \"tags\": [\"holidays-tourism\", \"leisure-and-culture\", \"people-and-places\",
444
+ \"tourism\", \"travel-tourism\"], \"groups\": [], \"license_id\": \"uk-ogl\",
445
+ \"num_tags\": 5, \"organization\": {\"description\": \"\", \"title\": \"Welsh
446
+ Government\", \"created\": \"2012-06-27T14:48:42.634257\", \"approval_status\":
447
+ \"approved\", \"revision_timestamp\": \"2012-06-27T13:48:36.948477\", \"is_organization\":
448
+ true, \"state\": \"active\", \"image_url\": \"\", \"revision_id\": \"a1f4375a-4afe-4dad-88cd-03f2bd6adaaf\",
449
+ \"type\": \"organization\", \"id\": \"25f50b7d-c0e4-4f5a-97f5-4f9baea2eda1\",
450
+ \"name\": \"welsh-government\"}, \"name\": \"great_britain_tourism_survey\",
451
+ \"isopen\": true, \"notes_rendered\": \"<p>The survey is a national consumer
452
+ survey measuring the volume and value of overnight trips taken by residents
453
+ of the Great Britain. It is jointly sponsored by the Welsh Government, VisitEngland
454
+ and VisitScotland. Results of the survey are published annually in the GB
455
+ Tourist, with quarterly updates at a Wales level.\\n</p>\\n<p>Source agency:
456
+ Welsh Government\\n</p>\\n<p>Designation: Official Statistics not designated
457
+ as National Statistics\\n</p>\\n<p>Language: English\\n</p>\\n<p>Alternative
458
+ title: Great Britain Tourism Survey - Results for Wales\\n</p>\", \"url\":
459
+ null, \"ckan_url\": \"http://data.gov.uk/dataset/great_britain_tourism_survey\",
460
+ \"notes\": \"The survey is a national consumer survey measuring the volume
461
+ and value of overnight trips taken by residents of the Great Britain. It is
462
+ jointly sponsored by the Welsh Government, VisitEngland and VisitScotland.
463
+ Results of the survey are published annually in the GB Tourist, with quarterly
464
+ updates at a Wales level.\\n\\nSource agency: Welsh Government\\n\\nDesignation:
465
+ Official Statistics not designated as National Statistics\\n\\nLanguage: English\\n\\nAlternative
466
+ title: Great Britain Tourism Survey - Results for Wales\", \"owner_org\":
467
+ \"25f50b7d-c0e4-4f5a-97f5-4f9baea2eda1\", \"ratings_average\": null, \"extras\":
468
+ {\"geographic_coverage\": \"001000: Wales\", \"themes-secondary\": \"[\\\"Transport\\\"]\",
469
+ \"external_reference\": \"ONSHUB\", \"temporal_coverage-from\": \"\", \"temporal_granularity\":
470
+ \"\", \"date_updated\": \"2014-09-11\", \"series\": \"Great Britain Tourism
471
+ Survey\", \"precision\": \"\", \"geographic_granularity\": \"Country\", \"national_statistic\":
472
+ \"no\", \"import_source\": \"ONS-ons_data_1_days_to_2014-09-11\", \"temporal_coverage-to\":
473
+ \"\", \"update_frequency\": \"quarterly\", \"date_released\": \"2014-08-11\",
474
+ \"categories\": \"People and Places\", \"theme-primary\": \"Society\"}, \"license_url\":
475
+ \"http://www.nationalarchives.gov.uk/doc/open-government-licence/version/2/\",
476
+ \"ratings_count\": 0, \"title\": \"Great Britain Tourism Survey\", \"revision_id\":
477
+ \"57b7de8e-aa52-4bf5-afce-a09de0406817\"}"
478
+ http_version:
479
+ recorded_at: Fri, 19 Sep 2014 08:23:43 GMT
480
+ - request:
481
+ method: post
482
+ uri: http://api%40example.com:<ODC_API_KEY>@open-data-certificate.dev/datasets
483
+ body:
484
+ encoding: UTF-8
485
+ string: "{\"jurisdiction\":\"gb\",\"create_user\":\"true\",\"dataset\":{\"documentationUrl\":\"http://data.gov.uk/dataset/great_britain_tourism_survey\"}}"
486
+ headers:
487
+ Content-Type:
488
+ - application/json
489
+ response:
490
+ status:
491
+ code: 200
492
+ message: OK
493
+ headers:
494
+ Date:
495
+ - Fri, 19 Sep 2014 08:23:43 GMT
496
+ Content-Type:
497
+ - application/json; charset=utf-8
498
+ X-Ua-Compatible:
499
+ - IE=Edge
500
+ Etag:
501
+ - "\"085f003f6b44a84cab4f753cec61bcaf\""
502
+ Cache-Control:
503
+ - max-age=0, private, must-revalidate
504
+ X-Request-Id:
505
+ - 4ce463ab1cc1e49cb4b383690d65402f
506
+ X-Runtime:
507
+ - '0.025960'
508
+ Set-Cookie:
509
+ - _open-data-certificate_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTZkM2ZkODRiYzNhNTcxYzJhMjllN2M0OGM1ZmI4NzkyBjsAVA%3D%3D--6f2e94d98ffc2d98d6894528d81a8ce16c40af6d;
510
+ path=/; HttpOnly
511
+ Transfer-Encoding:
512
+ - chunked
513
+ body:
514
+ encoding: UTF-8
515
+ string: "{\"success\":false,\"errors\":[\"Dataset already exists\"]}"
516
+ http_version:
517
+ recorded_at: Fri, 19 Sep 2014 08:23:43 GMT
518
+ - request:
519
+ method: get
520
+ uri: http://data.gov.uk/api/2/rest/package/childrens_centres_inspections_and_outcomes
521
+ body:
522
+ encoding: US-ASCII
523
+ string: ''
524
+ headers: {}
525
+ response:
526
+ status:
527
+ code: 200
528
+ message: OK
529
+ headers:
530
+ Server:
531
+ - nginx/1.6.0
532
+ Date:
533
+ - Fri, 19 Sep 2014 08:23:43 GMT
534
+ Content-Type:
535
+ - application/json;charset=utf-8
536
+ Content-Length:
537
+ - '7475'
538
+ Connection:
539
+ - keep-alive
540
+ Vary:
541
+ - Accept-Encoding
542
+ - Cookie
543
+ Pragma:
544
+ - no-cache
545
+ Cache-Control:
546
+ - no-cache
547
+ Access-Control-Allow-Origin:
548
+ - "*"
549
+ Access-Control-Allow-Methods:
550
+ - POST, PUT, GET, DELETE, OPTIONS
551
+ Access-Control-Allow-Headers:
552
+ - X-CKAN-API-KEY, Authorization, Content-Type
553
+ Accept-Ranges:
554
+ - bytes
555
+ X-Varnish:
556
+ - '2133354955'
557
+ Age:
558
+ - '0'
559
+ Via:
560
+ - 1.1 varnish
561
+ X-App:
562
+ - ckan
563
+ X-Varnish-Cache:
564
+ - MISS
565
+ body:
566
+ encoding: UTF-8
567
+ string: "{\"license_title\": \"UK Open Government Licence (OGL)\", \"maintainer\":
568
+ null, \"private\": false, \"maintainer_email\": null, \"id\": \"eb9bd647-7366-4fed-8368-4c7df007f95a\",
569
+ \"metadata_created\": \"2011-12-11T12:59:13.758247\", \"relationships\": [],
570
+ \"license\": \"UK Open Government Licence (OGL)\", \"metadata_modified\":
571
+ \"2014-09-11T08:40:14.734765\", \"author\": \"Office for Standards in Education,
572
+ Children's Services and Skills\", \"author_email\": null, \"state\": \"active\",
573
+ \"version\": null, \"creator_user_id\": null, \"type\": \"dataset\", \"resources\":
574
+ [{\"resource_group_id\": \"0ce55e2e-0852-4b7f-a4d6-1c4a8bdc83f9\", \"cache_last_updated\":
575
+ \"2013-06-19T01:07:41.122173\", \"publish-date\": \"2011-03-08\", \"hub-id\":
576
+ \"119-59106\", \"package_id\": \"eb9bd647-7366-4fed-8368-4c7df007f95a\", \"webstore_last_updated\":
577
+ null, \"id\": \"6c28d5cd-b25c-478e-a78d-5c9bc02bbe5b\", \"size\": \"48560\",
578
+ \"cache_filepath\": \"/mnt/shared/ckan_resource_cache/6c/6c28d5cd-b25c-478e-a78d-5c9bc02bbe5b/official-statistics-childrens-centres-inspections-and-outcomes
579
+ published on 8 March 2012\", \"last_modified\": \"2014-05-09T23:10:42.278454\",
580
+ \"hash\": \"55c0817ae72314a379f1b2eca209eb5ab3a2ad70\", \"description\": \"as
581
+ of 31 December 2011\", \"format\": \"\", \"mimetype_inner\": null, \"url_type\":
582
+ null, \"mimetype\": \"text/html\", \"cache_url\": \"http://data.gov.uk/data/resource_cache/6c/6c28d5cd-b25c-478e-a78d-5c9bc02bbe5b/official-statistics-childrens-centres-inspections-and-outcomes
583
+ published on 8 March 2012\", \"name\": null, \"created\": \"2013-03-11T23:25:01.415642\",
584
+ \"url\": \"http://www.ofsted.gov.uk/resources/official-statistics-childrens-centres-inspections-and-outcomes
585
+ published on 8 March 2012\", \"webstore_url\": null, \"position\": 0, \"resource_type\":
586
+ null}, {\"resource_group_id\": \"0ce55e2e-0852-4b7f-a4d6-1c4a8bdc83f9\", \"cache_last_updated\":
587
+ \"2013-06-19T01:07:39.969991\", \"publish-date\": \"2011-09-08\", \"hub-id\":
588
+ \"119-54717\", \"package_id\": \"eb9bd647-7366-4fed-8368-4c7df007f95a\", \"webstore_last_updated\":
589
+ null, \"id\": \"83b86ee6-ad6d-4fc5-8553-be22f2591fb5\", \"size\": \"62150\",
590
+ \"cache_filepath\": \"/mnt/shared/ckan_resource_cache/83/83b86ee6-ad6d-4fc5-8553-be22f2591fb5/official-statistics-childrens-centres-inspections-and-outcomes\",
591
+ \"last_modified\": \"2014-05-09T23:10:43.421132\", \"hash\": \"8ce50a30653bca334a0ac7f7495c3844307714e0\",
592
+ \"description\": \"as of 30 June 2011\", \"format\": \"\", \"mimetype_inner\":
593
+ null, \"url_type\": null, \"mimetype\": \"text/html\", \"cache_url\": \"http://data.gov.uk/data/resource_cache/83/83b86ee6-ad6d-4fc5-8553-be22f2591fb5/official-statistics-childrens-centres-inspections-and-outcomes\",
594
+ \"name\": null, \"created\": \"2013-03-12T01:40:40.786760\", \"url\": \"http://www.ofsted.gov.uk/resources/official-statistics-childrens-centres-inspections-and-outcomes\",
595
+ \"webstore_url\": null, \"position\": 1, \"resource_type\": null}, {\"resource_group_id\":
596
+ \"0ce55e2e-0852-4b7f-a4d6-1c4a8bdc83f9\", \"cache_last_updated\": null, \"publish-date\":
597
+ \"2014-06-05\", \"hub-id\": \"119-73470\", \"package_id\": \"eb9bd647-7366-4fed-8368-4c7df007f95a\",
598
+ \"webstore_last_updated\": null, \"id\": \"875bd509-10f0-47ee-ab3c-8783e84dd8fb\",
599
+ \"size\": null, \"last_modified\": null, \"hash\": \"\", \"description\":
600
+ \"November 2013 to March 2014\", \"format\": \"\", \"mimetype_inner\": null,
601
+ \"url_type\": null, \"mimetype\": null, \"cache_url\": null, \"name\": null,
602
+ \"created\": \"2014-06-05T09:40:09.472861\", \"url\": \"http://www.ofsted.gov.uk/resources/official-statistics-childrens-centres-inspections-and-outcomes\",
603
+ \"webstore_url\": null, \"position\": 2, \"resource_type\": null}, {\"resource_group_id\":
604
+ \"0ce55e2e-0852-4b7f-a4d6-1c4a8bdc83f9\", \"cache_last_updated\": null, \"publish-date\":
605
+ \"2014-09-11\", \"hub-id\": \"119-73474\", \"package_id\": \"eb9bd647-7366-4fed-8368-4c7df007f95a\",
606
+ \"webstore_last_updated\": null, \"id\": \"cdd13cea-8cc8-42e8-a7b7-01d970051c2c\",
607
+ \"size\": null, \"last_modified\": null, \"hash\": \"\", \"description\":
608
+ \"April to June 2014\", \"format\": \"\", \"mimetype_inner\": null, \"url_type\":
609
+ null, \"mimetype\": null, \"cache_url\": null, \"name\": null, \"created\":
610
+ \"2014-09-11T09:40:14.776896\", \"url\": \"http://www.ofsted.gov.uk/resources/official-statistics-childrens-centres-inspections-and-outcomes\",
611
+ \"webstore_url\": null, \"position\": 3, \"resource_type\": null}], \"num_resources\":
612
+ 4, \"tags\": [\"child\", \"children\", \"children-education-and-skills\",
613
+ \"education\", \"ofsted\", \"statistical-analysis\"], \"groups\": [], \"license_id\":
614
+ \"uk-ogl\", \"num_tags\": 6, \"organization\": {\"description\": \"The Office
615
+ for Standards in Education, Children\\u2019s Services and Skills (Ofsted)
616
+ regulates and inspects childcare and children\\u2019s social care. It also
617
+ inspects schools, colleges, initial teacher education, work-based learning
618
+ and skills training, adult and community learning, education and training
619
+ in prisons and other secure establishments, and the Children and Family Court
620
+ Advisory Support Service (Cafcass). Additionally, Ofsted assesses children\\u2019s
621
+ services in local areas, and inspects services for looked-after children,
622
+ safeguarding and child protection.\\r\\nOfsted is a non-ministerial department
623
+ of the Department for Education\\r\\n\\r\\nhttp://www.ofsted.gov.uk/\", \"title\":
624
+ \"Office for Standards in Education, Children's Services and Skills\", \"created\":
625
+ \"2012-06-27T14:48:58.670706\", \"approval_status\": \"pending\", \"revision_timestamp\":
626
+ \"2013-11-04T07:43:04.296944\", \"is_organization\": true, \"state\": \"active\",
627
+ \"image_url\": \"\", \"revision_id\": \"5c230c75-b0c7-4416-84f3-ec835944960a\",
628
+ \"type\": \"organization\", \"id\": \"03e5767e-ce67-45f4-84ea-1e34f97a80a2\",
629
+ \"name\": \"office-for-standards-in-education-childrens-services-and-skills\"},
630
+ \"name\": \"childrens_centres_inspections_and_outcomes\", \"isopen\": true,
631
+ \"notes_rendered\": \"<p>This is the publication of 'Children's centres inspections
632
+ and outcomes'\\n</p>\\n<p>Source agency: Office for Standards in Education,
633
+ Children's Services and Skills\\n</p>\\n<p>Designation: Official Statistics
634
+ not designated as National Statistics\\n</p>\\n<p>Language: English\\n</p>\\n<p>Alternative
635
+ title: Children's centres inspections and outcomes\\n</p>\", \"url\": null,
636
+ \"ckan_url\": \"http://data.gov.uk/dataset/childrens_centres_inspections_and_outcomes\",
637
+ \"notes\": \"This is the publication of 'Children's centres inspections and
638
+ outcomes'\\n\\nSource agency: Office for Standards in Education, Children's
639
+ Services and Skills\\n\\nDesignation: Official Statistics not designated as
640
+ National Statistics\\n\\nLanguage: English\\n\\nAlternative title: Children's
641
+ centres inspections and outcomes\", \"owner_org\": \"03e5767e-ce67-45f4-84ea-1e34f97a80a2\",
642
+ \"ratings_average\": null, \"extras\": {\"geographic_coverage\": \"111100:
643
+ United Kingdom (England, Scotland, Wales, Northern Ireland)\", \"geographical_granularity\":
644
+ \"Other\", \"external_reference\": \"ONSHUB\", \"last_major_modification\":
645
+ \"2013-03-12T01:40:40.749632\", \"temporal_coverage-from\": \"\", \"date_updated\":
646
+ \"2014-09-11\", \"series\": \"Children's centres inspections and outcomes\",
647
+ \"published_via\": \"\", \"temporal_granularity\": \"\", \"precision\": \"\",
648
+ \"geographic_granularity\": \"Other\", \"theme-secondary\": \"[\\\"Education\\\"]\",
649
+ \"published_by\": \"Office for Standards in Education, Children's Services
650
+ and Skills [11547]\", \"national_statistic\": \"no\", \"import_source\": \"ONS-ons_data_1_days_to_2014-09-11\",
651
+ \"temporal_coverage-to\": \"\", \"update_frequency\": \"\", \"date_released\":
652
+ \"2011-03-08\", \"categories\": \"Children, Education and Skills\", \"theme-primary\":
653
+ \"Society\"}, \"license_url\": \"http://www.nationalarchives.gov.uk/doc/open-government-licence/version/2/\",
654
+ \"ratings_count\": 0, \"title\": \"Children's centres inspections and outcomes\",
655
+ \"revision_id\": \"9440a542-6245-4011-8660-fa7d6161cdb3\"}"
656
+ http_version:
657
+ recorded_at: Fri, 19 Sep 2014 08:23:43 GMT
658
+ - request:
659
+ method: post
660
+ uri: http://api%40example.com:<ODC_API_KEY>@open-data-certificate.dev/datasets
661
+ body:
662
+ encoding: UTF-8
663
+ string: "{\"jurisdiction\":\"gb\",\"create_user\":\"true\",\"dataset\":{\"documentationUrl\":\"http://data.gov.uk/dataset/childrens_centres_inspections_and_outcomes\"}}"
664
+ headers:
665
+ Content-Type:
666
+ - application/json
667
+ response:
668
+ status:
669
+ code: 200
670
+ message: OK
671
+ headers:
672
+ Date:
673
+ - Fri, 19 Sep 2014 08:23:43 GMT
674
+ Content-Type:
675
+ - application/json; charset=utf-8
676
+ X-Ua-Compatible:
677
+ - IE=Edge
678
+ Etag:
679
+ - "\"085f003f6b44a84cab4f753cec61bcaf\""
680
+ Cache-Control:
681
+ - max-age=0, private, must-revalidate
682
+ X-Request-Id:
683
+ - 168e35a690d25bd23326ac77ec0755fa
684
+ X-Runtime:
685
+ - '0.027207'
686
+ Set-Cookie:
687
+ - _open-data-certificate_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTZjODE0NmIyZjhiMWM0ZTFiZWFkMjRkZDU5N2Q0YjAyBjsAVA%3D%3D--1d24efd1104353546142c22ab00a3d6668e517fa;
688
+ path=/; HttpOnly
689
+ Transfer-Encoding:
690
+ - chunked
691
+ body:
692
+ encoding: UTF-8
693
+ string: "{\"success\":false,\"errors\":[\"Dataset already exists\"]}"
694
+ http_version:
695
+ recorded_at: Fri, 19 Sep 2014 08:23:43 GMT
696
+ recorded_with: VCR 2.9.3