contentful_model 0.2.0 → 1.0.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 (84) hide show
  1. checksums.yaml +5 -5
  2. data/lib/contentful_model.rb +17 -13
  3. data/lib/contentful_model/asset.rb +30 -0
  4. data/lib/contentful_model/asset_dimension_query.rb +70 -0
  5. data/lib/contentful_model/asset_dimensions.rb +54 -0
  6. data/lib/contentful_model/associations/associations.rb +10 -4
  7. data/lib/contentful_model/associations/belongs_to.rb +9 -4
  8. data/lib/contentful_model/associations/belongs_to_many.rb +22 -45
  9. data/lib/contentful_model/associations/has_many.rb +15 -13
  10. data/lib/contentful_model/associations/has_many_nested.rb +39 -37
  11. data/lib/contentful_model/associations/has_one.rb +22 -14
  12. data/lib/contentful_model/base.rb +115 -74
  13. data/lib/contentful_model/client.rb +14 -3
  14. data/lib/contentful_model/errors.rb +0 -1
  15. data/lib/contentful_model/manageable.rb +49 -21
  16. data/lib/contentful_model/management.rb +1 -0
  17. data/lib/contentful_model/migrations/content_type.rb +24 -24
  18. data/lib/contentful_model/migrations/content_type_factory.rb +9 -6
  19. data/lib/contentful_model/migrations/migration.rb +9 -4
  20. data/lib/contentful_model/queries.rb +60 -9
  21. data/lib/contentful_model/query.rb +148 -5
  22. data/lib/contentful_model/validations/lambda_validation.rb +17 -0
  23. data/lib/contentful_model/validations/validates_presence_of.rb +4 -1
  24. data/lib/contentful_model/validations/validations.rb +56 -8
  25. data/lib/contentful_model/version.rb +1 -1
  26. data/spec/asset_spec.rb +141 -0
  27. data/spec/associations/belongs_to_many_spec.rb +38 -0
  28. data/spec/associations/belongs_to_spec.rb +22 -0
  29. data/spec/associations/has_many_nested_spec.rb +321 -0
  30. data/spec/associations/has_many_spec.rb +33 -0
  31. data/spec/associations/has_one_spec.rb +32 -0
  32. data/spec/base_spec.rb +199 -0
  33. data/spec/chainable_queries_spec.rb +199 -0
  34. data/spec/client_spec.rb +11 -0
  35. data/spec/contentful_model_spec.rb +25 -0
  36. data/spec/fixtures/vcr_cassettes/asset/all.yml +161 -0
  37. data/spec/fixtures/vcr_cassettes/asset/find.yml +118 -0
  38. data/spec/fixtures/vcr_cassettes/association/belongs_to_many.yml +439 -0
  39. data/spec/fixtures/vcr_cassettes/association/has_many.yml +161 -0
  40. data/spec/fixtures/vcr_cassettes/association/has_one.yml +161 -0
  41. data/spec/fixtures/vcr_cassettes/association/nested_with_root_root.yml +240 -0
  42. data/spec/fixtures/vcr_cassettes/association/nested_without_root_child_higher_include.yml +123 -0
  43. data/spec/fixtures/vcr_cassettes/association/nested_without_root_child_parent.yml +609 -0
  44. data/spec/fixtures/vcr_cassettes/association/nested_without_root_childless.yml +688 -0
  45. data/spec/fixtures/vcr_cassettes/association/nested_without_root_middle.yml +319 -0
  46. data/spec/fixtures/vcr_cassettes/association/nested_without_root_middle_higher_include.yml +161 -0
  47. data/spec/fixtures/vcr_cassettes/association/nested_without_root_middle_parent.yml +489 -0
  48. data/spec/fixtures/vcr_cassettes/association/nested_without_root_parentless.yml +331 -0
  49. data/spec/fixtures/vcr_cassettes/association/nested_without_root_parentless_higher_include.yml +82 -0
  50. data/spec/fixtures/vcr_cassettes/associations/nested_without_root_middle.yml +161 -0
  51. data/spec/fixtures/vcr_cassettes/associations/nested_without_root_middle_higher_include.yml +82 -0
  52. data/spec/fixtures/vcr_cassettes/base/content_type.yml +185 -0
  53. data/spec/fixtures/vcr_cassettes/base/return_nil_for_empty.yml +202 -0
  54. data/spec/fixtures/vcr_cassettes/base/return_nil_for_empty_with_value.yml +124 -0
  55. data/spec/fixtures/vcr_cassettes/client.yml +98 -0
  56. data/spec/fixtures/vcr_cassettes/dog.yml +161 -0
  57. data/spec/fixtures/vcr_cassettes/human.yml +199 -0
  58. data/spec/fixtures/vcr_cassettes/management/client.yml +1362 -0
  59. data/spec/fixtures/vcr_cassettes/management/nyancat.yml +1449 -0
  60. data/spec/fixtures/vcr_cassettes/management/nyancat_2.yml +1449 -0
  61. data/spec/fixtures/vcr_cassettes/management/nyancat_publish.yml +481 -0
  62. data/spec/fixtures/vcr_cassettes/management/nyancat_refetch_and_fail.yml +558 -0
  63. data/spec/fixtures/vcr_cassettes/management/nyancat_refetch_and_save.yml +620 -0
  64. data/spec/fixtures/vcr_cassettes/management/nyancat_save.yml +479 -0
  65. data/spec/fixtures/vcr_cassettes/management/nyancat_save_2.yml +479 -0
  66. data/spec/fixtures/vcr_cassettes/nyancat.yml +196 -0
  67. data/spec/fixtures/vcr_cassettes/playground/nyancat.yml +177 -0
  68. data/spec/fixtures/vcr_cassettes/query/each_entry.yml +319 -0
  69. data/spec/fixtures/vcr_cassettes/query/each_page.yml +319 -0
  70. data/spec/fixtures/vcr_cassettes/query/empty.yml +180 -0
  71. data/spec/fixtures/vcr_cassettes/query/load.yml +197 -0
  72. data/spec/fixtures/vcr_cassettes/query/manual_pagination.yml +161 -0
  73. data/spec/fixtures/vcr_cassettes/query/nyancat_invalid_elements.yml +247 -0
  74. data/spec/manageable_spec.rb +186 -0
  75. data/spec/management_spec.rb +17 -0
  76. data/spec/migrations/content_type_factory_spec.rb +41 -0
  77. data/spec/migrations/content_type_spec.rb +176 -0
  78. data/spec/migrations/migration_spec.rb +75 -0
  79. data/spec/queries_spec.rb +85 -0
  80. data/spec/query_spec.rb +126 -0
  81. data/spec/spec_helper.rb +58 -0
  82. data/spec/validations/validations_spec.rb +182 -0
  83. metadata +213 -19
  84. data/lib/contentful_model/chainable_queries.rb +0 -104
