contentful-management 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
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,791 @@
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 11:14:06 GMT
43
+ Etag:
44
+ - '"35407b8a88882fe5717a4701910f6ce7"'
45
+ Server:
46
+ - nginx
47
+ Status:
48
+ - 200 OK
49
+ X-Contentful-Request-Id:
50
+ - f1c-2118033546
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 11:16:30 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 11:14:06 GMT
121
+ Etag:
122
+ - '"014c350acbcfbb0ddbbbc2f1537ce777"'
123
+ Server:
124
+ - nginx
125
+ X-Powered-By:
126
+ - Express
127
+ Content-Length:
128
+ - '7949'
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
+ "fields": [
281
+ {
282
+ "name": "number",
283
+ "id": "number",
284
+ "uiid": "2pzin97faww",
285
+ "type": "Integer",
286
+ "validations": [
287
+ {
288
+ "range": {
289
+ "min": 5,
290
+ "max": 20
291
+ }
292
+ }
293
+ ]
294
+ },
295
+ {
296
+ "name": "entries",
297
+ "id": "entries",
298
+ "type": "Array",
299
+ "uiid": "35tq2mnw1s0",
300
+ "items": {
301
+ "type": "Link",
302
+ "linkType": "Entry",
303
+ "validations": [
304
+ {
305
+ "linkContentType": [
306
+ "post_content_type"
307
+ ]
308
+ }
309
+ ]
310
+ }
311
+ },
312
+ {
313
+ "name": "Assets",
314
+ "id": "assets",
315
+ "type": "Array",
316
+ "uiid": "3oha9upz400",
317
+ "items": {
318
+ "type": "Link",
319
+ "linkType": "Asset",
320
+ "validations": [
321
+ {
322
+ "linkMimetypeGroup": "image"
323
+ }
324
+ ]
325
+ }
326
+ }
327
+ ],
328
+ "name": "Validation",
329
+ "sys": {
330
+ "id": "1JrDv4JJsYuY4KGEEgAsQU",
331
+ "type": "ContentType",
332
+ "createdAt": "2014-10-15T10:59:27.146Z",
333
+ "createdBy": {
334
+ "sys": {
335
+ "type": "Link",
336
+ "linkType": "User",
337
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
338
+ }
339
+ },
340
+ "space": {
341
+ "sys": {
342
+ "type": "Link",
343
+ "linkType": "Space",
344
+ "id": "v2umtz8ths9v"
345
+ }
346
+ },
347
+ "firstPublishedAt": "2014-10-15T11:02:51.145Z",
348
+ "publishedCounter": 1,
349
+ "publishedAt": "2014-10-15T11:02:51.145Z",
350
+ "publishedBy": {
351
+ "sys": {
352
+ "type": "Link",
353
+ "linkType": "User",
354
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
355
+ }
356
+ },
357
+ "publishedVersion": 101,
358
+ "version": 102,
359
+ "updatedAt": "2014-10-15T11:02:51.156Z",
360
+ "updatedBy": {
361
+ "sys": {
362
+ "type": "Link",
363
+ "linkType": "User",
364
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
365
+ }
366
+ }
367
+ }
368
+ },
369
+ {
370
+ "name": "Category",
371
+ "description": "",
372
+ "fields": [
373
+ {
374
+ "id": "name",
375
+ "name": "Name",
376
+ "type": "Text",
377
+ "localized": true,
378
+ "validations": [
379
+ {
380
+ "size": {
381
+ "min": 2,
382
+ "max": 222
383
+ }
384
+ },
385
+ {
386
+ "in": [
387
+ "dom",
388
+ "chatka"
389
+ ]
390
+ }
391
+ ]
392
+ },
393
+ {
394
+ "id": "description",
395
+ "name": "Description",
396
+ "type": "Text"
397
+ },
398
+ {
399
+ "id": "valid",
400
+ "name": "Valid",
401
+ "type": "Text",
402
+ "validations": [
403
+ {
404
+ "in": [
405
+ "foo",
406
+ "bar"
407
+ ]
408
+ },
409
+ {
410
+ "size": {
411
+ "min": 5,
412
+ "max": 10
413
+ }
414
+ }
415
+ ]
416
+ },
417
+ {
418
+ "id": "asset_valid",
419
+ "name": "AssetValid",
420
+ "type": "Link",
421
+ "linkType": "Asset",
422
+ "validations": [
423
+ {
424
+ "linkMimetypeGroup": "pdfdocument"
425
+ }
426
+ ]
427
+ },
428
+ {
429
+ "id": "entry_valid",
430
+ "name": "EntryValid",
431
+ "type": "Link",
432
+ "linkType": "Entry",
433
+ "validations": [
434
+ {
435
+ "linkContentType": [
436
+ "post_content_type"
437
+ ]
438
+ }
439
+ ]
440
+ }
441
+ ],
442
+ "sys": {
443
+ "id": "category_content_type",
444
+ "type": "ContentType",
445
+ "createdAt": "2014-08-21T13:32:20.955Z",
446
+ "createdBy": {
447
+ "sys": {
448
+ "type": "Link",
449
+ "linkType": "User",
450
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
451
+ }
452
+ },
453
+ "space": {
454
+ "sys": {
455
+ "type": "Link",
456
+ "linkType": "Space",
457
+ "id": "v2umtz8ths9v"
458
+ }
459
+ },
460
+ "firstPublishedAt": "2014-08-21T13:32:27.109Z",
461
+ "publishedCounter": 10,
462
+ "version": 290,
463
+ "updatedAt": "2014-10-15T11:12:54.413Z",
464
+ "updatedBy": {
465
+ "sys": {
466
+ "type": "Link",
467
+ "linkType": "User",
468
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
469
+ }
470
+ }
471
+ }
472
+ }
473
+ ]
474
+ }
475
+ http_version:
476
+ recorded_at: Wed, 15 Oct 2014 11:16:31 GMT
477
+ - request:
478
+ method: get
479
+ uri: https://api.contentful.com/spaces/v2umtz8ths9v/content_types/category_content_type
480
+ body:
481
+ encoding: US-ASCII
482
+ string: ''
483
+ headers:
484
+ User-Agent:
485
+ - RubyContenfulManagementGem/0.2.1
486
+ Authorization:
487
+ - Bearer <ACCESS_TOKEN>
488
+ Content-Type:
489
+ - application/vnd.contentful.management.v1+json
490
+ Content-Length:
491
+ - '0'
492
+ Host:
493
+ - api.contentful.com
494
+ response:
495
+ status:
496
+ code: 200
497
+ message: OK
498
+ headers:
499
+ "^access-Control-Expose-Headers":
500
+ - Etag
501
+ Access-Control-Allow-Headers:
502
+ - 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
503
+ Access-Control-Allow-Methods:
504
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
505
+ Access-Control-Allow-Origin:
506
+ - "*"
507
+ Access-Control-Max-Age:
508
+ - '1728000'
509
+ Cf-Space-Id:
510
+ - v2umtz8ths9v
511
+ Content-Type:
512
+ - application/vnd.contentful.management.v1+json
513
+ Date:
514
+ - Wed, 15 Oct 2014 11:14:07 GMT
515
+ Etag:
516
+ - '"ee0cb570fe82476ffd30788ccce299aa"'
517
+ Server:
518
+ - nginx
519
+ X-Powered-By:
520
+ - Express
521
+ Content-Length:
522
+ - '1899'
523
+ Connection:
524
+ - keep-alive
525
+ body:
526
+ encoding: UTF-8
527
+ string: |
528
+ {
529
+ "name": "Category",
530
+ "description": "",
531
+ "fields": [
532
+ {
533
+ "id": "name",
534
+ "name": "Name",
535
+ "type": "Text",
536
+ "localized": true,
537
+ "validations": [
538
+ {
539
+ "size": {
540
+ "min": 2,
541
+ "max": 222
542
+ }
543
+ },
544
+ {
545
+ "in": [
546
+ "dom",
547
+ "chatka"
548
+ ]
549
+ }
550
+ ]
551
+ },
552
+ {
553
+ "id": "description",
554
+ "name": "Description",
555
+ "type": "Text"
556
+ },
557
+ {
558
+ "id": "valid",
559
+ "name": "Valid",
560
+ "type": "Text",
561
+ "validations": [
562
+ {
563
+ "in": [
564
+ "foo",
565
+ "bar"
566
+ ]
567
+ },
568
+ {
569
+ "size": {
570
+ "min": 5,
571
+ "max": 10
572
+ }
573
+ }
574
+ ]
575
+ },
576
+ {
577
+ "id": "asset_valid",
578
+ "name": "AssetValid",
579
+ "type": "Link",
580
+ "linkType": "Asset",
581
+ "validations": [
582
+ {
583
+ "linkMimetypeGroup": "pdfdocument"
584
+ }
585
+ ]
586
+ },
587
+ {
588
+ "id": "entry_valid",
589
+ "name": "EntryValid",
590
+ "type": "Link",
591
+ "linkType": "Entry",
592
+ "validations": [
593
+ {
594
+ "linkContentType": [
595
+ "post_content_type"
596
+ ]
597
+ }
598
+ ]
599
+ }
600
+ ],
601
+ "sys": {
602
+ "id": "category_content_type",
603
+ "type": "ContentType",
604
+ "createdAt": "2014-08-21T13:32:20.955Z",
605
+ "createdBy": {
606
+ "sys": {
607
+ "type": "Link",
608
+ "linkType": "User",
609
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
610
+ }
611
+ },
612
+ "space": {
613
+ "sys": {
614
+ "type": "Link",
615
+ "linkType": "Space",
616
+ "id": "v2umtz8ths9v"
617
+ }
618
+ },
619
+ "firstPublishedAt": "2014-08-21T13:32:27.109Z",
620
+ "publishedCounter": 10,
621
+ "version": 290,
622
+ "updatedAt": "2014-10-15T11:12:54.413Z",
623
+ "updatedBy": {
624
+ "sys": {
625
+ "type": "Link",
626
+ "linkType": "User",
627
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
628
+ }
629
+ }
630
+ }
631
+ }
632
+ http_version:
633
+ recorded_at: Wed, 15 Oct 2014 11:16:31 GMT
634
+ - request:
635
+ method: put
636
+ uri: https://api.contentful.com/spaces/v2umtz8ths9v/content_types/category_content_type
637
+ body:
638
+ encoding: UTF-8
639
+ string: '{"name":"Category","description":"","fields":[{"id":"name","name":"Name","type":"Text","localized":true,"validations":[{"size":{"min":2,"max":222}},{"in":["dom","chatka"]}]},{"id":"description","name":"Description","type":"Text"},{"id":"valid","name":"Valid","type":"Text","validations":[{"in":["foo","bar"]},{"size":{"min":10,"max":15}}]},{"id":"asset_valid","name":"AssetValid","type":"Link","linkType":"Asset","validations":[{"linkMimetypeGroup":"pdfdocument"}]},{"id":"entry_valid","name":"EntryValid","type":"Link","linkType":"Entry","validations":[{"linkContentType":["post_content_type"]}]}]}'
640
+ headers:
641
+ User-Agent:
642
+ - RubyContenfulManagementGem/0.2.1
643
+ Authorization:
644
+ - Bearer <ACCESS_TOKEN>
645
+ Content-Type:
646
+ - application/vnd.contentful.management.v1+json
647
+ X-Contentful-Version:
648
+ - '290'
649
+ Host:
650
+ - api.contentful.com
651
+ response:
652
+ status:
653
+ code: 200
654
+ message: OK
655
+ headers:
656
+ "^access-Control-Expose-Headers":
657
+ - Etag
658
+ Access-Control-Allow-Headers:
659
+ - 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
660
+ Access-Control-Allow-Methods:
661
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
662
+ Access-Control-Allow-Origin:
663
+ - "*"
664
+ Access-Control-Max-Age:
665
+ - '1728000'
666
+ Cf-Space-Id:
667
+ - v2umtz8ths9v
668
+ Content-Type:
669
+ - application/vnd.contentful.management.v1+json
670
+ Date:
671
+ - Wed, 15 Oct 2014 11:14:07 GMT
672
+ Etag:
673
+ - '"8a5aad951ffdac8c88f10ce2422602c3"'
674
+ Server:
675
+ - nginx
676
+ X-Powered-By:
677
+ - Express
678
+ Content-Length:
679
+ - '1900'
680
+ Connection:
681
+ - keep-alive
682
+ body:
683
+ encoding: UTF-8
684
+ string: |
685
+ {
686
+ "name": "Category",
687
+ "description": "",
688
+ "fields": [
689
+ {
690
+ "id": "name",
691
+ "name": "Name",
692
+ "type": "Text",
693
+ "localized": true,
694
+ "validations": [
695
+ {
696
+ "size": {
697
+ "min": 2,
698
+ "max": 222
699
+ }
700
+ },
701
+ {
702
+ "in": [
703
+ "dom",
704
+ "chatka"
705
+ ]
706
+ }
707
+ ]
708
+ },
709
+ {
710
+ "id": "description",
711
+ "name": "Description",
712
+ "type": "Text"
713
+ },
714
+ {
715
+ "id": "valid",
716
+ "name": "Valid",
717
+ "type": "Text",
718
+ "validations": [
719
+ {
720
+ "in": [
721
+ "foo",
722
+ "bar"
723
+ ]
724
+ },
725
+ {
726
+ "size": {
727
+ "min": 10,
728
+ "max": 15
729
+ }
730
+ }
731
+ ]
732
+ },
733
+ {
734
+ "id": "asset_valid",
735
+ "name": "AssetValid",
736
+ "type": "Link",
737
+ "linkType": "Asset",
738
+ "validations": [
739
+ {
740
+ "linkMimetypeGroup": "pdfdocument"
741
+ }
742
+ ]
743
+ },
744
+ {
745
+ "id": "entry_valid",
746
+ "name": "EntryValid",
747
+ "type": "Link",
748
+ "linkType": "Entry",
749
+ "validations": [
750
+ {
751
+ "linkContentType": [
752
+ "post_content_type"
753
+ ]
754
+ }
755
+ ]
756
+ }
757
+ ],
758
+ "sys": {
759
+ "id": "category_content_type",
760
+ "type": "ContentType",
761
+ "createdAt": "2014-08-21T13:32:20.955Z",
762
+ "createdBy": {
763
+ "sys": {
764
+ "type": "Link",
765
+ "linkType": "User",
766
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
767
+ }
768
+ },
769
+ "space": {
770
+ "sys": {
771
+ "type": "Link",
772
+ "linkType": "Space",
773
+ "id": "v2umtz8ths9v"
774
+ }
775
+ },
776
+ "firstPublishedAt": "2014-08-21T13:32:27.109Z",
777
+ "publishedCounter": 10,
778
+ "version": 291,
779
+ "updatedAt": "2014-10-15T11:14:07.911Z",
780
+ "updatedBy": {
781
+ "sys": {
782
+ "type": "Link",
783
+ "linkType": "User",
784
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
785
+ }
786
+ }
787
+ }
788
+ }
789
+ http_version:
790
+ recorded_at: Wed, 15 Oct 2014 11:16:32 GMT
791
+ recorded_with: VCR 2.9.2