contentful-management 0.2.1 → 0.3.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 (59) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +37 -8
  3. data/Gemfile +0 -1
  4. data/README.md +130 -0
  5. data/Rakefile +0 -1
  6. data/contentful-management.gemspec +0 -1
  7. data/examples/blog.rb +1 -1
  8. data/lib/contentful/management.rb +0 -1
  9. data/lib/contentful/management/array.rb +0 -1
  10. data/lib/contentful/management/asset.rb +65 -26
  11. data/lib/contentful/management/client.rb +19 -9
  12. data/lib/contentful/management/content_type.rb +43 -28
  13. data/lib/contentful/management/dynamic_entry.rb +15 -15
  14. data/lib/contentful/management/entry.rb +73 -40
  15. data/lib/contentful/management/error.rb +6 -1
  16. data/lib/contentful/management/field.rb +63 -8
  17. data/lib/contentful/management/file.rb +0 -1
  18. data/lib/contentful/management/http_client.rb +0 -1
  19. data/lib/contentful/management/link.rb +0 -1
  20. data/lib/contentful/management/locale.rb +11 -3
  21. data/lib/contentful/management/location.rb +0 -1
  22. data/lib/contentful/management/request.rb +5 -7
  23. data/lib/contentful/management/resource.rb +3 -3
  24. data/lib/contentful/management/resource/array_like.rb +0 -1
  25. data/lib/contentful/management/resource/fields.rb +1 -2
  26. data/lib/contentful/management/resource/refresher.rb +3 -3
  27. data/lib/contentful/management/resource/system_properties.rb +0 -1
  28. data/lib/contentful/management/resource_builder.rb +16 -27
  29. data/lib/contentful/management/response.rb +36 -32
  30. data/lib/contentful/management/space.rb +16 -6
  31. data/lib/contentful/management/space_webhook_methods_factory.rb +0 -4
  32. data/lib/contentful/management/support.rb +0 -1
  33. data/lib/contentful/management/validation.rb +34 -0
  34. data/lib/contentful/management/version.rb +1 -2
  35. data/lib/contentful/management/webhook.rb +17 -10
  36. data/spec/fixtures/vcr_cassettes/content_type/validation/in.yml +588 -0
  37. data/spec/fixtures/vcr_cassettes/content_type/validation/in_add.yml +620 -0
  38. data/spec/fixtures/vcr_cassettes/content_type/validation/in_update.yml +668 -0
  39. data/spec/fixtures/vcr_cassettes/content_type/validation/link_content_type.yml +749 -0
  40. data/spec/fixtures/vcr_cassettes/content_type/validation/link_field.yml +770 -0
  41. data/spec/fixtures/vcr_cassettes/content_type/validation/link_mimetype_group.yml +766 -0
  42. data/spec/fixtures/vcr_cassettes/content_type/validation/multiple_add.yml +854 -0
  43. data/spec/fixtures/vcr_cassettes/content_type/validation/present.yml +808 -0
  44. data/spec/fixtures/vcr_cassettes/content_type/validation/range.yml +683 -0
  45. data/spec/fixtures/vcr_cassettes/content_type/validation/range_update.yml +697 -0
  46. data/spec/fixtures/vcr_cassettes/content_type/validation/regexp.yml +720 -0
  47. data/spec/fixtures/vcr_cassettes/content_type/validation/size.yml +791 -0
  48. data/spec/fixtures/vcr_cassettes/entry/service_unavailable.yml +52 -0
  49. data/spec/fixtures/vcr_cassettes/space/webhook/create.yml +439 -0
  50. data/spec/lib/contentful/management/asset_spec.rb +16 -16
  51. data/spec/lib/contentful/management/client_spec.rb +0 -1
  52. data/spec/lib/contentful/management/content_type_spec.rb +143 -1
  53. data/spec/lib/contentful/management/entry_spec.rb +10 -4
  54. data/spec/lib/contentful/management/locale_spec.rb +0 -1
  55. data/spec/lib/contentful/management/space_spec.rb +9 -1
  56. data/spec/lib/contentful/management/webhook_spec.rb +0 -1
  57. data/spec/spec_helper.rb +0 -1
  58. data/spec/support/vcr.rb +0 -1
  59. metadata +63 -62