@@ -0,0 +1,558 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/spaces/facgnwwgj5fe/environments/master/content_types/cat
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - RubyContentfulManagementGem/1.1.0
12
+ Authorization:
13
+ - Bearer <ACCESS_TOKEN>
14
+ Content-Type:
15
+ - application/vnd.contentful.management.v1+json
16
+ Content-Length:
17
+ - '0'
18
+ Connection:
19
+ - close
20
+ Host:
21
+ - api.contentful.com
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Access-Control-Allow-Headers:
28
+ - 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,X-Contentful-User-Agent
29
+ Access-Control-Allow-Methods:
30
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Access-Control-Expose-Headers:
34
+ - Etag
35
+ Access-Control-Max-Age:
36
+ - '1728000'
37
+ Cf-Space-Id:
38
+ - facgnwwgj5fe
39
+ Content-Type:
40
+ - application/vnd.contentful.management.v1+json
41
+ Date:
42
+ - Mon, 08 May 2017 14:10:53 GMT
43
+ Etag:
44
+ - '"3ebdb893e2c6c3d675f9c1d97cc55d58"'
45
+ Server:
46
+ - Contentful
47
+ Strict-Transport-Security:
48
+ - max-age=15768000
49
+ X-Content-Type-Options:
50
+ - nosniff
51
+ X-Contentful-Ratelimit-Hour-Limit:
52
+ - '36000'
53
+ X-Contentful-Ratelimit-Hour-Remaining:
54
+ - '35946'
55
+ X-Contentful-Ratelimit-Reset:
56
+ - '0'
57
+ X-Contentful-Ratelimit-Second-Limit:
58
+ - '10'
59
+ X-Contentful-Ratelimit-Second-Remaining:
60
+ - '9'
61
+ X-Contentful-Request-Id:
62
+ - 3bf94d724fe1005dec593d36cb4cf26f
63
+ Content-Length:
64
+ - '1604'
65
+ Connection:
66
+ - Close
67
+ Set-Cookie:
68
+ - incap_ses_297_673446=LGdPZX0MvXP3Uo6HiygfBG58EFkAAAAAqJds0JrIWVeXdcdHwCS7UQ==;
69
+ path=/; Domain=.contentful.com
70
+ - nlbi_673446=iGA9MjTOSxobb4qD6lKYhQAAAACDXkAnT9IyQsZIY/+xIId2; path=/; Domain=.contentful.com
71
+ - visid_incap_673446=dI7jUbLoRSuOceGAydRZbm58EFkAAAAAQUIPAAAAAADIhN6c9FvLXMlp+KaWakoV;
72
+ expires=Tue, 08 May 2018 07:00:13 GMT; path=/; Domain=.contentful.com
73
+ X-Iinfo:
74
+ - 0-22362614-22362630 NNNN CT(140 138 0) RT(1494252653354 109) q(0 0 3 -1) r(6
75
+ 6) U5
76
+ X-Cdn:
77
+ - Incapsula
78
+ body:
79
+ encoding: UTF-8
80
+ string: |
81
+ {
82
+ "name": "Cat",
83
+ "fields": [
84
+ {
85
+ "name": "Name",
86
+ "id": "name",
87
+ "type": "Symbol",
88
+ "validations": [],
89
+ "localized": false,
90
+ "required": false,
91
+ "disabled": false,
92
+ "omitted": false
93
+ },
94
+ {
95
+ "name": "Lives",
96
+ "id": "lives",
97
+ "type": "Integer",
98
+ "validations": [],
99
+ "localized": false,
100
+ "required": false,
101
+ "disabled": false,
102
+ "omitted": false
103
+ },
104
+ {
105
+ "name": "Best Friend",
106
+ "id": "bestFriend",
107
+ "type": "Link",
108
+ "linkType": "Entry",
109
+ "localized": false,
110
+ "required": false,
111
+ "disabled": false,
112
+ "omitted": false,
113
+ "validations": []
114
+ }
115
+ ],
116
+ "displayField": "name",
117
+ "description": "",
118
+ "sys": {
119
+ "id": "cat",
120
+ "type": "ContentType",
121
+ "createdAt": "2017-05-08T14:06:00.224Z",
122
+ "createdBy": {
123
+ "sys": {
124
+ "type": "Link",
125
+ "linkType": "User",
126
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
127
+ }
128
+ },
129
+ "space": {
130
+ "sys": {
131
+ "type": "Link",
132
+ "linkType": "Space",
133
+ "id": "facgnwwgj5fe"
134
+ }
135
+ },
136
+ "firstPublishedAt": "2017-05-08T14:06:00.749Z",
137
+ "publishedCounter": 1,
138
+ "publishedAt": "2017-05-08T14:06:00.749Z",
139
+ "publishedBy": {
140
+ "sys": {
141
+ "type": "Link",
142
+ "linkType": "User",
143
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
144
+ }
145
+ },
146
+ "publishedVersion": 1,
147
+ "version": 2,
148
+ "updatedAt": "2017-05-08T14:06:00.760Z",
149
+ "updatedBy": {
150
+ "sys": {
151
+ "type": "Link",
152
+ "linkType": "User",
153
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
154
+ }
155
+ }
156
+ }
157
+ }
158
+ http_version:
159
+ recorded_at: Tue, 09 May 2017 13:31:34 GMT
160
+ - request:
161
+ method: put
162
+ uri: https://api.contentful.com/spaces/facgnwwgj5fe/environments/master/entries/IJLRrADsqq2AmwcugoYeK
163
+ body:
164
+ encoding: UTF-8
165
+ string: '{"fields":{"name":{"en-US":"Foo Cat"},"lives":{"en-US":1337},"bestFriend":{"en-US":{"sys":{"type":"Link","linkType":"Entry","id":"cq0MrAkH8A0Q8QsYquwMq"}}}}}'
166
+ headers:
167
+ User-Agent:
168
+ - RubyContentfulManagementGem/1.1.0
169
+ Authorization:
170
+ - Bearer <ACCESS_TOKEN>
171
+ Content-Type:
172
+ - application/vnd.contentful.management.v1+json
173
+ X-Contentful-Version:
174
+ - '11'
175
+ Connection:
176
+ - close
177
+ Host:
178
+ - api.contentful.com
179
+ response:
180
+ status:
181
+ code: 409
182
+ message: Conflict
183
+ headers:
184
+ Access-Control-Allow-Headers:
185
+ - 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,X-Contentful-User-Agent
186
+ Access-Control-Allow-Methods:
187
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
188
+ Access-Control-Allow-Origin:
189
+ - "*"
190
+ Access-Control-Expose-Headers:
191
+ - Etag
192
+ Access-Control-Max-Age:
193
+ - '1728000'
194
+ Content-Type:
195
+ - application/vnd.contentful.management.v1+json
196
+ Date:
197
+ - Tue, 09 May 2017 13:34:14 GMT
198
+ Server:
199
+ - Contentful
200
+ Strict-Transport-Security:
201
+ - max-age=15768000
202
+ X-Content-Type-Options:
203
+ - nosniff
204
+ X-Contentful-Ratelimit-Hour-Limit:
205
+ - '36000'
206
+ X-Contentful-Ratelimit-Hour-Remaining:
207
+ - '35946'
208
+ X-Contentful-Ratelimit-Reset:
209
+ - '0'
210
+ X-Contentful-Ratelimit-Second-Limit:
211
+ - '10'
212
+ X-Contentful-Ratelimit-Second-Remaining:
213
+ - '9'
214
+ X-Contentful-Request-Id:
215
+ - f6d5bd47a6fa3a6dffecf3519d29e769
216
+ Content-Length:
217
+ - '119'
218
+ Connection:
219
+ - Close
220
+ Set-Cookie:
221
+ - incap_ses_297_673446=Mdi4FMedPxObssCJiygfBFbFEVkAAAAAdPO4GCGcnrKE62I34fO89w==;
222
+ path=/; Domain=.contentful.com
223
+ - nlbi_673446=4HyCbQglC0NsqL0v6lKYhQAAAADLonX/g9cHfvjWccHDLbC5; path=/; Domain=.contentful.com
224
+ - visid_incap_673446=dxjgGxefTvObCvd1HMfQ+lbFEVkAAAAAQUIPAAAAAACVKQPkfYmYrrBAUl2YLKUs;
225
+ expires=Wed, 09 May 2018 07:00:14 GMT; path=/; Domain=.contentful.com
226
+ X-Iinfo:
227
+ - 6-45576700-45576716 NNNN CT(0 0 0) RT(1494336850717 96) q(0 0 0 -1) r(33 33)
228
+ U5
229
+ X-Cdn:
230
+ - Incapsula
231
+ body:
232
+ encoding: UTF-8
233
+ string: |
234
+ {
235
+ "sys": {
236
+ "type": "Error",
237
+ "id": "VersionMismatch"
238
+ },
239
+ "requestId": "f6d5bd47a6fa3a6dffecf3519d29e769"
240
+ }
241
+ http_version:
242
+ recorded_at: Tue, 09 May 2017 13:34:14 GMT
243
+ - request:
244
+ method: get
245
+ uri: https://api.contentful.com/spaces/facgnwwgj5fe/environments/master/entries/IJLRrADsqq2AmwcugoYeK
246
+ body:
247
+ encoding: US-ASCII
248
+ string: ''
249
+ headers:
250
+ User-Agent:
251
+ - RubyContentfulManagementGem/1.1.0
252
+ Authorization:
253
+ - Bearer <ACCESS_TOKEN>
254
+ Content-Type:
255
+ - application/vnd.contentful.management.v1+json
256
+ Content-Length:
257
+ - '0'
258
+ Connection:
259
+ - close
260
+ Host:
261
+ - api.contentful.com
262
+ response:
263
+ status:
264
+ code: 200
265
+ message: OK
266
+ headers:
267
+ Access-Control-Allow-Headers:
268
+ - 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,X-Contentful-User-Agent
269
+ Access-Control-Allow-Methods:
270
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
271
+ Access-Control-Allow-Origin:
272
+ - "*"
273
+ Access-Control-Expose-Headers:
274
+ - Etag
275
+ Access-Control-Max-Age:
276
+ - '1728000'
277
+ Cf-Space-Id:
278
+ - facgnwwgj5fe
279
+ Content-Type:
280
+ - application/vnd.contentful.management.v1+json
281
+ Date:
282
+ - Tue, 09 May 2017 13:34:14 GMT
283
+ Etag:
284
+ - '"4775f851f97f864845af32c263d16c60"'
285
+ Server:
286
+ - Contentful
287
+ Strict-Transport-Security:
288
+ - max-age=15768000
289
+ X-Content-Type-Options:
290
+ - nosniff
291
+ X-Contentful-Ratelimit-Hour-Limit:
292
+ - '36000'
293
+ X-Contentful-Ratelimit-Hour-Remaining:
294
+ - '35945'
295
+ X-Contentful-Ratelimit-Reset:
296
+ - '0'
297
+ X-Contentful-Ratelimit-Second-Limit:
298
+ - '10'
299
+ X-Contentful-Ratelimit-Second-Remaining:
300
+ - '9'
301
+ X-Contentful-Request-Id:
302
+ - b98f71857c282323465e953f4aacd37d
303
+ Content-Length:
304
+ - '1302'
305
+ Connection:
306
+ - Close
307
+ Set-Cookie:
308
+ - incap_ses_297_673446=SIcgOcN9nzK9s8CJiygfBFbFEVkAAAAA+dkSiRLCI754mzfBTF4diw==;
309
+ path=/; Domain=.contentful.com
310
+ - nlbi_673446=AMhKH96oiVVo7T2c6lKYhQAAAACQIUF85tGwYpViNhz3wuuw; path=/; Domain=.contentful.com
311
+ - visid_incap_673446=H4wefnO0R1OMjDsvG7lnilbFEVkAAAAAQUIPAAAAAAD2GJteQ/c13db/FIxzRe1T;
312
+ expires=Wed, 09 May 2018 07:00:15 GMT; path=/; Domain=.contentful.com
313
+ X-Iinfo:
314
+ - 4-48201885-48201901 NNNN CT(0 0 0) RT(1494336854229 92) q(0 0 0 -1) r(2 2)
315
+ U5
316
+ X-Cdn:
317
+ - Incapsula
318
+ body:
319
+ encoding: UTF-8
320
+ string: |
321
+ {
322
+ "fields": {
323
+ "name": {
324
+ "en-US": "Foobar Cat"
325
+ },
326
+ "lives": {
327
+ "en-US": 1337
328
+ },
329
+ "bestFriend": {
330
+ "en-US": {
331
+ "sys": {
332
+ "type": "Link",
333
+ "linkType": "Entry",
334
+ "id": "cq0MrAkH8A0Q8QsYquwMq"
335
+ }
336
+ }
337
+ }
338
+ },
339
+ "sys": {
340
+ "id": "IJLRrADsqq2AmwcugoYeK",
341
+ "type": "Entry",
342
+ "createdAt": "2017-05-08T14:06:14.367Z",
343
+ "createdBy": {
344
+ "sys": {
345
+ "type": "Link",
346
+ "linkType": "User",
347
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
348
+ }
349
+ },
350
+ "space": {
351
+ "sys": {
352
+ "type": "Link",
353
+ "linkType": "Space",
354
+ "id": "facgnwwgj5fe"
355
+ }
356
+ },
357
+ "contentType": {
358
+ "sys": {
359
+ "type": "Link",
360
+ "linkType": "ContentType",
361
+ "id": "cat"
362
+ }
363
+ },
364
+ "firstPublishedAt": "2017-05-08T14:06:25.154Z",
365
+ "publishedCounter": 13,
366
+ "publishedAt": "2017-05-09T13:34:05.564Z",
367
+ "publishedBy": {
368
+ "sys": {
369
+ "type": "Link",
370
+ "linkType": "User",
371
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
372
+ }
373
+ },
374
+ "publishedVersion": 48,
375
+ "version": 49,
376
+ "updatedAt": "2017-05-09T13:34:05.609Z",
377
+ "updatedBy": {
378
+ "sys": {
379
+ "type": "Link",
380
+ "linkType": "User",
381
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
382
+ }
383
+ }
384
+ }
385
+ }
386
+ http_version:
387
+ recorded_at: Tue, 09 May 2017 13:34:14 GMT
388
+ - request:
389
+ method: get
390
+ uri: https://cdn.contentful.com/spaces/facgnwwgj5fe/environments/master/entries?sys.id=IJLRrADsqq2AmwcugoYeK
391
+ body:
392
+ encoding: US-ASCII
393
+ string: ''
394
+ headers:
395
+ User-Agent:
396
+ - RubyContentfulGem/2.0.1
397
+ Authorization:
398
+ - Bearer 4d0f55d940975f78139daae5d965b463c0816e88ad16062d2c1ee3d6cb930521
399
+ Content-Type:
400
+ - application/vnd.contentful.delivery.v1+json
401
+ Accept-Encoding:
402
+ - gzip
403
+ Connection:
404
+ - close
405
+ Host:
406
+ - cdn.contentful.com
407
+ response:
408
+ status:
409
+ code: 200
410
+ message: OK
411
+ headers:
412
+ Access-Control-Allow-Headers:
413
+ - 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,X-Contentful-User-Agent
414
+ Access-Control-Allow-Methods:
415
+ - GET,HEAD,OPTIONS
416
+ Access-Control-Allow-Origin:
417
+ - "*"
418
+ Access-Control-Expose-Headers:
419
+ - Etag
420
+ Access-Control-Max-Age:
421
+ - '86400'
422
+ Cache-Control:
423
+ - max-age=0
424
+ Content-Encoding:
425
+ - gzip
426
+ Content-Type:
427
+ - application/vnd.contentful.delivery.v1+json
428
+ Etag:
429
+ - W/"512a87e4fc7466dd01ab009c308a1778"
430
+ Server:
431
+ - Contentful
432
+ X-Content-Type-Options:
433
+ - nosniff
434
+ X-Contentful-Request-Id:
435
+ - 134f4f37ffb4d165dc10711d6de7003b
436
+ Content-Length:
437
+ - '524'
438
+ Accept-Ranges:
439
+ - bytes
440
+ Date:
441
+ - Tue, 09 May 2017 13:34:15 GMT
442
+ Via:
443
+ - 1.1 varnish
444
+ Age:
445
+ - '161'
446
+ Connection:
447
+ - close
448
+ X-Served-By:
449
+ - cache-lax8643-LAX
450
+ X-Cache:
451
+ - HIT
452
+ X-Cache-Hits:
453
+ - '1'
454
+ X-Timer:
455
+ - S1494336855.443337,VS0,VE0
456
+ Vary:
457
+ - Accept-Encoding
458
+ body:
459
+ encoding: ASCII-8BIT
460
+ string: !binary |-
461
+ H4sIAAAAAAAAA62VyW7CMBCG7zwF8rkgJ5ACuUVd1IVWaqEHWvXgOga5BGcz
462
+ RVHFu9dLEpw0gQs+oIztWfx7PvPb6XZBmqXA7f6KT2HwLCLCAl6SoAyIuf2F
463
+ 3MNDjgIxbykrXdNIGFAZAd1QLpegtiknGxnwQwXUYWtZVKY0QlimKnboSaMW
464
+ OaEmi5qmlK2BzHkYIjtbz/OaZypibQP15XGWCK/Ybrf6dpZEnqoY+/JbnVMP
465
+ oH3uH6aviXedxrHtbXZ4uwoX5NEIX9Z1w3iSmQs4IYgT35OyABtaox50enA8
466
+ t4YuvHRtp285w3fTYRv5DQ6TuTVw7Yk7HPcdC1YcEvJDUxoyqbttVI5Dxgnj
467
+ uSLnk/bKiNsoMEb8tK5BiFGg2ouw3tuscCilB0tKAv/QjfI6AEMb5fKcIda9
468
+ EmmM4wb0h8jt1mAwMqa/SMpvE0qYvPvziVC/Z1We7hUcw6fEW9+NPfgyfkkX
469
+ 8Xb3FLcIkveZbj35+6k4ogwHW18dJ2dR5ytIOrDUQFMLT407VdlHmBKrp6gq
470
+ z93GlXg3TMrMljmqWGVjUeN/3cFxwoaD/mTkmMCIgpsZK6BsdDEpq1TWjtk5
471
+ FG+HrdS9htsxuVugy1/2/MVrAE/kKtC7Q1GU1dhTXaLpm1S0aYXvHNL8bwUD
472
+ wuYHu/J/UenKw9tfQfJTWPvOvvMHj9gimB0HAAA=
473
+ http_version:
474
+ recorded_at: Tue, 09 May 2017 13:34:15 GMT
475
+ - request:
476
+ method: put
477
+ uri: https://api.contentful.com/spaces/facgnwwgj5fe/environments/master/entries/IJLRrADsqq2AmwcugoYeK
478
+ body:
479
+ encoding: UTF-8
480
+ string: '{"fields":{"name":{"en-US":"Foo Cat"},"lives":{"en-US":1337},"bestFriend":{"en-US":{"sys":{"type":"Link","linkType":"Entry","id":"cq0MrAkH8A0Q8QsYquwMq"}}}}}'
481
+ headers:
482
+ User-Agent:
483
+ - RubyContentfulManagementGem/1.1.0
484
+ Authorization:
485
+ - Bearer <ACCESS_TOKEN>
486
+ Content-Type:
487
+ - application/vnd.contentful.management.v1+json
488
+ X-Contentful-Version:
489
+ - '49'
490
+ Connection:
491
+ - close
492
+ Host:
493
+ - api.contentful.com
494
+ response:
495
+ status:
496
+ code: 409
497
+ message: Conflict
498
+ headers:
499
+ Access-Control-Allow-Headers:
500
+ - 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,X-Contentful-User-Agent
501
+ Access-Control-Allow-Methods:
502
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
503
+ Access-Control-Allow-Origin:
504
+ - "*"
505
+ Access-Control-Expose-Headers:
506
+ - Etag
507
+ Access-Control-Max-Age:
508
+ - '1728000'
509
+ Content-Type:
510
+ - application/vnd.contentful.management.v1+json
511
+ Date:
512
+ - Tue, 09 May 2017 13:34:28 GMT
513
+ Server:
514
+ - Contentful
515
+ Strict-Transport-Security:
516
+ - max-age=15768000
517
+ X-Content-Type-Options:
518
+ - nosniff
519
+ X-Contentful-Ratelimit-Hour-Limit:
520
+ - '36000'
521
+ X-Contentful-Ratelimit-Hour-Remaining:
522
+ - '35942'
523
+ X-Contentful-Ratelimit-Reset:
524
+ - '0'
525
+ X-Contentful-Ratelimit-Second-Limit:
526
+ - '10'
527
+ X-Contentful-Ratelimit-Second-Remaining:
528
+ - '9'
529
+ X-Contentful-Request-Id:
530
+ - 2a1b819089f9a0f8a0b7504d31fa24c2
531
+ Content-Length:
532
+ - '119'
533
+ Connection:
534
+ - Close
535
+ Set-Cookie:
536
+ - incap_ses_297_673446=4sX8KQU43VKe1sCJiygfBGTFEVkAAAAAJzs2tUtszgKzLy0I/2XlPQ==;
537
+ path=/; Domain=.contentful.com
538
+ - nlbi_673446=MKrIS8U4OS5aJvYl6lKYhQAAAADq/vUFLvI4Wscj+qyUha9x; path=/; Domain=.contentful.com
539
+ - visid_incap_673446=+DmPvkahRbqnRD5nn1yXiWTFEVkAAAAAQUIPAAAAAAC3v7hIlluUpI7uWXEKxOFg;
540
+ expires=Wed, 09 May 2018 07:00:14 GMT; path=/; Domain=.contentful.com
541
+ X-Iinfo:
542
+ - 6-45579753-45579774 NNNN CT(0 0 0) RT(1494336868082 95) q(0 0 0 -1) r(3 3)
543
+ U5
544
+ X-Cdn:
545
+ - Incapsula
546
+ body:
547
+ encoding: UTF-8
548
+ string: |
549
+ {
550
+ "sys": {
551
+ "type": "Error",
552
+ "id": "VersionMismatch"
553
+ },
554
+ "requestId": "2a1b819089f9a0f8a0b7504d31fa24c2"
555
+ }
556
+ http_version:
557
+ recorded_at: Tue, 09 May 2017 13:34:28 GMT
558
+ recorded_with: VCR 3.0.3