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,620 @@
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:11:44 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
+ - '35983'
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
+ - 0465967b18b9f3c913987aa06668da5a
216
+ Content-Length:
217
+ - '119'
218
+ Connection:
219
+ - Close
220
+ Set-Cookie:
221
+ - incap_ses_297_673446=Ks2CFnaFIQtwUrOJiygfBBDAEVkAAAAAqtDdTZOcjw4mQsHitMIm+Q==;
222
+ path=/; Domain=.contentful.com
223
+ - nlbi_673446=cbmMGKR4qwrza49o6lKYhQAAAAAdamWWFT/YVL490xTchy7I; path=/; Domain=.contentful.com
224
+ - visid_incap_673446=gjj3gaCTTRu3URCb/OFHvxDAEVkAAAAAQUIPAAAAAAD3CZqG4TLSvduHUKenrllp;
225
+ expires=Wed, 09 May 2018 07:00:14 GMT; path=/; Domain=.contentful.com
226
+ X-Iinfo:
227
+ - 10-64277352-64277374 NNNN CT(138 140 0) RT(1494335500815 115) q(0 0 3 -1)
228
+ r(35 35) 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": "0465967b18b9f3c913987aa06668da5a"
240
+ }
241
+ http_version:
242
+ recorded_at: Tue, 09 May 2017 13:11:44 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:11:48 GMT
283
+ Etag:
284
+ - '"5416e78d9a11c3eef69b4f303bf2341a"'
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
+ - '35982'
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
+ - 8c5fb920abd110a70e74c9fdefeee727
303
+ Content-Length:
304
+ - '1299'
305
+ Connection:
306
+ - Close
307
+ Set-Cookie:
308
+ - incap_ses_297_673446=EAjCS1xDxyfdW7OJiygfBBTAEVkAAAAAJdoZvFfdhPDASANL901tNA==;
309
+ path=/; Domain=.contentful.com
310
+ - nlbi_673446=97DlbL1wzl3/lNu66lKYhQAAAAArhanUBMbg8Wc2lLlqZjdd; path=/; Domain=.contentful.com
311
+ - visid_incap_673446=7DnwV9MsS7GW7C4nxMOE2RTAEVkAAAAAQUIPAAAAAAA/0RBc8DTDiw7XEPbAJWXu;
312
+ expires=Wed, 09 May 2018 07:00:14 GMT; path=/; Domain=.contentful.com
313
+ X-Iinfo:
314
+ - 10-64277992-64278003 NNNN CT(143 145 0) RT(1494335504604 105) q(0 0 2 -1)
315
+ r(36 36) U5
316
+ X-Cdn:
317
+ - Incapsula
318
+ body:
319
+ encoding: UTF-8
320
+ string: |
321
+ {
322
+ "fields": {
323
+ "name": {
324
+ "en-US": "Foo 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": 11,
366
+ "publishedAt": "2017-05-09T13:11:35.688Z",
367
+ "publishedBy": {
368
+ "sys": {
369
+ "type": "Link",
370
+ "linkType": "User",
371
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
372
+ }
373
+ },
374
+ "publishedVersion": 39,
375
+ "version": 40,
376
+ "updatedAt": "2017-05-09T13:11:35.727Z",
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:11:48 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/"796d13865f9a39b7d895f44bd6aeaab8"
430
+ Server:
431
+ - Contentful
432
+ X-Content-Type-Options:
433
+ - nosniff
434
+ X-Contentful-Request-Id:
435
+ - e9c97957ca89c4f97612e8dbab67c811
436
+ Content-Length:
437
+ - '523'
438
+ Accept-Ranges:
439
+ - bytes
440
+ Date:
441
+ - Tue, 09 May 2017 13:11:49 GMT
442
+ Via:
443
+ - 1.1 varnish
444
+ Age:
445
+ - '0'
446
+ Connection:
447
+ - close
448
+ X-Served-By:
449
+ - cache-lax8620-LAX
450
+ X-Cache:
451
+ - MISS
452
+ X-Cache-Hits:
453
+ - '0'
454
+ X-Timer:
455
+ - S1494335509.327812,VS0,VE338
456
+ Vary:
457
+ - Accept-Encoding
458
+ body:
459
+ encoding: ASCII-8BIT
460
+ string: !binary |-
461
+ H4sIAAAAAAAAA62US3OCMBDH734KJ+fqgEhFboxtpy8Pbe3BdjykITqpGF5R
462
+ h+n43ZsHYEDQizkwbJLN7v6zv/x1ul2QZilwu3/8lxssizC3gJckMAN87nAj
463
+ 9rCQwYDPm9JK1yTihiGNgGwIE0uGsgnDG3HgtzxQHVuLIiOlEUQiVLFDTWq5
464
+ iAk5WeT0SugaiJjHwaPT9SzP+UOeWNtAfFHOEqIV3e9Xv/YSi6qKcSj/ZZ1q
465
+ AOXz9Pz6nnh3aRwPvM0ebVfhHL9ox5d53VOWZPoCSjBk2PeELGBgmKOeYfcM
466
+ Z2YOXePWHdh90x5+6Q7byG9wGM9MyzVN17L7t45TcUjwjqQkpEJ3eSd55iik
467
+ DFOWK3I9aSfauY0CI8gu6xqECAayvTDtfX4UDqX0YElw4B+7URQFKNxIl4cw
468
+ 7E54FK3agOyw2G1a1kib/sEpe0gIpuLqr6dB/ZpldqpVUGxME2/96HjGm/OW
469
+ zuPtfhq36JFfluo88V1IjAhFwdaX5eQoqngFSEeUGmBqwalxp0z7DFJ89RJU
470
+ Zd1tWPFnQ4dM75izilU2Fjme6g7OAza0+uORrfPCE25GrGCy0UWHrJJZO2XX
471
+ ULydtVL3Gm3n5G5hLn/Y82ejgTseqyDvEUZRVmNPdomib1zRphW+a0hz2goa
472
+ hM3vtdaHNZmOT38FyQW3Dp1D5x8AMKicHAcAAA==
473
+ http_version:
474
+ recorded_at: Tue, 09 May 2017 13:11:49 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
+ - '40'
490
+ Connection:
491
+ - close
492
+ Host:
493
+ - api.contentful.com
494
+ response:
495
+ status:
496
+ code: 200
497
+ message: OK
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
+ Cf-Space-Id:
510
+ - facgnwwgj5fe
511
+ Content-Type:
512
+ - application/vnd.contentful.management.v1+json
513
+ Date:
514
+ - Tue, 09 May 2017 13:11:53 GMT
515
+ Etag:
516
+ - '"eb3b67727c0d44d7ed4e688f70272fc3"'
517
+ Server:
518
+ - Contentful
519
+ Strict-Transport-Security:
520
+ - max-age=15768000
521
+ X-Content-Type-Options:
522
+ - nosniff
523
+ X-Contentful-Ratelimit-Hour-Limit:
524
+ - '36000'
525
+ X-Contentful-Ratelimit-Hour-Remaining:
526
+ - '35981'
527
+ X-Contentful-Ratelimit-Reset:
528
+ - '0'
529
+ X-Contentful-Ratelimit-Second-Limit:
530
+ - '10'
531
+ X-Contentful-Ratelimit-Second-Remaining:
532
+ - '9'
533
+ X-Contentful-Request-Id:
534
+ - 3946cd87c647a82ebb83718b253d3847
535
+ Content-Length:
536
+ - '1299'
537
+ Connection:
538
+ - Close
539
+ Set-Cookie:
540
+ - incap_ses_297_673446=RvOALTkIsl4karOJiygfBBnAEVkAAAAAN7w+yYTG5tuJhOYJxM9Frw==;
541
+ path=/; Domain=.contentful.com
542
+ - nlbi_673446=fG/UJzfsV1uTRyS16lKYhQAAAADMkrHZMfvI6VKwnQpiBiHS; path=/; Domain=.contentful.com
543
+ - visid_incap_673446=tHA1ednKRvSQjn8um8InAhnAEVkAAAAAQUIPAAAAAAASG2gJw0ADX5uk8R9zrCgS;
544
+ expires=Wed, 09 May 2018 07:00:14 GMT; path=/; Domain=.contentful.com
545
+ X-Iinfo:
546
+ - 0-28182296-28182311 NNNN CT(0 0 0) RT(1494335509796 99) q(0 0 0 -1) r(39 39)
547
+ U5
548
+ X-Cdn:
549
+ - Incapsula
550
+ body:
551
+ encoding: UTF-8
552
+ string: |
553
+ {
554
+ "fields": {
555
+ "name": {
556
+ "en-US": "Foo Cat"
557
+ },
558
+ "lives": {
559
+ "en-US": 1337
560
+ },
561
+ "bestFriend": {
562
+ "en-US": {
563
+ "sys": {
564
+ "type": "Link",
565
+ "linkType": "Entry",
566
+ "id": "cq0MrAkH8A0Q8QsYquwMq"
567
+ }
568
+ }
569
+ }
570
+ },
571
+ "sys": {
572
+ "id": "IJLRrADsqq2AmwcugoYeK",
573
+ "type": "Entry",
574
+ "createdAt": "2017-05-08T14:06:14.367Z",
575
+ "createdBy": {
576
+ "sys": {
577
+ "type": "Link",
578
+ "linkType": "User",
579
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
580
+ }
581
+ },
582
+ "space": {
583
+ "sys": {
584
+ "type": "Link",
585
+ "linkType": "Space",
586
+ "id": "facgnwwgj5fe"
587
+ }
588
+ },
589
+ "contentType": {
590
+ "sys": {
591
+ "type": "Link",
592
+ "linkType": "ContentType",
593
+ "id": "cat"
594
+ }
595
+ },
596
+ "firstPublishedAt": "2017-05-08T14:06:25.154Z",
597
+ "publishedCounter": 11,
598
+ "publishedAt": "2017-05-09T13:11:35.688Z",
599
+ "publishedBy": {
600
+ "sys": {
601
+ "type": "Link",
602
+ "linkType": "User",
603
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
604
+ }
605
+ },
606
+ "publishedVersion": 39,
607
+ "version": 41,
608
+ "updatedAt": "2017-05-09T13:11:53.477Z",
609
+ "updatedBy": {
610
+ "sys": {
611
+ "type": "Link",
612
+ "linkType": "User",
613
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
614
+ }
615
+ }
616
+ }
617
+ }
618
+ http_version:
619
+ recorded_at: Tue, 09 May 2017 13:11:53 GMT
620
+ recorded_with: VCR 3.0.3