contentful-importer 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +38 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +8 -0
  5. data/CHANGELOG.md +4 -0
  6. data/Gemfile +7 -0
  7. data/Gemfile.lock +87 -0
  8. data/LICENSE +22 -0
  9. data/README.md +327 -0
  10. data/Rakefile +7 -0
  11. data/bin/contentful-importer +85 -0
  12. data/contentful_importer.gemspec +38 -0
  13. data/example_settings/contentful_model.json +288 -0
  14. data/example_settings/contentful_structure.json +78 -0
  15. data/example_settings/files_meaning.txt +15 -0
  16. data/example_settings/settings.yml +16 -0
  17. data/lib/cli.rb +13 -0
  18. data/lib/configuration.rb +36 -0
  19. data/lib/converters/content_types_structure_creator.rb +60 -0
  20. data/lib/converters/contentful_model_to_json.rb +109 -0
  21. data/lib/importer/data_organizer.rb +117 -0
  22. data/lib/importer/mime_content_type.rb +564 -0
  23. data/lib/importer/parallel_importer.rb +429 -0
  24. data/lib/json_schema_validator.rb +64 -0
  25. data/lib/migrator.rb +39 -0
  26. data/lib/version.rb +3 -0
  27. data/spec/fixtures/import_files/assets/image/image_1.json +9 -0
  28. data/spec/fixtures/import_files/assets/image/image_2.json +9 -0
  29. data/spec/fixtures/import_files/assets/image/image_3.json +9 -0
  30. data/spec/fixtures/import_files/assets/image/image_4.json +9 -0
  31. data/spec/fixtures/import_files/collections/job_skills.json +13 -0
  32. data/spec/fixtures/import_files/collections/jobs.json +37 -0
  33. data/spec/fixtures/import_files/collections/profile.json +19 -0
  34. data/spec/fixtures/import_files/collections/user.json +36 -0
  35. data/spec/fixtures/import_files/entries/job_skills/job_skills_1.json +7 -0
  36. data/spec/fixtures/import_files/entries/job_skills/job_skills_10.json +7 -0
  37. data/spec/fixtures/import_files/entries/job_skills/job_skills_2.json +7 -0
  38. data/spec/fixtures/import_files/entries/job_skills/job_skills_3.json +7 -0
  39. data/spec/fixtures/import_files/entries/job_skills/job_skills_4.json +7 -0
  40. data/spec/fixtures/import_files/entries/job_skills/job_skills_5.json +7 -0
  41. data/spec/fixtures/import_files/entries/job_skills/job_skills_6.json +7 -0
  42. data/spec/fixtures/import_files/entries/job_skills/job_skills_7.json +7 -0
  43. data/spec/fixtures/import_files/entries/job_skills/job_skills_8.json +7 -0
  44. data/spec/fixtures/import_files/entries/job_skills/job_skills_9.json +7 -0
  45. data/spec/fixtures/import_files/entries/jobs/jobs_1.json +56 -0
  46. data/spec/fixtures/import_files/entries/jobs/jobs_2.json +55 -0
  47. data/spec/fixtures/import_files/entries/jobs/jobs_4.json +49 -0
  48. data/spec/fixtures/import_files/entries/profile/profile_1.json +12 -0
  49. data/spec/fixtures/import_files/entries/profile/profile_2.json +12 -0
  50. data/spec/fixtures/import_files/entries/user/user_1.json +24 -0
  51. data/spec/fixtures/import_files/entries/user/user_2.json +20 -0
  52. data/spec/fixtures/import_files/logs/log_published_assets.csv +4 -0
  53. data/spec/fixtures/import_files/logs/log_published_entries.csv +23 -0
  54. data/spec/fixtures/import_files/logs/success_assets.csv +4 -0
  55. data/spec/fixtures/import_files/logs/success_published_assets.csv +0 -0
  56. data/spec/fixtures/import_files/logs/success_published_entries.csv +22 -0
  57. data/spec/fixtures/import_files/logs/success_thread_0.csv +12 -0
  58. data/spec/fixtures/import_files/logs/success_thread_1.csv +11 -0
  59. data/spec/fixtures/import_files/threads/0/1TVvxCqoRq0qUYAOQuOqys_2.json +20 -0
  60. data/spec/fixtures/import_files/threads/0/2soCP557HGKoOOK0SqmMOm_1.json +7 -0
  61. data/spec/fixtures/import_files/threads/0/2soCP557HGKoOOK0SqmMOm_10.json +7 -0
  62. data/spec/fixtures/import_files/threads/0/2soCP557HGKoOOK0SqmMOm_2.json +7 -0
  63. data/spec/fixtures/import_files/threads/0/2soCP557HGKoOOK0SqmMOm_3.json +7 -0
  64. data/spec/fixtures/import_files/threads/0/2soCP557HGKoOOK0SqmMOm_4.json +7 -0
  65. data/spec/fixtures/import_files/threads/0/2soCP557HGKoOOK0SqmMOm_5.json +7 -0
  66. data/spec/fixtures/import_files/threads/0/2soCP557HGKoOOK0SqmMOm_6.json +7 -0
  67. data/spec/fixtures/import_files/threads/0/2soCP557HGKoOOK0SqmMOm_7.json +7 -0
  68. data/spec/fixtures/import_files/threads/0/6H6pGAV1PUsuoAW26Iu48W_1.json +9 -0
  69. data/spec/fixtures/import_files/threads/0/6H6pGAV1PUsuoAW26Iu48W_2.json +9 -0
  70. data/spec/fixtures/import_files/threads/0/6H6pGAV1PUsuoAW26Iu48W_3.json +9 -0
  71. data/spec/fixtures/import_files/threads/0/6H6pGAV1PUsuoAW26Iu48W_4.json +9 -0
  72. data/spec/fixtures/import_files/threads/0/6H6pGAV1PUsuoAW26Iu48W_5.json +9 -0
  73. data/spec/fixtures/import_files/threads/1/1TVvxCqoRq0qUYAOQuOqys_1.json +24 -0
  74. data/spec/fixtures/import_files/threads/1/1TVvxCqoRq0qUYAOQuOqys_2.json +20 -0
  75. data/spec/fixtures/import_files/threads/1/2soCP557HGKoOOK0SqmMOm_6.json +7 -0
  76. data/spec/fixtures/import_files/threads/1/2soCP557HGKoOOK0SqmMOm_7.json +7 -0
  77. data/spec/fixtures/import_files/threads/1/2soCP557HGKoOOK0SqmMOm_8.json +7 -0
  78. data/spec/fixtures/import_files/threads/1/2soCP557HGKoOOK0SqmMOm_9.json +7 -0
  79. data/spec/fixtures/import_files/threads/1/4L1bg4WQ5aWQMiE82ouag_1.json +56 -0
  80. data/spec/fixtures/import_files/threads/1/4L1bg4WQ5aWQMiE82ouag_2.json +55 -0
  81. data/spec/fixtures/import_files/threads/1/4L1bg4WQ5aWQMiE82ouag_4.json +49 -0
  82. data/spec/fixtures/import_files/threads/1/4WFZh4MwC4Mc0EQWAeOY8A_1.json +12 -0
  83. data/spec/fixtures/import_files/threads/1/4WFZh4MwC4Mc0EQWAeOY8A_2.json +12 -0
  84. data/spec/fixtures/import_files/threads/assets/0/image_1.json +9 -0
  85. data/spec/fixtures/import_files/threads/assets/0/image_2.json +9 -0
  86. data/spec/fixtures/import_files/threads/assets/0/image_3.json +9 -0
  87. data/spec/fixtures/import_files/threads/assets/0/image_4.json +9 -0
  88. data/spec/fixtures/settings/contentful_model.json +252 -0
  89. data/spec/fixtures/settings/contentful_structure.json +73 -0
  90. data/spec/fixtures/settings/contentful_structure_test.json +66 -0
  91. data/spec/fixtures/settings/settings.yml +12 -0
  92. data/spec/fixtures/vcr_cassettes/create_asset.yml +621 -0
  93. data/spec/fixtures/vcr_cassettes/create_entry.yml +122 -0
  94. data/spec/fixtures/vcr_cassettes/create_space.yml +87 -0
  95. data/spec/fixtures/vcr_cassettes/import_assets.yml +2822 -0
  96. data/spec/fixtures/vcr_cassettes/import_content_types.yml +1915 -0
  97. data/spec/fixtures/vcr_cassettes/import_entries.yml +5066 -0
  98. data/spec/fixtures/vcr_cassettes/import_entry.yml +363 -0
  99. data/spec/fixtures/vcr_cassettes/invalid_credentials.yml +69 -0
  100. data/spec/fixtures/vcr_cassettes/publish_an_entry.yml +214 -0
  101. data/spec/fixtures/vcr_cassettes/publish_asset.yml +895 -0
  102. data/spec/fixtures/vcr_cassettes/publish_entries.yml +5121 -0
  103. data/spec/fixtures/vcr_cassettes/valid_credentials.yml +7360 -0
  104. data/spec/lib/configuration_spec.rb +22 -0
  105. data/spec/lib/importer/parallel_importer_spec.rb +161 -0
  106. data/spec/lib/json_schema_validator_spec.rb +63 -0
  107. data/spec/lib/migrator_spec.rb +99 -0
  108. data/spec/spec_helper.rb +12 -0
  109. data/spec/support/db_rows_json.rb +9 -0
  110. data/spec/support/shared_configuration.rb +22 -0
  111. data/spec/support/vcr.rb +16 -0
  112. metadata +436 -0
