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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +37 -8
- data/Gemfile +0 -1
- data/README.md +130 -0
- data/Rakefile +0 -1
- data/contentful-management.gemspec +0 -1
- data/examples/blog.rb +1 -1
- data/lib/contentful/management.rb +0 -1
- data/lib/contentful/management/array.rb +0 -1
- data/lib/contentful/management/asset.rb +65 -26
- data/lib/contentful/management/client.rb +19 -9
- data/lib/contentful/management/content_type.rb +43 -28
- data/lib/contentful/management/dynamic_entry.rb +15 -15
- data/lib/contentful/management/entry.rb +73 -40
- data/lib/contentful/management/error.rb +6 -1
- data/lib/contentful/management/field.rb +63 -8
- data/lib/contentful/management/file.rb +0 -1
- data/lib/contentful/management/http_client.rb +0 -1
- data/lib/contentful/management/link.rb +0 -1
- data/lib/contentful/management/locale.rb +11 -3
- data/lib/contentful/management/location.rb +0 -1
- data/lib/contentful/management/request.rb +5 -7
- data/lib/contentful/management/resource.rb +3 -3
- data/lib/contentful/management/resource/array_like.rb +0 -1
- data/lib/contentful/management/resource/fields.rb +1 -2
- data/lib/contentful/management/resource/refresher.rb +3 -3
- data/lib/contentful/management/resource/system_properties.rb +0 -1
- data/lib/contentful/management/resource_builder.rb +16 -27
- data/lib/contentful/management/response.rb +36 -32
- data/lib/contentful/management/space.rb +16 -6
- data/lib/contentful/management/space_webhook_methods_factory.rb +0 -4
- data/lib/contentful/management/support.rb +0 -1
- data/lib/contentful/management/validation.rb +34 -0
- data/lib/contentful/management/version.rb +1 -2
- data/lib/contentful/management/webhook.rb +17 -10
- data/spec/fixtures/vcr_cassettes/content_type/validation/in.yml +588 -0
- data/spec/fixtures/vcr_cassettes/content_type/validation/in_add.yml +620 -0
- data/spec/fixtures/vcr_cassettes/content_type/validation/in_update.yml +668 -0
- data/spec/fixtures/vcr_cassettes/content_type/validation/link_content_type.yml +749 -0
- data/spec/fixtures/vcr_cassettes/content_type/validation/link_field.yml +770 -0
- data/spec/fixtures/vcr_cassettes/content_type/validation/link_mimetype_group.yml +766 -0
- data/spec/fixtures/vcr_cassettes/content_type/validation/multiple_add.yml +854 -0
- data/spec/fixtures/vcr_cassettes/content_type/validation/present.yml +808 -0
- data/spec/fixtures/vcr_cassettes/content_type/validation/range.yml +683 -0
- data/spec/fixtures/vcr_cassettes/content_type/validation/range_update.yml +697 -0
- data/spec/fixtures/vcr_cassettes/content_type/validation/regexp.yml +720 -0
- data/spec/fixtures/vcr_cassettes/content_type/validation/size.yml +791 -0
- data/spec/fixtures/vcr_cassettes/entry/service_unavailable.yml +52 -0
- data/spec/fixtures/vcr_cassettes/space/webhook/create.yml +439 -0
- data/spec/lib/contentful/management/asset_spec.rb +16 -16
- data/spec/lib/contentful/management/client_spec.rb +0 -1
- data/spec/lib/contentful/management/content_type_spec.rb +143 -1
- data/spec/lib/contentful/management/entry_spec.rb +10 -4
- data/spec/lib/contentful/management/locale_spec.rb +0 -1
- data/spec/lib/contentful/management/space_spec.rb +9 -1
- data/spec/lib/contentful/management/webhook_spec.rb +0 -1
- data/spec/spec_helper.rb +0 -1
- data/spec/support/vcr.rb +0 -1
- metadata +63 -62
@@ -0,0 +1,668 @@
|
|
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 10:19:53 GMT
|
43
|
+
Etag:
|
44
|
+
- '"35407b8a88882fe5717a4701910f6ce7"'
|
45
|
+
Server:
|
46
|
+
- nginx
|
47
|
+
Status:
|
48
|
+
- 200 OK
|
49
|
+
X-Contentful-Request-Id:
|
50
|
+
- 85f-806567220
|
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 10:22: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 10:19:54 GMT
|
121
|
+
Etag:
|
122
|
+
- '"556c8203b43b00e59f0eef243e2c8bba"'
|
123
|
+
Server:
|
124
|
+
- nginx
|
125
|
+
X-Powered-By:
|
126
|
+
- Express
|
127
|
+
Content-Length:
|
128
|
+
- '5604'
|
129
|
+
Connection:
|
130
|
+
- keep-alive
|
131
|
+
body:
|
132
|
+
encoding: UTF-8
|
133
|
+
string: |
|
134
|
+
{
|
135
|
+
"sys": {
|
136
|
+
"type": "Array"
|
137
|
+
},
|
138
|
+
"total": 3,
|
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": "2l6zmegcf7k"
|
303
|
+
},
|
304
|
+
{
|
305
|
+
"id": "description",
|
306
|
+
"name": "Description",
|
307
|
+
"type": "Text",
|
308
|
+
"uiid": "3bohdopuoe8"
|
309
|
+
},
|
310
|
+
{
|
311
|
+
"id": "valid",
|
312
|
+
"name": "Valid",
|
313
|
+
"type": "Text",
|
314
|
+
"validations": [
|
315
|
+
{
|
316
|
+
"in": [
|
317
|
+
"foo"
|
318
|
+
]
|
319
|
+
},
|
320
|
+
{
|
321
|
+
"size": {
|
322
|
+
"min": 2,
|
323
|
+
"max": 10
|
324
|
+
}
|
325
|
+
}
|
326
|
+
],
|
327
|
+
"uiid": "3cjnzwlaby8"
|
328
|
+
},
|
329
|
+
{
|
330
|
+
"name": "AssetValid",
|
331
|
+
"id": "asset_valid",
|
332
|
+
"type": "Link",
|
333
|
+
"uiid": "4hnglpm9log",
|
334
|
+
"linkType": "Asset",
|
335
|
+
"validations": [
|
336
|
+
{
|
337
|
+
"linkMimetypeGroup": "pdfdocument"
|
338
|
+
}
|
339
|
+
]
|
340
|
+
}
|
341
|
+
],
|
342
|
+
"sys": {
|
343
|
+
"id": "category_content_type",
|
344
|
+
"type": "ContentType",
|
345
|
+
"createdAt": "2014-08-21T13:32:20.955Z",
|
346
|
+
"createdBy": {
|
347
|
+
"sys": {
|
348
|
+
"type": "Link",
|
349
|
+
"linkType": "User",
|
350
|
+
"id": "1E7acJL8I5XUXAMHQt9Grs"
|
351
|
+
}
|
352
|
+
},
|
353
|
+
"space": {
|
354
|
+
"sys": {
|
355
|
+
"type": "Link",
|
356
|
+
"linkType": "Space",
|
357
|
+
"id": "v2umtz8ths9v"
|
358
|
+
}
|
359
|
+
},
|
360
|
+
"firstPublishedAt": "2014-08-21T13:32:27.109Z",
|
361
|
+
"publishedCounter": 10,
|
362
|
+
"version": 262,
|
363
|
+
"updatedAt": "2014-10-15T10:19:11.796Z",
|
364
|
+
"updatedBy": {
|
365
|
+
"sys": {
|
366
|
+
"type": "Link",
|
367
|
+
"linkType": "User",
|
368
|
+
"id": "1E7acJL8I5XUXAMHQt9Grs"
|
369
|
+
}
|
370
|
+
}
|
371
|
+
}
|
372
|
+
}
|
373
|
+
]
|
374
|
+
}
|
375
|
+
http_version:
|
376
|
+
recorded_at: Wed, 15 Oct 2014 10:22:14 GMT
|
377
|
+
- request:
|
378
|
+
method: get
|
379
|
+
uri: https://api.contentful.com/spaces/v2umtz8ths9v/content_types/category_content_type
|
380
|
+
body:
|
381
|
+
encoding: US-ASCII
|
382
|
+
string: ''
|
383
|
+
headers:
|
384
|
+
User-Agent:
|
385
|
+
- RubyContenfulManagementGem/0.2.1
|
386
|
+
Authorization:
|
387
|
+
- Bearer <ACCESS_TOKEN>
|
388
|
+
Content-Type:
|
389
|
+
- application/vnd.contentful.management.v1+json
|
390
|
+
Content-Length:
|
391
|
+
- '0'
|
392
|
+
Host:
|
393
|
+
- api.contentful.com
|
394
|
+
response:
|
395
|
+
status:
|
396
|
+
code: 200
|
397
|
+
message: OK
|
398
|
+
headers:
|
399
|
+
"^access-Control-Expose-Headers":
|
400
|
+
- Etag
|
401
|
+
Access-Control-Allow-Headers:
|
402
|
+
- 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
|
403
|
+
Access-Control-Allow-Methods:
|
404
|
+
- DELETE,GET,HEAD,POST,PUT,OPTIONS
|
405
|
+
Access-Control-Allow-Origin:
|
406
|
+
- "*"
|
407
|
+
Access-Control-Max-Age:
|
408
|
+
- '1728000'
|
409
|
+
Cf-Space-Id:
|
410
|
+
- v2umtz8ths9v
|
411
|
+
Content-Type:
|
412
|
+
- application/vnd.contentful.management.v1+json
|
413
|
+
Date:
|
414
|
+
- Wed, 15 Oct 2014 10:19:54 GMT
|
415
|
+
Etag:
|
416
|
+
- '"983bdb0486968abd0c971e574b978389"'
|
417
|
+
Server:
|
418
|
+
- nginx
|
419
|
+
X-Powered-By:
|
420
|
+
- Express
|
421
|
+
Content-Length:
|
422
|
+
- '1753'
|
423
|
+
Connection:
|
424
|
+
- keep-alive
|
425
|
+
body:
|
426
|
+
encoding: UTF-8
|
427
|
+
string: |
|
428
|
+
{
|
429
|
+
"name": "Category",
|
430
|
+
"description": "",
|
431
|
+
"fields": [
|
432
|
+
{
|
433
|
+
"id": "name",
|
434
|
+
"name": "Name",
|
435
|
+
"type": "Text",
|
436
|
+
"localized": true,
|
437
|
+
"validations": [
|
438
|
+
{
|
439
|
+
"size": {
|
440
|
+
"min": 2,
|
441
|
+
"max": 222
|
442
|
+
}
|
443
|
+
},
|
444
|
+
{
|
445
|
+
"in": [
|
446
|
+
"dom",
|
447
|
+
"chatka"
|
448
|
+
]
|
449
|
+
}
|
450
|
+
],
|
451
|
+
"uiid": "2l6zmegcf7k"
|
452
|
+
},
|
453
|
+
{
|
454
|
+
"id": "description",
|
455
|
+
"name": "Description",
|
456
|
+
"type": "Text",
|
457
|
+
"uiid": "3bohdopuoe8"
|
458
|
+
},
|
459
|
+
{
|
460
|
+
"id": "valid",
|
461
|
+
"name": "Valid",
|
462
|
+
"type": "Text",
|
463
|
+
"validations": [
|
464
|
+
{
|
465
|
+
"in": [
|
466
|
+
"foo"
|
467
|
+
]
|
468
|
+
},
|
469
|
+
{
|
470
|
+
"size": {
|
471
|
+
"min": 2,
|
472
|
+
"max": 10
|
473
|
+
}
|
474
|
+
}
|
475
|
+
],
|
476
|
+
"uiid": "3cjnzwlaby8"
|
477
|
+
},
|
478
|
+
{
|
479
|
+
"name": "AssetValid",
|
480
|
+
"id": "asset_valid",
|
481
|
+
"type": "Link",
|
482
|
+
"uiid": "4hnglpm9log",
|
483
|
+
"linkType": "Asset",
|
484
|
+
"validations": [
|
485
|
+
{
|
486
|
+
"linkMimetypeGroup": "pdfdocument"
|
487
|
+
}
|
488
|
+
]
|
489
|
+
}
|
490
|
+
],
|
491
|
+
"sys": {
|
492
|
+
"id": "category_content_type",
|
493
|
+
"type": "ContentType",
|
494
|
+
"createdAt": "2014-08-21T13:32:20.955Z",
|
495
|
+
"createdBy": {
|
496
|
+
"sys": {
|
497
|
+
"type": "Link",
|
498
|
+
"linkType": "User",
|
499
|
+
"id": "1E7acJL8I5XUXAMHQt9Grs"
|
500
|
+
}
|
501
|
+
},
|
502
|
+
"space": {
|
503
|
+
"sys": {
|
504
|
+
"type": "Link",
|
505
|
+
"linkType": "Space",
|
506
|
+
"id": "v2umtz8ths9v"
|
507
|
+
}
|
508
|
+
},
|
509
|
+
"firstPublishedAt": "2014-08-21T13:32:27.109Z",
|
510
|
+
"publishedCounter": 10,
|
511
|
+
"version": 262,
|
512
|
+
"updatedAt": "2014-10-15T10:19:11.796Z",
|
513
|
+
"updatedBy": {
|
514
|
+
"sys": {
|
515
|
+
"type": "Link",
|
516
|
+
"linkType": "User",
|
517
|
+
"id": "1E7acJL8I5XUXAMHQt9Grs"
|
518
|
+
}
|
519
|
+
}
|
520
|
+
}
|
521
|
+
}
|
522
|
+
http_version:
|
523
|
+
recorded_at: Wed, 15 Oct 2014 10:22:15 GMT
|
524
|
+
- request:
|
525
|
+
method: put
|
526
|
+
uri: https://api.contentful.com/spaces/v2umtz8ths9v/content_types/category_content_type
|
527
|
+
body:
|
528
|
+
encoding: UTF-8
|
529
|
+
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":2,"max":10}}]},{"id":"asset_valid","name":"AssetValid","type":"Link","linkType":"Asset","validations":[{"linkMimetypeGroup":"pdfdocument"}]}]}'
|
530
|
+
headers:
|
531
|
+
User-Agent:
|
532
|
+
- RubyContenfulManagementGem/0.2.1
|
533
|
+
Authorization:
|
534
|
+
- Bearer <ACCESS_TOKEN>
|
535
|
+
Content-Type:
|
536
|
+
- application/vnd.contentful.management.v1+json
|
537
|
+
X-Contentful-Version:
|
538
|
+
- '262'
|
539
|
+
Host:
|
540
|
+
- api.contentful.com
|
541
|
+
response:
|
542
|
+
status:
|
543
|
+
code: 200
|
544
|
+
message: OK
|
545
|
+
headers:
|
546
|
+
"^access-Control-Expose-Headers":
|
547
|
+
- Etag
|
548
|
+
Access-Control-Allow-Headers:
|
549
|
+
- 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
|
550
|
+
Access-Control-Allow-Methods:
|
551
|
+
- DELETE,GET,HEAD,POST,PUT,OPTIONS
|
552
|
+
Access-Control-Allow-Origin:
|
553
|
+
- "*"
|
554
|
+
Access-Control-Max-Age:
|
555
|
+
- '1728000'
|
556
|
+
Cf-Space-Id:
|
557
|
+
- v2umtz8ths9v
|
558
|
+
Content-Type:
|
559
|
+
- application/vnd.contentful.management.v1+json
|
560
|
+
Date:
|
561
|
+
- Wed, 15 Oct 2014 10:20:09 GMT
|
562
|
+
Etag:
|
563
|
+
- '"77807471854f8ebcb851ebcb193bc0a0"'
|
564
|
+
Server:
|
565
|
+
- nginx
|
566
|
+
X-Powered-By:
|
567
|
+
- Express
|
568
|
+
Content-Length:
|
569
|
+
- '1656'
|
570
|
+
Connection:
|
571
|
+
- keep-alive
|
572
|
+
body:
|
573
|
+
encoding: UTF-8
|
574
|
+
string: |
|
575
|
+
{
|
576
|
+
"name": "Category",
|
577
|
+
"description": "",
|
578
|
+
"fields": [
|
579
|
+
{
|
580
|
+
"id": "name",
|
581
|
+
"name": "Name",
|
582
|
+
"type": "Text",
|
583
|
+
"localized": true,
|
584
|
+
"validations": [
|
585
|
+
{
|
586
|
+
"size": {
|
587
|
+
"min": 2,
|
588
|
+
"max": 222
|
589
|
+
}
|
590
|
+
},
|
591
|
+
{
|
592
|
+
"in": [
|
593
|
+
"dom",
|
594
|
+
"chatka"
|
595
|
+
]
|
596
|
+
}
|
597
|
+
]
|
598
|
+
},
|
599
|
+
{
|
600
|
+
"id": "description",
|
601
|
+
"name": "Description",
|
602
|
+
"type": "Text"
|
603
|
+
},
|
604
|
+
{
|
605
|
+
"id": "valid",
|
606
|
+
"name": "Valid",
|
607
|
+
"type": "Text",
|
608
|
+
"validations": [
|
609
|
+
{
|
610
|
+
"in": [
|
611
|
+
"foo",
|
612
|
+
"bar"
|
613
|
+
]
|
614
|
+
},
|
615
|
+
{
|
616
|
+
"size": {
|
617
|
+
"min": 2,
|
618
|
+
"max": 10
|
619
|
+
}
|
620
|
+
}
|
621
|
+
]
|
622
|
+
},
|
623
|
+
{
|
624
|
+
"id": "asset_valid",
|
625
|
+
"name": "AssetValid",
|
626
|
+
"type": "Link",
|
627
|
+
"linkType": "Asset",
|
628
|
+
"validations": [
|
629
|
+
{
|
630
|
+
"linkMimetypeGroup": "pdfdocument"
|
631
|
+
}
|
632
|
+
]
|
633
|
+
}
|
634
|
+
],
|
635
|
+
"sys": {
|
636
|
+
"id": "category_content_type",
|
637
|
+
"type": "ContentType",
|
638
|
+
"createdAt": "2014-08-21T13:32:20.955Z",
|
639
|
+
"createdBy": {
|
640
|
+
"sys": {
|
641
|
+
"type": "Link",
|
642
|
+
"linkType": "User",
|
643
|
+
"id": "1E7acJL8I5XUXAMHQt9Grs"
|
644
|
+
}
|
645
|
+
},
|
646
|
+
"space": {
|
647
|
+
"sys": {
|
648
|
+
"type": "Link",
|
649
|
+
"linkType": "Space",
|
650
|
+
"id": "v2umtz8ths9v"
|
651
|
+
}
|
652
|
+
},
|
653
|
+
"firstPublishedAt": "2014-08-21T13:32:27.109Z",
|
654
|
+
"publishedCounter": 10,
|
655
|
+
"version": 263,
|
656
|
+
"updatedAt": "2014-10-15T10:20:09.173Z",
|
657
|
+
"updatedBy": {
|
658
|
+
"sys": {
|
659
|
+
"type": "Link",
|
660
|
+
"linkType": "User",
|
661
|
+
"id": "1E7acJL8I5XUXAMHQt9Grs"
|
662
|
+
}
|
663
|
+
}
|
664
|
+
}
|
665
|
+
}
|
666
|
+
http_version:
|
667
|
+
recorded_at: Wed, 15 Oct 2014 10:22:29 GMT
|
668
|
+
recorded_with: VCR 2.9.2
|