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,808 @@
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 13:08:51 GMT
43
+ Etag:
44
+ - '"35407b8a88882fe5717a4701910f6ce7"'
45
+ Server:
46
+ - nginx
47
+ Status:
48
+ - 200 OK
49
+ X-Contentful-Request-Id:
50
+ - f1c-2118118201
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 13:11:13 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 13:08:52 GMT
121
+ Etag:
122
+ - '"7e42460de2d32854d3c180e61c81754d"'
123
+ Server:
124
+ - nginx
125
+ X-Powered-By:
126
+ - Express
127
+ Content-Length:
128
+ - '8287'
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
+ },
443
+ {
444
+ "id": "present",
445
+ "name": "Present",
446
+ "type": "Text",
447
+ "validations": []
448
+ }
449
+ ],
450
+ "sys": {
451
+ "id": "1JrDv4JJsYuY4KGEEgAsQU",
452
+ "type": "ContentType",
453
+ "createdAt": "2014-10-15T10:59:27.146Z",
454
+ "createdBy": {
455
+ "sys": {
456
+ "type": "Link",
457
+ "linkType": "User",
458
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
459
+ }
460
+ },
461
+ "space": {
462
+ "sys": {
463
+ "type": "Link",
464
+ "linkType": "Space",
465
+ "id": "v2umtz8ths9v"
466
+ }
467
+ },
468
+ "firstPublishedAt": "2014-10-15T11:02:51.145Z",
469
+ "publishedCounter": 1,
470
+ "publishedAt": "2014-10-15T11:02:51.145Z",
471
+ "publishedBy": {
472
+ "sys": {
473
+ "type": "Link",
474
+ "linkType": "User",
475
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
476
+ }
477
+ },
478
+ "publishedVersion": 101,
479
+ "version": 148,
480
+ "updatedAt": "2014-10-15T13:07:33.335Z",
481
+ "updatedBy": {
482
+ "sys": {
483
+ "type": "Link",
484
+ "linkType": "User",
485
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
486
+ }
487
+ }
488
+ }
489
+ }
490
+ ]
491
+ }
492
+ http_version:
493
+ recorded_at: Wed, 15 Oct 2014 13:11:14 GMT
494
+ - request:
495
+ method: get
496
+ uri: https://api.contentful.com/spaces/v2umtz8ths9v/content_types/1JrDv4JJsYuY4KGEEgAsQU
497
+ body:
498
+ encoding: US-ASCII
499
+ string: ''
500
+ headers:
501
+ User-Agent:
502
+ - RubyContenfulManagementGem/0.2.1
503
+ Authorization:
504
+ - Bearer <ACCESS_TOKEN>
505
+ Content-Type:
506
+ - application/vnd.contentful.management.v1+json
507
+ Content-Length:
508
+ - '0'
509
+ Host:
510
+ - api.contentful.com
511
+ response:
512
+ status:
513
+ code: 200
514
+ message: OK
515
+ headers:
516
+ "^access-Control-Expose-Headers":
517
+ - Etag
518
+ Access-Control-Allow-Headers:
519
+ - 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
520
+ Access-Control-Allow-Methods:
521
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
522
+ Access-Control-Allow-Origin:
523
+ - "*"
524
+ Access-Control-Max-Age:
525
+ - '1728000'
526
+ Cf-Space-Id:
527
+ - v2umtz8ths9v
528
+ Content-Type:
529
+ - application/vnd.contentful.management.v1+json
530
+ Date:
531
+ - Wed, 15 Oct 2014 13:08:52 GMT
532
+ Etag:
533
+ - '"771f0fad07a1bb36159d1f4cb243c902"'
534
+ Server:
535
+ - nginx
536
+ X-Powered-By:
537
+ - Express
538
+ Content-Length:
539
+ - '1922'
540
+ Connection:
541
+ - keep-alive
542
+ body:
543
+ encoding: UTF-8
544
+ string: |
545
+ {
546
+ "name": "Validation",
547
+ "description": "",
548
+ "fields": [
549
+ {
550
+ "id": "number",
551
+ "name": "Number",
552
+ "type": "Number",
553
+ "validations": [
554
+ {
555
+ "range": {
556
+ "min": 50,
557
+ "max": 200
558
+ }
559
+ }
560
+ ]
561
+ },
562
+ {
563
+ "id": "entries",
564
+ "name": "entries",
565
+ "type": "Array",
566
+ "validations": [
567
+ {
568
+ "linkMimetypeGroup": "image"
569
+ }
570
+ ]
571
+ },
572
+ {
573
+ "id": "assets",
574
+ "name": "Assets",
575
+ "type": "Link",
576
+ "linkType": "Asset",
577
+ "validations": []
578
+ },
579
+ {
580
+ "id": "text",
581
+ "name": "Text",
582
+ "type": "Text",
583
+ "validations": [
584
+ {
585
+ "regexp": {
586
+ "pattern": "^such",
587
+ "flags": "im"
588
+ }
589
+ }
590
+ ]
591
+ },
592
+ {
593
+ "id": "link_field",
594
+ "validations": [
595
+ {
596
+ "linkField": true
597
+ }
598
+ ]
599
+ },
600
+ {
601
+ "id": "present",
602
+ "name": "Present",
603
+ "type": "Text",
604
+ "validations": []
605
+ }
606
+ ],
607
+ "sys": {
608
+ "id": "1JrDv4JJsYuY4KGEEgAsQU",
609
+ "type": "ContentType",
610
+ "createdAt": "2014-10-15T10:59:27.146Z",
611
+ "createdBy": {
612
+ "sys": {
613
+ "type": "Link",
614
+ "linkType": "User",
615
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
616
+ }
617
+ },
618
+ "space": {
619
+ "sys": {
620
+ "type": "Link",
621
+ "linkType": "Space",
622
+ "id": "v2umtz8ths9v"
623
+ }
624
+ },
625
+ "firstPublishedAt": "2014-10-15T11:02:51.145Z",
626
+ "publishedCounter": 1,
627
+ "publishedAt": "2014-10-15T11:02:51.145Z",
628
+ "publishedBy": {
629
+ "sys": {
630
+ "type": "Link",
631
+ "linkType": "User",
632
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
633
+ }
634
+ },
635
+ "publishedVersion": 101,
636
+ "version": 148,
637
+ "updatedAt": "2014-10-15T13:07:33.335Z",
638
+ "updatedBy": {
639
+ "sys": {
640
+ "type": "Link",
641
+ "linkType": "User",
642
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
643
+ }
644
+ }
645
+ }
646
+ }
647
+ http_version:
648
+ recorded_at: Wed, 15 Oct 2014 13:11:15 GMT
649
+ - request:
650
+ method: put
651
+ uri: https://api.contentful.com/spaces/v2umtz8ths9v/content_types/1JrDv4JJsYuY4KGEEgAsQU
652
+ body:
653
+ encoding: UTF-8
654
+ string: '{"name":"Validation","description":"","fields":[{"id":"number","name":"Number","type":"Number","validations":[{"range":{"min":50,"max":200}}]},{"id":"entries","name":"entries","type":"Array","validations":[{"linkMimetypeGroup":"image"}]},{"id":"assets","name":"Assets","type":"Link","linkType":"Asset","validations":[]},{"id":"text","name":"Text","type":"Text","validations":[{"regexp":{"pattern":"^such","flags":"im"}}]},{"id":"link_field","validations":[{"linkField":true}]},{"id":"present","name":"Present","type":"Text","validations":[{"present":true}]}]}'
655
+ headers:
656
+ User-Agent:
657
+ - RubyContenfulManagementGem/0.2.1
658
+ Authorization:
659
+ - Bearer <ACCESS_TOKEN>
660
+ Content-Type:
661
+ - application/vnd.contentful.management.v1+json
662
+ X-Contentful-Version:
663
+ - '148'
664
+ Host:
665
+ - api.contentful.com
666
+ response:
667
+ status:
668
+ code: 200
669
+ message: OK
670
+ headers:
671
+ "^access-Control-Expose-Headers":
672
+ - Etag
673
+ Access-Control-Allow-Headers:
674
+ - 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
675
+ Access-Control-Allow-Methods:
676
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
677
+ Access-Control-Allow-Origin:
678
+ - "*"
679
+ Access-Control-Max-Age:
680
+ - '1728000'
681
+ Cf-Space-Id:
682
+ - v2umtz8ths9v
683
+ Content-Type:
684
+ - application/vnd.contentful.management.v1+json
685
+ Date:
686
+ - Wed, 15 Oct 2014 13:08:53 GMT
687
+ Etag:
688
+ - '"b1e1bfe45b648640d6b5668537415e75"'
689
+ Server:
690
+ - nginx
691
+ X-Powered-By:
692
+ - Express
693
+ Content-Length:
694
+ - '1975'
695
+ Connection:
696
+ - keep-alive
697
+ body:
698
+ encoding: UTF-8
699
+ string: |
700
+ {
701
+ "name": "Validation",
702
+ "description": "",
703
+ "fields": [
704
+ {
705
+ "id": "number",
706
+ "name": "Number",
707
+ "type": "Number",
708
+ "validations": [
709
+ {
710
+ "range": {
711
+ "min": 50,
712
+ "max": 200
713
+ }
714
+ }
715
+ ]
716
+ },
717
+ {
718
+ "id": "entries",
719
+ "name": "entries",
720
+ "type": "Array",
721
+ "validations": [
722
+ {
723
+ "linkMimetypeGroup": "image"
724
+ }
725
+ ]
726
+ },
727
+ {
728
+ "id": "assets",
729
+ "name": "Assets",
730
+ "type": "Link",
731
+ "linkType": "Asset",
732
+ "validations": []
733
+ },
734
+ {
735
+ "id": "text",
736
+ "name": "Text",
737
+ "type": "Text",
738
+ "validations": [
739
+ {
740
+ "regexp": {
741
+ "pattern": "^such",
742
+ "flags": "im"
743
+ }
744
+ }
745
+ ]
746
+ },
747
+ {
748
+ "id": "link_field",
749
+ "validations": [
750
+ {
751
+ "linkField": true
752
+ }
753
+ ]
754
+ },
755
+ {
756
+ "id": "present",
757
+ "name": "Present",
758
+ "type": "Text",
759
+ "validations": [
760
+ {
761
+ "present": true
762
+ }
763
+ ]
764
+ }
765
+ ],
766
+ "sys": {
767
+ "id": "1JrDv4JJsYuY4KGEEgAsQU",
768
+ "type": "ContentType",
769
+ "createdAt": "2014-10-15T10:59:27.146Z",
770
+ "createdBy": {
771
+ "sys": {
772
+ "type": "Link",
773
+ "linkType": "User",
774
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
775
+ }
776
+ },
777
+ "space": {
778
+ "sys": {
779
+ "type": "Link",
780
+ "linkType": "Space",
781
+ "id": "v2umtz8ths9v"
782
+ }
783
+ },
784
+ "firstPublishedAt": "2014-10-15T11:02:51.145Z",
785
+ "publishedCounter": 1,
786
+ "publishedAt": "2014-10-15T11:02:51.145Z",
787
+ "publishedBy": {
788
+ "sys": {
789
+ "type": "Link",
790
+ "linkType": "User",
791
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
792
+ }
793
+ },
794
+ "publishedVersion": 101,
795
+ "version": 149,
796
+ "updatedAt": "2014-10-15T13:08:53.195Z",
797
+ "updatedBy": {
798
+ "sys": {
799
+ "type": "Link",
800
+ "linkType": "User",
801
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
802
+ }
803
+ }
804
+ }
805
+ }
806
+ http_version:
807
+ recorded_at: Wed, 15 Oct 2014 13:11:15 GMT
808
+ recorded_with: VCR 2.9.2