@@ -0,0 +1,854 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/spaces/v2umtz8ths9v
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - RubyContenfulManagementGem/0.2.1
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-Expose-Headers":
26
+ - Etag
27
+ Accept-Ranges:
28
+ - bytes
29
+ Access-Control-Allow-Headers:
30
+ - 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
31
+ Access-Control-Allow-Methods:
32
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
33
+ Access-Control-Allow-Origin:
34
+ - "*"
35
+ Access-Control-Max-Age:
36
+ - '1728000'
37
+ Cache-Control:
38
+ - max-age=0
39
+ Content-Type:
40
+ - application/vnd.contentful.management.v1+json
41
+ Date:
42
+ - Wed, 15 Oct 2014 14:13:41 GMT
43
+ Etag:
44
+ - '"35407b8a88882fe5717a4701910f6ce7"'
45
+ Server:
46
+ - nginx
47
+ Status:
48
+ - 200 OK
49
+ X-Contentful-Request-Id:
50
+ - 85f-806760012
51
+ Content-Length:
52
+ - '459'
53
+ Connection:
54
+ - keep-alive
55
+ body:
56
+ encoding: UTF-8
57
+ string: |
58
+ {
59
+ "sys":{
60
+ "type":"Space",
61
+ "id":"v2umtz8ths9v",
62
+ "version":1,
63
+ "createdBy":{
64
+ "sys":{
65
+ "type":"Link",
66
+ "linkType":"User",
67
+ "id":"1E7acJL8I5XUXAMHQt9Grs"
68
+ }
69
+ },
70
+ "createdAt":"2014-08-21T13:32:11Z",
71
+ "updatedBy":{
72
+ "sys":{
73
+ "type":"Link",
74
+ "linkType":"User",
75
+ "id":"1E7acJL8I5XUXAMHQt9Grs"
76
+ }
77
+ },
78
+ "updatedAt":"2014-08-21T13:32:12Z"
79
+ },
80
+ "name":"CMA Demo Rails App"}
81
+ http_version:
82
+ recorded_at: Wed, 15 Oct 2014 14:16:03 GMT
83
+ - request:
84
+ method: get
85
+ uri: https://api.contentful.com/spaces/v2umtz8ths9v/content_types
86
+ body:
87
+ encoding: US-ASCII
88
+ string: ''
89
+ headers:
90
+ User-Agent:
91
+ - RubyContenfulManagementGem/0.2.1
92
+ Authorization:
93
+ - Bearer <ACCESS_TOKEN>
94
+ Content-Type:
95
+ - application/vnd.contentful.management.v1+json
96
+ Content-Length:
97
+ - '0'
98
+ Host:
99
+ - api.contentful.com
100
+ response:
101
+ status:
102
+ code: 200
103
+ message: OK
104
+ headers:
105
+ "^access-Control-Expose-Headers":
106
+ - Etag
107
+ Access-Control-Allow-Headers:
108
+ - 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
109
+ Access-Control-Allow-Methods:
110
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
111
+ Access-Control-Allow-Origin:
112
+ - "*"
113
+ Access-Control-Max-Age:
114
+ - '1728000'
115
+ Cf-Space-Id:
116
+ - v2umtz8ths9v
117
+ Content-Type:
118
+ - application/vnd.contentful.management.v1+json
119
+ Date:
120
+ - Wed, 15 Oct 2014 14:13:42 GMT
121
+ Etag:
122
+ - '"b2a5c4cfc1ab6461448b6499a2f87680"'
123
+ Server:
124
+ - nginx
125
+ X-Powered-By:
126
+ - Express
127
+ Content-Length:
128
+ - '8449'
129
+ Connection:
130
+ - keep-alive
131
+ body:
132
+ encoding: UTF-8
133
+ string: |
134
+ {
135
+ "sys": {
136
+ "type": "Array"
137
+ },
138
+ "total": 4,
139
+ "skip": 0,
140
+ "limit": 100,
141
+ "items": [
142
+ {
143
+ "displayField": "title",
144
+ "name": "Post",
145
+ "description": "",
146
+ "fields": [
147
+ {
148
+ "id": "title",
149
+ "name": "Title",
150
+ "type": "Text",
151
+ "localized": true,
152
+ "uiid": "2sdir2f8kcg"
153
+ },
154
+ {
155
+ "id": "author",
156
+ "name": "Author",
157
+ "type": "Text",
158
+ "localized": true,
159
+ "uiid": "4x1018907pc"
160
+ },
161
+ {
162
+ "id": "body",
163
+ "name": "Body",
164
+ "type": "Text",
165
+ "localized": true,
166
+ "uiid": "4hj7cda89hc"
167
+ },
168
+ {
169
+ "id": "title_image",
170
+ "name": "Title Image",
171
+ "type": "Link",
172
+ "linkType": "Asset",
173
+ "required": true,
174
+ "localized": true,
175
+ "uiid": "4gcqrcma8lc"
176
+ },
177
+ {
178
+ "id": "second_image",
179
+ "name": "Second Image",
180
+ "type": "Link",
181
+ "linkType": "Asset",
182
+ "localized": true,
183
+ "uiid": "40440elrugw"
184
+ },
185
+ {
186
+ "id": "category",
187
+ "name": "Category",
188
+ "type": "Link",
189
+ "linkType": "Entry",
190
+ "uiid": "49vicjvqsxs",
191
+ "localized": true
192
+ }
193
+ ],
194
+ "sys": {
195
+ "id": "post_content_type",
196
+ "type": "ContentType",
197
+ "createdAt": "2014-08-21T13:32:30.401Z",
198
+ "createdBy": {
199
+ "sys": {
200
+ "type": "Link",
201
+ "linkType": "User",
202
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
203
+ }
204
+ },
205
+ "space": {
206
+ "sys": {
207
+ "type": "Link",
208
+ "linkType": "Space",
209
+ "id": "v2umtz8ths9v"
210
+ }
211
+ },
212
+ "firstPublishedAt": "2014-08-21T13:32:43.385Z",
213
+ "publishedCounter": 2,
214
+ "publishedAt": "2014-08-27T09:18:36.995Z",
215
+ "publishedBy": {
216
+ "sys": {
217
+ "type": "Link",
218
+ "linkType": "User",
219
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
220
+ }
221
+ },
222
+ "publishedVersion": 11,
223
+ "version": 12,
224
+ "updatedAt": "2014-08-27T09:18:37.003Z",
225
+ "updatedBy": {
226
+ "sys": {
227
+ "type": "Link",
228
+ "linkType": "User",
229
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
230
+ }
231
+ }
232
+ }
233
+ },
234
+ {
235
+ "fields": [
236
+ {
237
+ "name": "testowe",
238
+ "id": "testowe",
239
+ "type": "Link",
240
+ "uiid": "3q907mcb4lc",
241
+ "linkType": "Asset",
242
+ "required": true,
243
+ "localized": true,
244
+ "validations": []
245
+ }
246
+ ],
247
+ "name": "test",
248
+ "sys": {
249
+ "id": "26eLfV14SIOeQkse44q4sw",
250
+ "type": "ContentType",
251
+ "createdAt": "2014-08-22T12:57:43.618Z",
252
+ "createdBy": {
253
+ "sys": {
254
+ "type": "Link",
255
+ "linkType": "User",
256
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
257
+ }
258
+ },
259
+ "space": {
260
+ "sys": {
261
+ "type": "Link",
262
+ "linkType": "Space",
263
+ "id": "v2umtz8ths9v"
264
+ }
265
+ },
266
+ "firstPublishedAt": "2014-08-22T12:57:53.093Z",
267
+ "publishedCounter": 2,
268
+ "version": 17,
269
+ "updatedAt": "2014-10-14T13:07:06.808Z",
270
+ "updatedBy": {
271
+ "sys": {
272
+ "type": "Link",
273
+ "linkType": "User",
274
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
275
+ }
276
+ }
277
+ }
278
+ },
279
+ {
280
+ "name": "Category",
281
+ "description": "",
282
+ "fields": [
283
+ {
284
+ "id": "name",
285
+ "name": "Name",
286
+ "type": "Text",
287
+ "localized": true,
288
+ "validations": [
289
+ {
290
+ "size": {
291
+ "min": 2,
292
+ "max": 222
293
+ }
294
+ },
295
+ {
296
+ "in": [
297
+ "dom",
298
+ "chatka"
299
+ ]
300
+ }
301
+ ],
302
+ "uiid": "3ektd988mio"
303
+ },
304
+ {
305
+ "id": "description",
306
+ "name": "Description",
307
+ "type": "Text",
308
+ "uiid": "3mpw2oopurk"
309
+ },
310
+ {
311
+ "id": "valid",
312
+ "name": "Valid",
313
+ "type": "Text",
314
+ "validations": [
315
+ {
316
+ "in": [
317
+ "foo",
318
+ "bar"
319
+ ]
320
+ },
321
+ {
322
+ "size": {
323
+ "min": 10,
324
+ "max": 15
325
+ }
326
+ }
327
+ ],
328
+ "uiid": "4h7poqxt9ts"
329
+ },
330
+ {
331
+ "id": "asset_valid",
332
+ "name": "AssetValid",
333
+ "type": "Link",
334
+ "linkType": "Asset",
335
+ "validations": [
336
+ {
337
+ "linkMimetypeGroup": "pdfdocument"
338
+ }
339
+ ],
340
+ "uiid": "4kyony8vyf4"
341
+ },
342
+ {
343
+ "id": "entry_valid",
344
+ "name": "EntryValid",
345
+ "type": "Link",
346
+ "linkType": "Entry",
347
+ "validations": [
348
+ {
349
+ "linkContentType": [
350
+ "post_content_type"
351
+ ]
352
+ }
353
+ ],
354
+ "uiid": "3vuee2rpslc"
355
+ }
356
+ ],
357
+ "sys": {
358
+ "id": "category_content_type",
359
+ "type": "ContentType",
360
+ "createdAt": "2014-08-21T13:32:20.955Z",
361
+ "createdBy": {
362
+ "sys": {
363
+ "type": "Link",
364
+ "linkType": "User",
365
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
366
+ }
367
+ },
368
+ "space": {
369
+ "sys": {
370
+ "type": "Link",
371
+ "linkType": "Space",
372
+ "id": "v2umtz8ths9v"
373
+ }
374
+ },
375
+ "firstPublishedAt": "2014-08-21T13:32:27.109Z",
376
+ "publishedCounter": 10,
377
+ "version": 292,
378
+ "updatedAt": "2014-10-15T12:26:00.546Z",
379
+ "updatedBy": {
380
+ "sys": {
381
+ "type": "Link",
382
+ "linkType": "User",
383
+ "id": "0fn5fOWn4WsKFyYla1gI5h"
384
+ }
385
+ }
386
+ }
387
+ },
388
+ {
389
+ "name": "Validation",
390
+ "description": "",
391
+ "fields": [
392
+ {
393
+ "id": "number",
394
+ "name": "Number",
395
+ "type": "Number",
396
+ "validations": [
397
+ {
398
+ "range": {
399
+ "min": 50,
400
+ "max": 200
401
+ }
402
+ }
403
+ ]
404
+ },
405
+ {
406
+ "id": "entries",
407
+ "name": "entries",
408
+ "type": "Array",
409
+ "validations": [
410
+ {
411
+ "linkMimetypeGroup": "image"
412
+ }
413
+ ]
414
+ },
415
+ {
416
+ "id": "assets",
417
+ "name": "Assets",
418
+ "type": "Link",
419
+ "linkType": "Asset",
420
+ "validations": []
421
+ },
422
+ {
423
+ "id": "text",
424
+ "name": "Text",
425
+ "type": "Text",
426
+ "validations": [
427
+ {
428
+ "regexp": {
429
+ "pattern": "^such",
430
+ "flags": "im"
431
+ }
432
+ }
433
+ ]
434
+ },
435
+ {
436
+ "id": "link_field",
437
+ "validations": [
438
+ {
439
+ "linkField": true
440
+ }
441
+ ],
442
+ "name": "link"
443
+ },
444
+ {
445
+ "id": "present",
446
+ "name": "Present",
447
+ "type": "Text",
448
+ "validations": [
449
+ {
450
+ "size": {
451
+ "min": null,
452
+ "max": null
453
+ }
454
+ }
455
+ ]
456
+ }
457
+ ],
458
+ "sys": {
459
+ "id": "1JrDv4JJsYuY4KGEEgAsQU",
460
+ "type": "ContentType",
461
+ "createdAt": "2014-10-15T10:59:27.146Z",
462
+ "createdBy": {
463
+ "sys": {
464
+ "type": "Link",
465
+ "linkType": "User",
466
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
467
+ }
468
+ },
469
+ "space": {
470
+ "sys": {
471
+ "type": "Link",
472
+ "linkType": "Space",
473
+ "id": "v2umtz8ths9v"
474
+ }
475
+ },
476
+ "firstPublishedAt": "2014-10-15T11:02:51.145Z",
477
+ "publishedCounter": 1,
478
+ "publishedAt": "2014-10-15T11:02:51.145Z",
479
+ "publishedBy": {
480
+ "sys": {
481
+ "type": "Link",
482
+ "linkType": "User",
483
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
484
+ }
485
+ },
486
+ "publishedVersion": 101,
487
+ "version": 152,
488
+ "updatedAt": "2014-10-15T14:03:26.327Z",
489
+ "updatedBy": {
490
+ "sys": {
491
+ "type": "Link",
492
+ "linkType": "User",
493
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
494
+ }
495
+ }
496
+ }
497
+ }
498
+ ]
499
+ }
500
+ http_version:
501
+ recorded_at: Wed, 15 Oct 2014 14:16:04 GMT
502
+ - request:
503
+ method: get
504
+ uri: https://api.contentful.com/spaces/v2umtz8ths9v/content_types/1JrDv4JJsYuY4KGEEgAsQU
505
+ body:
506
+ encoding: US-ASCII
507
+ string: ''
508
+ headers:
509
+ User-Agent:
510
+ - RubyContenfulManagementGem/0.2.1
511
+ Authorization:
512
+ - Bearer <ACCESS_TOKEN>
513
+ Content-Type:
514
+ - application/vnd.contentful.management.v1+json
515
+ Content-Length:
516
+ - '0'
517
+ Host:
518
+ - api.contentful.com
519
+ response:
520
+ status:
521
+ code: 200
522
+ message: OK
523
+ headers:
524
+ "^access-Control-Expose-Headers":
525
+ - Etag
526
+ Access-Control-Allow-Headers:
527
+ - 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
528
+ Access-Control-Allow-Methods:
529
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
530
+ Access-Control-Allow-Origin:
531
+ - "*"
532
+ Access-Control-Max-Age:
533
+ - '1728000'
534
+ Cf-Space-Id:
535
+ - v2umtz8ths9v
536
+ Content-Type:
537
+ - application/vnd.contentful.management.v1+json
538
+ Date:
539
+ - Wed, 15 Oct 2014 14:13:43 GMT
540
+ Etag:
541
+ - '"90323a67d59b8232bbcf3225555d5f0e"'
542
+ Server:
543
+ - nginx
544
+ X-Powered-By:
545
+ - Express
546
+ Content-Length:
547
+ - '2052'
548
+ Connection:
549
+ - keep-alive
550
+ body:
551
+ encoding: UTF-8
552
+ string: |
553
+ {
554
+ "name": "Validation",
555
+ "description": "",
556
+ "fields": [
557
+ {
558
+ "id": "number",
559
+ "name": "Number",
560
+ "type": "Number",
561
+ "validations": [
562
+ {
563
+ "range": {
564
+ "min": 50,
565
+ "max": 200
566
+ }
567
+ }
568
+ ]
569
+ },
570
+ {
571
+ "id": "entries",
572
+ "name": "entries",
573
+ "type": "Array",
574
+ "validations": [
575
+ {
576
+ "linkMimetypeGroup": "image"
577
+ }
578
+ ]
579
+ },
580
+ {
581
+ "id": "assets",
582
+ "name": "Assets",
583
+ "type": "Link",
584
+ "linkType": "Asset",
585
+ "validations": []
586
+ },
587
+ {
588
+ "id": "text",
589
+ "name": "Text",
590
+ "type": "Text",
591
+ "validations": [
592
+ {
593
+ "regexp": {
594
+ "pattern": "^such",
595
+ "flags": "im"
596
+ }
597
+ }
598
+ ]
599
+ },
600
+ {
601
+ "id": "link_field",
602
+ "validations": [
603
+ {
604
+ "linkField": true
605
+ }
606
+ ],
607
+ "name": "link"
608
+ },
609
+ {
610
+ "id": "present",
611
+ "name": "Present",
612
+ "type": "Text",
613
+ "validations": [
614
+ {
615
+ "size": {
616
+ "min": null,
617
+ "max": null
618
+ }
619
+ }
620
+ ]
621
+ }
622
+ ],
623
+ "sys": {
624
+ "id": "1JrDv4JJsYuY4KGEEgAsQU",
625
+ "type": "ContentType",
626
+ "createdAt": "2014-10-15T10:59:27.146Z",
627
+ "createdBy": {
628
+ "sys": {
629
+ "type": "Link",
630
+ "linkType": "User",
631
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
632
+ }
633
+ },
634
+ "space": {
635
+ "sys": {
636
+ "type": "Link",
637
+ "linkType": "Space",
638
+ "id": "v2umtz8ths9v"
639
+ }
640
+ },
641
+ "firstPublishedAt": "2014-10-15T11:02:51.145Z",
642
+ "publishedCounter": 1,
643
+ "publishedAt": "2014-10-15T11:02:51.145Z",
644
+ "publishedBy": {
645
+ "sys": {
646
+ "type": "Link",
647
+ "linkType": "User",
648
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
649
+ }
650
+ },
651
+ "publishedVersion": 101,
652
+ "version": 152,
653
+ "updatedAt": "2014-10-15T14:03:26.327Z",
654
+ "updatedBy": {
655
+ "sys": {
656
+ "type": "Link",
657
+ "linkType": "User",
658
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
659
+ }
660
+ }
661
+ }
662
+ }
663
+ http_version:
664
+ recorded_at: Wed, 15 Oct 2014 14:16:05 GMT
665
+ - request:
666
+ method: put
667
+ uri: https://api.contentful.com/spaces/v2umtz8ths9v/content_types/1JrDv4JJsYuY4KGEEgAsQU
668
+ body:
669
+ encoding: UTF-8
670
+ string: '{"name":"Validation","description":"","fields":[{"id":"number","name":"Number","type":"Number","validations":[{"validations":"#<Contentful::Management::Validation:0x007fca22a415c0>","range":{"min":50,"max":200}}]},{"id":"entries","name":"entries","type":"Array","validations":[{"validations":"#<Contentful::Management::Validation:0x007fca22a40738>","linkMimetypeGroup":"image"}]},{"id":"assets","name":"Assets","type":"Link","linkType":"Asset","validations":[]},{"id":"text","name":"Text","type":"Text","validations":[{"validations":"#<Contentful::Management::Validation:0x007fca235772c8>","regexp":{"pattern":"^such","flags":"im"}}]},{"id":"link_field","name":"link","validations":[{"validations":"#<Contentful::Management::Validation:0x007fca235765a8>","linkField":true}]},{"id":"present","name":"Present","type":"Text","validations":[{"size":{"min":null,"max":null},"validations":"#<Contentful::Management::Validation:0x007fca235759a0>"}]},{"id":"multi","name":"Multi
671
+ Validation","type":"Text","validations":[{"in":["foo","bar","baz"]},{"regexp":{"pattern":"^such","flags":"im"}}]}]}'
672
+ headers:
673
+ User-Agent:
674
+ - RubyContenfulManagementGem/0.2.1
675
+ Authorization:
676
+ - Bearer <ACCESS_TOKEN>
677
+ Content-Type:
678
+ - application/vnd.contentful.management.v1+json
679
+ X-Contentful-Version:
680
+ - '152'
681
+ Host:
682
+ - api.contentful.com
683
+ response:
684
+ status:
685
+ code: 200
686
+ message: OK
687
+ headers:
688
+ "^access-Control-Expose-Headers":
689
+ - Etag
690
+ Access-Control-Allow-Headers:
691
+ - 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
692
+ Access-Control-Allow-Methods:
693
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
694
+ Access-Control-Allow-Origin:
695
+ - "*"
696
+ Access-Control-Max-Age:
697
+ - '1728000'
698
+ Cf-Space-Id:
699
+ - v2umtz8ths9v
700
+ Content-Type:
701
+ - application/vnd.contentful.management.v1+json
702
+ Date:
703
+ - Wed, 15 Oct 2014 14:13:44 GMT
704
+ Etag:
705
+ - '"cb7124986d0432b781cf8b13bcfe5267"'
706
+ Server:
707
+ - nginx
708
+ X-Powered-By:
709
+ - Express
710
+ Content-Length:
711
+ - '2807'
712
+ Connection:
713
+ - keep-alive
714
+ body:
715
+ encoding: UTF-8
716
+ string: |
717
+ {
718
+ "name": "Validation",
719
+ "description": "",
720
+ "fields": [
721
+ {
722
+ "id": "number",
723
+ "name": "Number",
724
+ "type": "Number",
725
+ "validations": [
726
+ {
727
+ "validations": "#<Contentful::Management::Validation:0x007fca22a415c0>",
728
+ "range": {
729
+ "min": 50,
730
+ "max": 200
731
+ }
732
+ }
733
+ ]
734
+ },
735
+ {
736
+ "id": "entries",
737
+ "name": "entries",
738
+ "type": "Array",
739
+ "validations": [
740
+ {
741
+ "validations": "#<Contentful::Management::Validation:0x007fca22a40738>",
742
+ "linkMimetypeGroup": "image"
743
+ }
744
+ ]
745
+ },
746
+ {
747
+ "id": "assets",
748
+ "name": "Assets",
749
+ "type": "Link",
750
+ "linkType": "Asset",
751
+ "validations": []
752
+ },
753
+ {
754
+ "id": "text",
755
+ "name": "Text",
756
+ "type": "Text",
757
+ "validations": [
758
+ {
759
+ "validations": "#<Contentful::Management::Validation:0x007fca235772c8>",
760
+ "regexp": {
761
+ "pattern": "^such",
762
+ "flags": "im"
763
+ }
764
+ }
765
+ ]
766
+ },
767
+ {
768
+ "id": "link_field",
769
+ "name": "link",
770
+ "validations": [
771
+ {
772
+ "validations": "#<Contentful::Management::Validation:0x007fca235765a8>",
773
+ "linkField": true
774
+ }
775
+ ]
776
+ },
777
+ {
778
+ "id": "present",
779
+ "name": "Present",
780
+ "type": "Text",
781
+ "validations": [
782
+ {
783
+ "size": {
784
+ "min": null,
785
+ "max": null
786
+ },
787
+ "validations": "#<Contentful::Management::Validation:0x007fca235759a0>"
788
+ }
789
+ ]
790
+ },
791
+ {
792
+ "id": "multi",
793
+ "name": "Multi Validation",
794
+ "type": "Text",
795
+ "validations": [
796
+ {
797
+ "in": [
798
+ "foo",
799
+ "bar",
800
+ "baz"
801
+ ]
802
+ },
803
+ {
804
+ "regexp": {
805
+ "pattern": "^such",
806
+ "flags": "im"
807
+ }
808
+ }
809
+ ]
810
+ }
811
+ ],
812
+ "sys": {
813
+ "id": "1JrDv4JJsYuY4KGEEgAsQU",
814
+ "type": "ContentType",
815
+ "createdAt": "2014-10-15T10:59:27.146Z",
816
+ "createdBy": {
817
+ "sys": {
818
+ "type": "Link",
819
+ "linkType": "User",
820
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
821
+ }
822
+ },
823
+ "space": {
824
+ "sys": {
825
+ "type": "Link",
826
+ "linkType": "Space",
827
+ "id": "v2umtz8ths9v"
828
+ }
829
+ },
830
+ "firstPublishedAt": "2014-10-15T11:02:51.145Z",
831
+ "publishedCounter": 1,
832
+ "publishedAt": "2014-10-15T11:02:51.145Z",
833
+ "publishedBy": {
834
+ "sys": {
835
+ "type": "Link",
836
+ "linkType": "User",
837
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
838
+ }
839
+ },
840
+ "publishedVersion": 101,
841
+ "version": 153,
842
+ "updatedAt": "2014-10-15T14:13:44.522Z",
843
+ "updatedBy": {
844
+ "sys": {
845
+ "type": "Link",
846
+ "linkType": "User",
847
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
848
+ }
849
+ }
850
+ }
851
+ }
852
+ http_version:
853
+ recorded_at: Wed, 15 Oct 2014 14:16:06 GMT
854
+ recorded_with: VCR 2.9.2