@@ -0,0 +1,895 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/spaces/ip17s12q0ek4/assets/image_1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - RubyContentfulManagementGem/0.5.0
12
+ Authorization:
13
+ - Bearer <ACCESS_TOKEN>
14
+ Content-Type:
15
+ - application/vnd.contentful.management.v1+json
16
+ Content-Length:
17
+ - '0'
18
+ Host:
19
+ - api.contentful.com
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Access-Control-Allow-Headers:
26
+ - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation
27
+ Access-Control-Allow-Methods:
28
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
29
+ Access-Control-Allow-Origin:
30
+ - "*"
31
+ Access-Control-Expose-Headers:
32
+ - Etag
33
+ Access-Control-Max-Age:
34
+ - '1728000'
35
+ Cf-Space-Id:
36
+ - ip17s12q0ek4
37
+ Content-Type:
38
+ - application/vnd.contentful.management.v1+json
39
+ Date:
40
+ - Sun, 04 Jan 2015 19:12:32 GMT
41
+ Etag:
42
+ - '"f3514ae2cde021bca83baa82ae2cec76"'
43
+ Server:
44
+ - nginx
45
+ X-Powered-By:
46
+ - Express
47
+ Content-Length:
48
+ - '1045'
49
+ Connection:
50
+ - keep-alive
51
+ body:
52
+ encoding: UTF-8
53
+ string: |
54
+ {
55
+ "fields": {
56
+ "title": {
57
+ "en-US": "Image 1"
58
+ },
59
+ "description": {
60
+ "en-US": ""
61
+ },
62
+ "file": {
63
+ "en-US": {
64
+ "contentType": "image/jpeg",
65
+ "fileName": "Image 1",
66
+ "details": {
67
+ "image": {
68
+ "width": 300,
69
+ "height": 169
70
+ },
71
+ "size": 10441
72
+ },
73
+ "url": "//images.contentful.com/ip17s12q0ek4/image_1/4bfcde0a6b60683539d78d7fa782a6e9/Image_1"
74
+ }
75
+ }
76
+ },
77
+ "sys": {
78
+ "id": "image_1",
79
+ "type": "Asset",
80
+ "createdAt": "2015-01-04T19:11:09.787Z",
81
+ "createdBy": {
82
+ "sys": {
83
+ "type": "Link",
84
+ "linkType": "User",
85
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
86
+ }
87
+ },
88
+ "space": {
89
+ "sys": {
90
+ "type": "Link",
91
+ "linkType": "Space",
92
+ "id": "ip17s12q0ek4"
93
+ }
94
+ },
95
+ "version": 2,
96
+ "updatedAt": "2015-01-04T19:11:11.920Z",
97
+ "updatedBy": {
98
+ "sys": {
99
+ "type": "Link",
100
+ "linkType": "User",
101
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
102
+ }
103
+ }
104
+ }
105
+ }
106
+ http_version:
107
+ recorded_at: Sun, 04 Jan 2015 19:12:32 GMT
108
+ - request:
109
+ method: put
110
+ uri: https://api.contentful.com/spaces/ip17s12q0ek4/assets/image_1/published
111
+ body:
112
+ encoding: US-ASCII
113
+ string: ''
114
+ headers:
115
+ User-Agent:
116
+ - RubyContentfulManagementGem/0.5.0
117
+ Authorization:
118
+ - Bearer <ACCESS_TOKEN>
119
+ Content-Type:
120
+ - application/vnd.contentful.management.v1+json
121
+ X-Contentful-Version:
122
+ - '2'
123
+ Content-Length:
124
+ - '0'
125
+ Host:
126
+ - api.contentful.com
127
+ response:
128
+ status:
129
+ code: 200
130
+ message: OK
131
+ headers:
132
+ Access-Control-Allow-Headers:
133
+ - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation
134
+ Access-Control-Allow-Methods:
135
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
136
+ Access-Control-Allow-Origin:
137
+ - "*"
138
+ Access-Control-Expose-Headers:
139
+ - Etag
140
+ Access-Control-Max-Age:
141
+ - '1728000'
142
+ Cf-Space-Id:
143
+ - ip17s12q0ek4
144
+ Content-Type:
145
+ - application/vnd.contentful.management.v1+json
146
+ Date:
147
+ - Sun, 04 Jan 2015 19:12:33 GMT
148
+ Etag:
149
+ - '"b7e3a1174b1b05b5d0fa77cd7a08558f"'
150
+ Server:
151
+ - nginx
152
+ X-Powered-By:
153
+ - Express
154
+ Content-Length:
155
+ - '1340'
156
+ Connection:
157
+ - keep-alive
158
+ body:
159
+ encoding: UTF-8
160
+ string: |
161
+ {
162
+ "fields": {
163
+ "title": {
164
+ "en-US": "Image 1"
165
+ },
166
+ "description": {
167
+ "en-US": ""
168
+ },
169
+ "file": {
170
+ "en-US": {
171
+ "contentType": "image/jpeg",
172
+ "fileName": "Image 1",
173
+ "details": {
174
+ "image": {
175
+ "width": 300,
176
+ "height": 169
177
+ },
178
+ "size": 10441
179
+ },
180
+ "url": "//images.contentful.com/ip17s12q0ek4/image_1/4bfcde0a6b60683539d78d7fa782a6e9/Image_1"
181
+ }
182
+ }
183
+ },
184
+ "sys": {
185
+ "id": "image_1",
186
+ "type": "Asset",
187
+ "createdAt": "2015-01-04T19:11:09.787Z",
188
+ "createdBy": {
189
+ "sys": {
190
+ "type": "Link",
191
+ "linkType": "User",
192
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
193
+ }
194
+ },
195
+ "space": {
196
+ "sys": {
197
+ "type": "Link",
198
+ "linkType": "Space",
199
+ "id": "ip17s12q0ek4"
200
+ }
201
+ },
202
+ "version": 3,
203
+ "updatedAt": "2015-01-04T19:12:33.126Z",
204
+ "updatedBy": {
205
+ "sys": {
206
+ "type": "Link",
207
+ "linkType": "User",
208
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
209
+ }
210
+ },
211
+ "firstPublishedAt": "2015-01-04T19:12:33.126Z",
212
+ "publishedCounter": 1,
213
+ "publishedAt": "2015-01-04T19:12:33.126Z",
214
+ "publishedBy": {
215
+ "sys": {
216
+ "type": "Link",
217
+ "linkType": "User",
218
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
219
+ }
220
+ },
221
+ "publishedVersion": 2
222
+ }
223
+ }
224
+ http_version:
225
+ recorded_at: Sun, 04 Jan 2015 19:12:33 GMT
226
+ - request:
227
+ method: get
228
+ uri: https://api.contentful.com/spaces/ip17s12q0ek4/assets/image_2
229
+ body:
230
+ encoding: US-ASCII
231
+ string: ''
232
+ headers:
233
+ User-Agent:
234
+ - RubyContentfulManagementGem/0.5.0
235
+ Authorization:
236
+ - Bearer <ACCESS_TOKEN>
237
+ Content-Type:
238
+ - application/vnd.contentful.management.v1+json
239
+ Content-Length:
240
+ - '0'
241
+ Host:
242
+ - api.contentful.com
243
+ response:
244
+ status:
245
+ code: 200
246
+ message: OK
247
+ headers:
248
+ Access-Control-Allow-Headers:
249
+ - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation
250
+ Access-Control-Allow-Methods:
251
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
252
+ Access-Control-Allow-Origin:
253
+ - "*"
254
+ Access-Control-Expose-Headers:
255
+ - Etag
256
+ Access-Control-Max-Age:
257
+ - '1728000'
258
+ Cf-Space-Id:
259
+ - ip17s12q0ek4
260
+ Content-Type:
261
+ - application/vnd.contentful.management.v1+json
262
+ Date:
263
+ - Sun, 04 Jan 2015 19:12:34 GMT
264
+ Etag:
265
+ - '"f22634bd9f35cea7288c9a36db92724f"'
266
+ Server:
267
+ - nginx
268
+ X-Powered-By:
269
+ - Express
270
+ Content-Length:
271
+ - '1073'
272
+ Connection:
273
+ - keep-alive
274
+ body:
275
+ encoding: UTF-8
276
+ string: |
277
+ {
278
+ "fields": {
279
+ "title": {
280
+ "en-US": "Image 2 - water"
281
+ },
282
+ "description": {
283
+ "en-US": ""
284
+ },
285
+ "file": {
286
+ "en-US": {
287
+ "contentType": "image/jpeg",
288
+ "fileName": "Image 2 - water",
289
+ "details": {
290
+ "image": {
291
+ "width": 3872,
292
+ "height": 2020
293
+ },
294
+ "size": 2720076
295
+ },
296
+ "url": "//images.contentful.com/ip17s12q0ek4/image_2/2be7dbd7993e0d00280d3edd957ec180/Image_2_-_water"
297
+ }
298
+ }
299
+ },
300
+ "sys": {
301
+ "id": "image_2",
302
+ "type": "Asset",
303
+ "createdAt": "2015-01-04T19:11:12.607Z",
304
+ "createdBy": {
305
+ "sys": {
306
+ "type": "Link",
307
+ "linkType": "User",
308
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
309
+ }
310
+ },
311
+ "space": {
312
+ "sys": {
313
+ "type": "Link",
314
+ "linkType": "Space",
315
+ "id": "ip17s12q0ek4"
316
+ }
317
+ },
318
+ "version": 2,
319
+ "updatedAt": "2015-01-04T19:11:13.981Z",
320
+ "updatedBy": {
321
+ "sys": {
322
+ "type": "Link",
323
+ "linkType": "User",
324
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
325
+ }
326
+ }
327
+ }
328
+ }
329
+ http_version:
330
+ recorded_at: Sun, 04 Jan 2015 19:12:34 GMT
331
+ - request:
332
+ method: put
333
+ uri: https://api.contentful.com/spaces/ip17s12q0ek4/assets/image_2/published
334
+ body:
335
+ encoding: US-ASCII
336
+ string: ''
337
+ headers:
338
+ User-Agent:
339
+ - RubyContentfulManagementGem/0.5.0
340
+ Authorization:
341
+ - Bearer <ACCESS_TOKEN>
342
+ Content-Type:
343
+ - application/vnd.contentful.management.v1+json
344
+ X-Contentful-Version:
345
+ - '2'
346
+ Content-Length:
347
+ - '0'
348
+ Host:
349
+ - api.contentful.com
350
+ response:
351
+ status:
352
+ code: 200
353
+ message: OK
354
+ headers:
355
+ Access-Control-Allow-Headers:
356
+ - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation
357
+ Access-Control-Allow-Methods:
358
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
359
+ Access-Control-Allow-Origin:
360
+ - "*"
361
+ Access-Control-Expose-Headers:
362
+ - Etag
363
+ Access-Control-Max-Age:
364
+ - '1728000'
365
+ Cf-Space-Id:
366
+ - ip17s12q0ek4
367
+ Content-Type:
368
+ - application/vnd.contentful.management.v1+json
369
+ Date:
370
+ - Sun, 04 Jan 2015 19:12:34 GMT
371
+ Etag:
372
+ - '"6ed3abd62fa5e78ad2b1e8d922ab20a7"'
373
+ Server:
374
+ - nginx
375
+ X-Powered-By:
376
+ - Express
377
+ Content-Length:
378
+ - '1368'
379
+ Connection:
380
+ - keep-alive
381
+ body:
382
+ encoding: UTF-8
383
+ string: |
384
+ {
385
+ "fields": {
386
+ "title": {
387
+ "en-US": "Image 2 - water"
388
+ },
389
+ "description": {
390
+ "en-US": ""
391
+ },
392
+ "file": {
393
+ "en-US": {
394
+ "contentType": "image/jpeg",
395
+ "fileName": "Image 2 - water",
396
+ "details": {
397
+ "image": {
398
+ "width": 3872,
399
+ "height": 2020
400
+ },
401
+ "size": 2720076
402
+ },
403
+ "url": "//images.contentful.com/ip17s12q0ek4/image_2/2be7dbd7993e0d00280d3edd957ec180/Image_2_-_water"
404
+ }
405
+ }
406
+ },
407
+ "sys": {
408
+ "id": "image_2",
409
+ "type": "Asset",
410
+ "createdAt": "2015-01-04T19:11:12.607Z",
411
+ "createdBy": {
412
+ "sys": {
413
+ "type": "Link",
414
+ "linkType": "User",
415
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
416
+ }
417
+ },
418
+ "space": {
419
+ "sys": {
420
+ "type": "Link",
421
+ "linkType": "Space",
422
+ "id": "ip17s12q0ek4"
423
+ }
424
+ },
425
+ "version": 3,
426
+ "updatedAt": "2015-01-04T19:12:34.782Z",
427
+ "updatedBy": {
428
+ "sys": {
429
+ "type": "Link",
430
+ "linkType": "User",
431
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
432
+ }
433
+ },
434
+ "firstPublishedAt": "2015-01-04T19:12:34.782Z",
435
+ "publishedCounter": 1,
436
+ "publishedAt": "2015-01-04T19:12:34.782Z",
437
+ "publishedBy": {
438
+ "sys": {
439
+ "type": "Link",
440
+ "linkType": "User",
441
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
442
+ }
443
+ },
444
+ "publishedVersion": 2
445
+ }
446
+ }
447
+ http_version:
448
+ recorded_at: Sun, 04 Jan 2015 19:12:35 GMT
449
+ - request:
450
+ method: get
451
+ uri: https://api.contentful.com/spaces/ip17s12q0ek4/assets/image_3
452
+ body:
453
+ encoding: US-ASCII
454
+ string: ''
455
+ headers:
456
+ User-Agent:
457
+ - RubyContentfulManagementGem/0.5.0
458
+ Authorization:
459
+ - Bearer <ACCESS_TOKEN>
460
+ Content-Type:
461
+ - application/vnd.contentful.management.v1+json
462
+ Content-Length:
463
+ - '0'
464
+ Host:
465
+ - api.contentful.com
466
+ response:
467
+ status:
468
+ code: 200
469
+ message: OK
470
+ headers:
471
+ Access-Control-Allow-Headers:
472
+ - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation
473
+ Access-Control-Allow-Methods:
474
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
475
+ Access-Control-Allow-Origin:
476
+ - "*"
477
+ Access-Control-Expose-Headers:
478
+ - Etag
479
+ Access-Control-Max-Age:
480
+ - '1728000'
481
+ Cf-Space-Id:
482
+ - ip17s12q0ek4
483
+ Content-Type:
484
+ - application/vnd.contentful.management.v1+json
485
+ Date:
486
+ - Sun, 04 Jan 2015 19:12:35 GMT
487
+ Etag:
488
+ - '"31f7364435a2f01f73e63cea8f16744d"'
489
+ Server:
490
+ - nginx
491
+ X-Powered-By:
492
+ - Express
493
+ Content-Length:
494
+ - '1065'
495
+ Connection:
496
+ - keep-alive
497
+ body:
498
+ encoding: UTF-8
499
+ string: |
500
+ {
501
+ "fields": {
502
+ "title": {
503
+ "en-US": "Ruby on rails"
504
+ },
505
+ "description": {
506
+ "en-US": ""
507
+ },
508
+ "file": {
509
+ "en-US": {
510
+ "contentType": "image/jpeg",
511
+ "fileName": "Ruby on rails",
512
+ "details": {
513
+ "image": {
514
+ "width": 1440,
515
+ "height": 900
516
+ },
517
+ "size": 241504
518
+ },
519
+ "url": "//images.contentful.com/ip17s12q0ek4/image_3/4bd7283f971230f30c7146428b53c457/Ruby_on_rails"
520
+ }
521
+ }
522
+ },
523
+ "sys": {
524
+ "id": "image_3",
525
+ "type": "Asset",
526
+ "createdAt": "2015-01-04T19:11:15.391Z",
527
+ "createdBy": {
528
+ "sys": {
529
+ "type": "Link",
530
+ "linkType": "User",
531
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
532
+ }
533
+ },
534
+ "space": {
535
+ "sys": {
536
+ "type": "Link",
537
+ "linkType": "Space",
538
+ "id": "ip17s12q0ek4"
539
+ }
540
+ },
541
+ "version": 2,
542
+ "updatedAt": "2015-01-04T19:11:16.459Z",
543
+ "updatedBy": {
544
+ "sys": {
545
+ "type": "Link",
546
+ "linkType": "User",
547
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
548
+ }
549
+ }
550
+ }
551
+ }
552
+ http_version:
553
+ recorded_at: Sun, 04 Jan 2015 19:12:35 GMT
554
+ - request:
555
+ method: put
556
+ uri: https://api.contentful.com/spaces/ip17s12q0ek4/assets/image_3/published
557
+ body:
558
+ encoding: US-ASCII
559
+ string: ''
560
+ headers:
561
+ User-Agent:
562
+ - RubyContentfulManagementGem/0.5.0
563
+ Authorization:
564
+ - Bearer <ACCESS_TOKEN>
565
+ Content-Type:
566
+ - application/vnd.contentful.management.v1+json
567
+ X-Contentful-Version:
568
+ - '2'
569
+ Content-Length:
570
+ - '0'
571
+ Host:
572
+ - api.contentful.com
573
+ response:
574
+ status:
575
+ code: 200
576
+ message: OK
577
+ headers:
578
+ Access-Control-Allow-Headers:
579
+ - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation
580
+ Access-Control-Allow-Methods:
581
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
582
+ Access-Control-Allow-Origin:
583
+ - "*"
584
+ Access-Control-Expose-Headers:
585
+ - Etag
586
+ Access-Control-Max-Age:
587
+ - '1728000'
588
+ Cf-Space-Id:
589
+ - ip17s12q0ek4
590
+ Content-Type:
591
+ - application/vnd.contentful.management.v1+json
592
+ Date:
593
+ - Sun, 04 Jan 2015 19:12:36 GMT
594
+ Etag:
595
+ - '"ed317ec00e74bfe9497dcf6523d238d2"'
596
+ Server:
597
+ - nginx
598
+ X-Powered-By:
599
+ - Express
600
+ Content-Length:
601
+ - '1360'
602
+ Connection:
603
+ - keep-alive
604
+ body:
605
+ encoding: UTF-8
606
+ string: |
607
+ {
608
+ "fields": {
609
+ "title": {
610
+ "en-US": "Ruby on rails"
611
+ },
612
+ "description": {
613
+ "en-US": ""
614
+ },
615
+ "file": {
616
+ "en-US": {
617
+ "contentType": "image/jpeg",
618
+ "fileName": "Ruby on rails",
619
+ "details": {
620
+ "image": {
621
+ "width": 1440,
622
+ "height": 900
623
+ },
624
+ "size": 241504
625
+ },
626
+ "url": "//images.contentful.com/ip17s12q0ek4/image_3/4bd7283f971230f30c7146428b53c457/Ruby_on_rails"
627
+ }
628
+ }
629
+ },
630
+ "sys": {
631
+ "id": "image_3",
632
+ "type": "Asset",
633
+ "createdAt": "2015-01-04T19:11:15.391Z",
634
+ "createdBy": {
635
+ "sys": {
636
+ "type": "Link",
637
+ "linkType": "User",
638
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
639
+ }
640
+ },
641
+ "space": {
642
+ "sys": {
643
+ "type": "Link",
644
+ "linkType": "Space",
645
+ "id": "ip17s12q0ek4"
646
+ }
647
+ },
648
+ "version": 3,
649
+ "updatedAt": "2015-01-04T19:12:36.283Z",
650
+ "updatedBy": {
651
+ "sys": {
652
+ "type": "Link",
653
+ "linkType": "User",
654
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
655
+ }
656
+ },
657
+ "firstPublishedAt": "2015-01-04T19:12:36.283Z",
658
+ "publishedCounter": 1,
659
+ "publishedAt": "2015-01-04T19:12:36.283Z",
660
+ "publishedBy": {
661
+ "sys": {
662
+ "type": "Link",
663
+ "linkType": "User",
664
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
665
+ }
666
+ },
667
+ "publishedVersion": 2
668
+ }
669
+ }
670
+ http_version:
671
+ recorded_at: Sun, 04 Jan 2015 19:12:36 GMT
672
+ - request:
673
+ method: get
674
+ uri: https://api.contentful.com/spaces/ip17s12q0ek4/assets/image_4
675
+ body:
676
+ encoding: US-ASCII
677
+ string: ''
678
+ headers:
679
+ User-Agent:
680
+ - RubyContentfulManagementGem/0.5.0
681
+ Authorization:
682
+ - Bearer <ACCESS_TOKEN>
683
+ Content-Type:
684
+ - application/vnd.contentful.management.v1+json
685
+ Content-Length:
686
+ - '0'
687
+ Host:
688
+ - api.contentful.com
689
+ response:
690
+ status:
691
+ code: 200
692
+ message: OK
693
+ headers:
694
+ Access-Control-Allow-Headers:
695
+ - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation
696
+ Access-Control-Allow-Methods:
697
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
698
+ Access-Control-Allow-Origin:
699
+ - "*"
700
+ Access-Control-Expose-Headers:
701
+ - Etag
702
+ Access-Control-Max-Age:
703
+ - '1728000'
704
+ Cf-Space-Id:
705
+ - ip17s12q0ek4
706
+ Content-Type:
707
+ - application/vnd.contentful.management.v1+json
708
+ Date:
709
+ - Sun, 04 Jan 2015 19:12:37 GMT
710
+ Etag:
711
+ - '"914217ee9e3061591c2d9cecbfc7152f"'
712
+ Server:
713
+ - nginx
714
+ X-Powered-By:
715
+ - Express
716
+ Content-Length:
717
+ - '1035'
718
+ Connection:
719
+ - keep-alive
720
+ body:
721
+ encoding: UTF-8
722
+ string: |
723
+ {
724
+ "fields": {
725
+ "title": {
726
+ "en-US": "Ruby"
727
+ },
728
+ "description": {
729
+ "en-US": ""
730
+ },
731
+ "file": {
732
+ "en-US": {
733
+ "contentType": "image/png",
734
+ "fileName": "Ruby",
735
+ "details": {
736
+ "image": {
737
+ "width": 256,
738
+ "height": 256
739
+ },
740
+ "size": 48561
741
+ },
742
+ "url": "//images.contentful.com/ip17s12q0ek4/image_4/e6d2a7e8094fcda82010c2c96a3c1c42/Ruby"
743
+ }
744
+ }
745
+ },
746
+ "sys": {
747
+ "id": "image_4",
748
+ "type": "Asset",
749
+ "createdAt": "2015-01-04T19:11:18.399Z",
750
+ "createdBy": {
751
+ "sys": {
752
+ "type": "Link",
753
+ "linkType": "User",
754
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
755
+ }
756
+ },
757
+ "space": {
758
+ "sys": {
759
+ "type": "Link",
760
+ "linkType": "Space",
761
+ "id": "ip17s12q0ek4"
762
+ }
763
+ },
764
+ "version": 2,
765
+ "updatedAt": "2015-01-04T19:11:19.728Z",
766
+ "updatedBy": {
767
+ "sys": {
768
+ "type": "Link",
769
+ "linkType": "User",
770
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
771
+ }
772
+ }
773
+ }
774
+ }
775
+ http_version:
776
+ recorded_at: Sun, 04 Jan 2015 19:12:37 GMT
777
+ - request:
778
+ method: put
779
+ uri: https://api.contentful.com/spaces/ip17s12q0ek4/assets/image_4/published
780
+ body:
781
+ encoding: US-ASCII
782
+ string: ''
783
+ headers:
784
+ User-Agent:
785
+ - RubyContentfulManagementGem/0.5.0
786
+ Authorization:
787
+ - Bearer <ACCESS_TOKEN>
788
+ Content-Type:
789
+ - application/vnd.contentful.management.v1+json
790
+ X-Contentful-Version:
791
+ - '2'
792
+ Content-Length:
793
+ - '0'
794
+ Host:
795
+ - api.contentful.com
796
+ response:
797
+ status:
798
+ code: 200
799
+ message: OK
800
+ headers:
801
+ Access-Control-Allow-Headers:
802
+ - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation
803
+ Access-Control-Allow-Methods:
804
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
805
+ Access-Control-Allow-Origin:
806
+ - "*"
807
+ Access-Control-Expose-Headers:
808
+ - Etag
809
+ Access-Control-Max-Age:
810
+ - '1728000'
811
+ Cf-Space-Id:
812
+ - ip17s12q0ek4
813
+ Content-Type:
814
+ - application/vnd.contentful.management.v1+json
815
+ Date:
816
+ - Sun, 04 Jan 2015 19:12:37 GMT
817
+ Etag:
818
+ - '"28bbded9828412cb2885ac6e5d212b21"'
819
+ Server:
820
+ - nginx
821
+ X-Powered-By:
822
+ - Express
823
+ Content-Length:
824
+ - '1330'
825
+ Connection:
826
+ - keep-alive
827
+ body:
828
+ encoding: UTF-8
829
+ string: |
830
+ {
831
+ "fields": {
832
+ "title": {
833
+ "en-US": "Ruby"
834
+ },
835
+ "description": {
836
+ "en-US": ""
837
+ },
838
+ "file": {
839
+ "en-US": {
840
+ "contentType": "image/png",
841
+ "fileName": "Ruby",
842
+ "details": {
843
+ "image": {
844
+ "width": 256,
845
+ "height": 256
846
+ },
847
+ "size": 48561
848
+ },
849
+ "url": "//images.contentful.com/ip17s12q0ek4/image_4/e6d2a7e8094fcda82010c2c96a3c1c42/Ruby"
850
+ }
851
+ }
852
+ },
853
+ "sys": {
854
+ "id": "image_4",
855
+ "type": "Asset",
856
+ "createdAt": "2015-01-04T19:11:18.399Z",
857
+ "createdBy": {
858
+ "sys": {
859
+ "type": "Link",
860
+ "linkType": "User",
861
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
862
+ }
863
+ },
864
+ "space": {
865
+ "sys": {
866
+ "type": "Link",
867
+ "linkType": "Space",
868
+ "id": "ip17s12q0ek4"
869
+ }
870
+ },
871
+ "version": 3,
872
+ "updatedAt": "2015-01-04T19:12:37.582Z",
873
+ "updatedBy": {
874
+ "sys": {
875
+ "type": "Link",
876
+ "linkType": "User",
877
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
878
+ }
879
+ },
880
+ "firstPublishedAt": "2015-01-04T19:12:37.582Z",
881
+ "publishedCounter": 1,
882
+ "publishedAt": "2015-01-04T19:12:37.582Z",
883
+ "publishedBy": {
884
+ "sys": {
885
+ "type": "Link",
886
+ "linkType": "User",
887
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
888
+ }
889
+ },
890
+ "publishedVersion": 2
891
+ }
892
+ }
893
+ http_version:
894
+ recorded_at: Sun, 04 Jan 2015 19:12:37 GMT
895
+ recorded_with: VCR 2.9.3