contentful-management 0.0.1.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. data/.gitignore +24 -0
  2. data/.reek +3 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +16 -0
  5. data/.travis.yml +9 -0
  6. data/CHANGELOG.md +2 -0
  7. data/Gemfile +13 -0
  8. data/LICENSE.txt +22 -0
  9. data/README.md +408 -0
  10. data/Rakefile +37 -0
  11. data/bin/cma-console +8 -0
  12. data/contentful-management.gemspec +33 -0
  13. data/examples/blog.rb +82 -0
  14. data/examples/content_types.rb +45 -0
  15. data/examples/create_space.rb +35 -0
  16. data/lib/contentful/management.rb +12 -0
  17. data/lib/contentful/management/array.rb +35 -0
  18. data/lib/contentful/management/asset.rb +163 -0
  19. data/lib/contentful/management/client.rb +160 -0
  20. data/lib/contentful/management/content_type.rb +180 -0
  21. data/lib/contentful/management/dynamic_entry.rb +71 -0
  22. data/lib/contentful/management/entry.rb +213 -0
  23. data/lib/contentful/management/error.rb +62 -0
  24. data/lib/contentful/management/field.rb +34 -0
  25. data/lib/contentful/management/file.rb +15 -0
  26. data/lib/contentful/management/http_client.rb +22 -0
  27. data/lib/contentful/management/link.rb +23 -0
  28. data/lib/contentful/management/locale.rb +48 -0
  29. data/lib/contentful/management/location.rb +15 -0
  30. data/lib/contentful/management/request.rb +82 -0
  31. data/lib/contentful/management/resource.rb +166 -0
  32. data/lib/contentful/management/resource/array_like.rb +37 -0
  33. data/lib/contentful/management/resource/fields.rb +69 -0
  34. data/lib/contentful/management/resource/refresher.rb +21 -0
  35. data/lib/contentful/management/resource/system_properties.rb +56 -0
  36. data/lib/contentful/management/resource_builder.rb +269 -0
  37. data/lib/contentful/management/response.rb +72 -0
  38. data/lib/contentful/management/space.rb +159 -0
  39. data/lib/contentful/management/support.rb +24 -0
  40. data/lib/contentful/management/version.rb +6 -0
  41. data/spec/fixtures/vcr_cassettes/array_page_1.yml +1337 -0
  42. data/spec/fixtures/vcr_cassettes/asset/all.yml +611 -0
  43. data/spec/fixtures/vcr_cassettes/asset/archive.yml +228 -0
  44. data/spec/fixtures/vcr_cassettes/asset/archive_published.yml +177 -0
  45. data/spec/fixtures/vcr_cassettes/asset/archived_false.yml +228 -0
  46. data/spec/fixtures/vcr_cassettes/asset/archived_true.yml +228 -0
  47. data/spec/fixtures/vcr_cassettes/asset/create.yml +150 -0
  48. data/spec/fixtures/vcr_cassettes/asset/create_with_already_used_id.yml +56 -0
  49. data/spec/fixtures/vcr_cassettes/asset/create_with_custom_id.yml +150 -0
  50. data/spec/fixtures/vcr_cassettes/asset/destroy.yml +159 -0
  51. data/spec/fixtures/vcr_cassettes/asset/destroy_published.yml +175 -0
  52. data/spec/fixtures/vcr_cassettes/asset/find.yml +108 -0
  53. data/spec/fixtures/vcr_cassettes/asset/find_not_found.yml +64 -0
  54. data/spec/fixtures/vcr_cassettes/asset/image_url.yml +133 -0
  55. data/spec/fixtures/vcr_cassettes/asset/locale.yml +110 -0
  56. data/spec/fixtures/vcr_cassettes/asset/publish.yml +228 -0
  57. data/spec/fixtures/vcr_cassettes/asset/publish_already_published.yml +176 -0
  58. data/spec/fixtures/vcr_cassettes/asset/published_false.yml +228 -0
  59. data/spec/fixtures/vcr_cassettes/asset/published_true.yml +226 -0
  60. data/spec/fixtures/vcr_cassettes/asset/save_update.yml +242 -0
  61. data/spec/fixtures/vcr_cassettes/asset/set_locale.yml +110 -0
  62. data/spec/fixtures/vcr_cassettes/asset/unarchive.yml +228 -0
  63. data/spec/fixtures/vcr_cassettes/asset/unarchive_already_unarchive.yml +168 -0
  64. data/spec/fixtures/vcr_cassettes/asset/unarchive_already_unarchived.yml +168 -0
  65. data/spec/fixtures/vcr_cassettes/asset/unpublish.yml +228 -0
  66. data/spec/fixtures/vcr_cassettes/asset/unpublish_already_unpublished.yml +168 -0
  67. data/spec/fixtures/vcr_cassettes/asset/update_file.yml +207 -0
  68. data/spec/fixtures/vcr_cassettes/asset/update_to_specified_locale.yml +224 -0
  69. data/spec/fixtures/vcr_cassettes/asset/update_with_default_locale_without_file.yml +214 -0
  70. data/spec/fixtures/vcr_cassettes/content_type/activate.yml +246 -0
  71. data/spec/fixtures/vcr_cassettes/content_type/activate_with_invalid_version.yml +186 -0
  72. data/spec/fixtures/vcr_cassettes/content_type/activated_false.yml +246 -0
  73. data/spec/fixtures/vcr_cassettes/content_type/activated_true.yml +257 -0
  74. data/spec/fixtures/vcr_cassettes/content_type/all.yml +190 -0
  75. data/spec/fixtures/vcr_cassettes/content_type/create.yml +87 -0
  76. data/spec/fixtures/vcr_cassettes/content_type/create_content_type_with_id.yml +87 -0
  77. data/spec/fixtures/vcr_cassettes/content_type/create_with_Array_field.yml +94 -0
  78. data/spec/fixtures/vcr_cassettes/content_type/create_with_Boolean_field.yml +94 -0
  79. data/spec/fixtures/vcr_cassettes/content_type/create_with_Date_field.yml +94 -0
  80. data/spec/fixtures/vcr_cassettes/content_type/create_with_Integer_field.yml +94 -0
  81. data/spec/fixtures/vcr_cassettes/content_type/create_with_Link_field.yml +95 -0
  82. data/spec/fixtures/vcr_cassettes/content_type/create_with_Location_field.yml +94 -0
  83. data/spec/fixtures/vcr_cassettes/content_type/create_with_Number_field.yml +94 -0
  84. data/spec/fixtures/vcr_cassettes/content_type/create_with_Object_field.yml +94 -0
  85. data/spec/fixtures/vcr_cassettes/content_type/create_with_Symbol_field.yml +94 -0
  86. data/spec/fixtures/vcr_cassettes/content_type/create_with_Text_field.yml +94 -0
  87. data/spec/fixtures/vcr_cassettes/content_type/deactivate.yml +246 -0
  88. data/spec/fixtures/vcr_cassettes/content_type/deactivate_already_deactivated.yml +176 -0
  89. data/spec/fixtures/vcr_cassettes/content_type/deactivate_with_entries.yml +236 -0
  90. data/spec/fixtures/vcr_cassettes/content_type/deactivate_with_version_change.yml +248 -0
  91. data/spec/fixtures/vcr_cassettes/content_type/destroy.yml +148 -0
  92. data/spec/fixtures/vcr_cassettes/content_type/destroy_activated.yml +164 -0
  93. data/spec/fixtures/vcr_cassettes/content_type/entry/create.yml +1344 -0
  94. data/spec/fixtures/vcr_cassettes/content_type/entry/create_with_camel_case_id_to_multiple_locales.yml +235 -0
  95. data/spec/fixtures/vcr_cassettes/content_type/entry/create_with_entries.yml +398 -0
  96. data/spec/fixtures/vcr_cassettes/content_type/entry/create_with_entries_for_multiple_locales.yml +3157 -0
  97. data/spec/fixtures/vcr_cassettes/content_type/entry/create_with_multiple_locales.yml +230 -0
  98. data/spec/fixtures/vcr_cassettes/content_type/fields/add.yml +345 -0
  99. data/spec/fixtures/vcr_cassettes/content_type/fields/create.yml +353 -0
  100. data/spec/fixtures/vcr_cassettes/content_type/fields/create_array_with_params.yml +228 -0
  101. data/spec/fixtures/vcr_cassettes/content_type/fields/create_with_params.yml +221 -0
  102. data/spec/fixtures/vcr_cassettes/content_type/fields/destroy.yml +349 -0
  103. data/spec/fixtures/vcr_cassettes/content_type/fields/update_field.yml +358 -0
  104. data/spec/fixtures/vcr_cassettes/content_type/find.yml +180 -0
  105. data/spec/fixtures/vcr_cassettes/content_type/find_not_found.yml +64 -0
  106. data/spec/fixtures/vcr_cassettes/content_type/save_new.yml +876 -0
  107. data/spec/fixtures/vcr_cassettes/content_type/save_updated.yml +345 -0
  108. data/spec/fixtures/vcr_cassettes/content_type/save_with_added_field.yml +217 -0
  109. data/spec/fixtures/vcr_cassettes/content_type/update.yml +175 -0
  110. data/spec/fixtures/vcr_cassettes/content_type/update_change_field_name.yml +222 -0
  111. data/spec/fixtures/vcr_cassettes/content_type/update_remove_field.yml +231 -0
  112. data/spec/fixtures/vcr_cassettes/content_type/update_with_fields.yml +222 -0
  113. data/spec/fixtures/vcr_cassettes/content_type/update_with_one_new_field.yml +251 -0
  114. data/spec/fixtures/vcr_cassettes/entry/all.yml +139 -0
  115. data/spec/fixtures/vcr_cassettes/entry/archive.yml +222 -0
  116. data/spec/fixtures/vcr_cassettes/entry/archive_published.yml +187 -0
  117. data/spec/fixtures/vcr_cassettes/entry/archived_false.yml +178 -0
  118. data/spec/fixtures/vcr_cassettes/entry/archived_true.yml +248 -0
  119. data/spec/fixtures/vcr_cassettes/entry/create.yml +245 -0
  120. data/spec/fixtures/vcr_cassettes/entry/create_test.yml +150 -0
  121. data/spec/fixtures/vcr_cassettes/entry/create_with_asset.yml +403 -0
  122. data/spec/fixtures/vcr_cassettes/entry/create_with_assets.yml +419 -0
  123. data/spec/fixtures/vcr_cassettes/entry/create_with_entries.yml +418 -0
  124. data/spec/fixtures/vcr_cassettes/entry/create_with_entry.yml +493 -0
  125. data/spec/fixtures/vcr_cassettes/entry/create_with_location.yml +259 -0
  126. data/spec/fixtures/vcr_cassettes/entry/create_with_symbols.yml +271 -0
  127. data/spec/fixtures/vcr_cassettes/entry/destory_published.yml +172 -0
  128. data/spec/fixtures/vcr_cassettes/entry/destroy.yml +156 -0
  129. data/spec/fixtures/vcr_cassettes/entry/find.yml +129 -0
  130. data/spec/fixtures/vcr_cassettes/entry/find_not_found.yml +64 -0
  131. data/spec/fixtures/vcr_cassettes/entry/publish.yml +248 -0
  132. data/spec/fixtures/vcr_cassettes/entry/publish_already_published.yml +186 -0
  133. data/spec/fixtures/vcr_cassettes/entry/published_false.yml +248 -0
  134. data/spec/fixtures/vcr_cassettes/entry/published_true.yml +257 -0
  135. data/spec/fixtures/vcr_cassettes/entry/save_update.yml +211 -0
  136. data/spec/fixtures/vcr_cassettes/entry/unarchive.yml +248 -0
  137. data/spec/fixtures/vcr_cassettes/entry/unarchive_already_unarchived.yml +178 -0
  138. data/spec/fixtures/vcr_cassettes/entry/unpublish.yml +248 -0
  139. data/spec/fixtures/vcr_cassettes/entry/unpublish_already_unpublished.yml +178 -0
  140. data/spec/fixtures/vcr_cassettes/entry/update.yml +626 -0
  141. data/spec/fixtures/vcr_cassettes/entry/update_unlocalized_field.yml +308 -0
  142. data/spec/fixtures/vcr_cassettes/entry/update_with_custom_locale.yml +332 -0
  143. data/spec/fixtures/vcr_cassettes/get_request.yml +37 -0
  144. data/spec/fixtures/vcr_cassettes/locale/all_for_space.yml +321 -0
  145. data/spec/fixtures/vcr_cassettes/locale/create_for_space.yml +95 -0
  146. data/spec/fixtures/vcr_cassettes/locale/find.yml +95 -0
  147. data/spec/fixtures/vcr_cassettes/locale/find_for_space_not_found.yml +67 -0
  148. data/spec/fixtures/vcr_cassettes/space/all.yml +1201 -0
  149. data/spec/fixtures/vcr_cassettes/space/asset/all.yml +475 -0
  150. data/spec/fixtures/vcr_cassettes/space/asset/assets.yml +826 -0
  151. data/spec/fixtures/vcr_cassettes/space/asset/create.yml +508 -0
  152. data/spec/fixtures/vcr_cassettes/space/asset/create_with_multiple_locales.yml +1062 -0
  153. data/spec/fixtures/vcr_cassettes/space/asset/find.yml +634 -0
  154. data/spec/fixtures/vcr_cassettes/space/content_type/all.yml +470 -0
  155. data/spec/fixtures/vcr_cassettes/space/content_type/content_types.yml +341 -0
  156. data/spec/fixtures/vcr_cassettes/space/content_type/create.yml +425 -0
  157. data/spec/fixtures/vcr_cassettes/space/content_type/find.yml +493 -0
  158. data/spec/fixtures/vcr_cassettes/space/create.yml +85 -0
  159. data/spec/fixtures/vcr_cassettes/space/create_when_limit_has_been_reached.yml +67 -0
  160. data/spec/fixtures/vcr_cassettes/space/create_with_unknown_organization.yml +65 -0
  161. data/spec/fixtures/vcr_cassettes/space/create_without_organization.yml +83 -0
  162. data/spec/fixtures/vcr_cassettes/space/destory.yml +196 -0
  163. data/spec/fixtures/vcr_cassettes/space/entry/all.yml +634 -0
  164. data/spec/fixtures/vcr_cassettes/space/entry/entries.yml +498 -0
  165. data/spec/fixtures/vcr_cassettes/space/entry/find.yml +624 -0
  166. data/spec/fixtures/vcr_cassettes/space/find.yml +270 -0
  167. data/spec/fixtures/vcr_cassettes/space/find_not_found.yml +67 -0
  168. data/spec/fixtures/vcr_cassettes/space/locale/all.yml +690 -0
  169. data/spec/fixtures/vcr_cassettes/space/locale/create.yml +572 -0
  170. data/spec/fixtures/vcr_cassettes/space/locale/create_with_the_same_code.yml +585 -0
  171. data/spec/fixtures/vcr_cassettes/space/locale/find.yml +572 -0
  172. data/spec/fixtures/vcr_cassettes/space/locale/find_not_found.yml +580 -0
  173. data/spec/fixtures/vcr_cassettes/space/locale/locales.yml +480 -0
  174. data/spec/fixtures/vcr_cassettes/space/locale/update.yml +700 -0
  175. data/spec/fixtures/vcr_cassettes/space/save_new_space.yml +67 -0
  176. data/spec/fixtures/vcr_cassettes/space/save_update_space.yml +352 -0
  177. data/spec/fixtures/vcr_cassettes/space/update.yml +350 -0
  178. data/spec/fixtures/vcr_cassettes/space/update_with_the_same_data.yml +350 -0
  179. data/spec/lib/contentful/management/array_spec.rb +59 -0
  180. data/spec/lib/contentful/management/asset_spec.rb +321 -0
  181. data/spec/lib/contentful/management/client_spec.rb +80 -0
  182. data/spec/lib/contentful/management/content_type_spec.rb +455 -0
  183. data/spec/lib/contentful/management/entry_spec.rb +308 -0
  184. data/spec/lib/contentful/management/locale_spec.rb +53 -0
  185. data/spec/lib/contentful/management/space_spec.rb +317 -0
  186. data/spec/spec_helper.rb +10 -0
  187. data/spec/support/vcr.rb +17 -0
  188. metadata +554 -0
@@ -0,0 +1,493 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/spaces/yr5m0jky5hsh/entries/4o6ghKSmSko4i828YCYaEo
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - RubyContenfulManagementGem/0.0.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
+ Server:
26
+ - nginx
27
+ Date:
28
+ - Thu, 31 Jul 2014 06:36:06 GMT
29
+ Content-Type:
30
+ - application/vnd.contentful.management.v1+json
31
+ Content-Length:
32
+ - '3009'
33
+ Connection:
34
+ - keep-alive
35
+ X-Powered-By:
36
+ - Express
37
+ Cf-Space-Id:
38
+ - yr5m0jky5hsh
39
+ Etag:
40
+ - '"69cf9fbf38ee30f1d8b8d01649cb4034"'
41
+ Access-Control-Allow-Origin:
42
+ - "*"
43
+ Access-Control-Allow-Headers:
44
+ - 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
45
+ Access-Control-Allow-Methods:
46
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
47
+ "^access-Control-Expose-Headers":
48
+ - Etag
49
+ Access-Control-Max-Age:
50
+ - '1728000'
51
+ body:
52
+ encoding: UTF-8
53
+ string: |
54
+ {
55
+ "fields": {
56
+ "name": {
57
+ "en-US": "Tom Handy",
58
+ "pl": "testName"
59
+ },
60
+ "age": {
61
+ "en-US": 20,
62
+ "pl": null
63
+ },
64
+ "bool": {
65
+ "en-US": false,
66
+ "pl": null
67
+ },
68
+ "birthday": {
69
+ "en-US": "2000-07-12T11:11:00+02:00",
70
+ "pl": null
71
+ },
72
+ "city": {
73
+ "en-US": {
74
+ "lat": 22.44,
75
+ "lon": 33.33
76
+ },
77
+ "pl": null
78
+ },
79
+ "asset": {
80
+ "en-US": {
81
+ "sys": {
82
+ "type": "Link",
83
+ "linkType": "Asset",
84
+ "id": "codequest_id_test_custom_id"
85
+ }
86
+ },
87
+ "pl": null
88
+ },
89
+ "assets": {
90
+ "en-US": [
91
+ {
92
+ "sys": {
93
+ "type": "Link",
94
+ "linkType": "Asset",
95
+ "id": "codequest_id_test_custom_id"
96
+ }
97
+ },
98
+ {
99
+ "sys": {
100
+ "type": "Link",
101
+ "linkType": "Asset",
102
+ "id": "codequest_id_test_custom_id"
103
+ }
104
+ },
105
+ {
106
+ "sys": {
107
+ "type": "Link",
108
+ "linkType": "Asset",
109
+ "id": "codequest_id_test_custom_id"
110
+ }
111
+ }
112
+ ],
113
+ "pl": null
114
+ },
115
+ "entry": {
116
+ "en-US": {
117
+ "sys": {
118
+ "type": "Link",
119
+ "linkType": "Entry",
120
+ "id": "1d1QDYzeiyWmgqQYysae8u"
121
+ }
122
+ },
123
+ "pl": null
124
+ },
125
+ "entries": {
126
+ "en-US": [
127
+ {
128
+ "sys": {
129
+ "type": "Link",
130
+ "linkType": "Entry",
131
+ "id": "1d1QDYzeiyWmgqQYysae8u"
132
+ }
133
+ },
134
+ {
135
+ "sys": {
136
+ "type": "Link",
137
+ "linkType": "Entry",
138
+ "id": "1d1QDYzeiyWmgqQYysae8u"
139
+ }
140
+ },
141
+ {
142
+ "sys": {
143
+ "type": "Link",
144
+ "linkType": "Entry",
145
+ "id": "1d1QDYzeiyWmgqQYysae8u"
146
+ }
147
+ }
148
+ ],
149
+ "pl": null
150
+ },
151
+ "symbols": {
152
+ "en-US": [
153
+ "PL",
154
+ "USD",
155
+ "XX"
156
+ ],
157
+ "pl": null
158
+ }
159
+ },
160
+ "sys": {
161
+ "id": "4o6ghKSmSko4i828YCYaEo",
162
+ "type": "Entry",
163
+ "createdAt": "2014-07-30T13:44:39.414Z",
164
+ "createdBy": {
165
+ "sys": {
166
+ "type": "Link",
167
+ "linkType": "User",
168
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
169
+ }
170
+ },
171
+ "space": {
172
+ "sys": {
173
+ "type": "Link",
174
+ "linkType": "Space",
175
+ "id": "yr5m0jky5hsh"
176
+ }
177
+ },
178
+ "contentType": {
179
+ "sys": {
180
+ "type": "Link",
181
+ "linkType": "ContentType",
182
+ "id": "5DSpuKrl04eMAGQoQckeIq"
183
+ }
184
+ },
185
+ "firstPublishedAt": "2014-07-30T13:44:42.304Z",
186
+ "publishedCounter": 2,
187
+ "publishedAt": "2014-07-30T13:53:55.981Z",
188
+ "publishedBy": {
189
+ "sys": {
190
+ "type": "Link",
191
+ "linkType": "User",
192
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
193
+ }
194
+ },
195
+ "publishedVersion": 3,
196
+ "version": 6,
197
+ "updatedAt": "2014-07-30T14:11:08.611Z",
198
+ "updatedBy": {
199
+ "sys": {
200
+ "type": "Link",
201
+ "linkType": "User",
202
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
203
+ }
204
+ }
205
+ }
206
+ }
207
+ http_version:
208
+ recorded_at: Thu, 31 Jul 2014 06:36:07 GMT
209
+ - request:
210
+ method: get
211
+ uri: https://api.contentful.com/spaces/yr5m0jky5hsh/content_types/5DSpuKrl04eMAGQoQckeIq
212
+ body:
213
+ encoding: US-ASCII
214
+ string: ''
215
+ headers:
216
+ User-Agent:
217
+ - RubyContenfulManagementGem/0.0.1
218
+ Authorization:
219
+ - Bearer <ACCESS_TOKEN>
220
+ Content-Type:
221
+ - application/vnd.contentful.management.v1+json
222
+ Content-Length:
223
+ - '0'
224
+ Host:
225
+ - api.contentful.com
226
+ response:
227
+ status:
228
+ code: 200
229
+ message: OK
230
+ headers:
231
+ Server:
232
+ - nginx
233
+ Date:
234
+ - Thu, 31 Jul 2014 06:36:07 GMT
235
+ Content-Type:
236
+ - application/vnd.contentful.management.v1+json
237
+ Content-Length:
238
+ - '2458'
239
+ Connection:
240
+ - keep-alive
241
+ X-Powered-By:
242
+ - Express
243
+ Cf-Space-Id:
244
+ - yr5m0jky5hsh
245
+ Etag:
246
+ - '"22ac7b99fb23804fd7b079ade52f888e"'
247
+ Access-Control-Allow-Origin:
248
+ - "*"
249
+ Access-Control-Allow-Headers:
250
+ - 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
251
+ Access-Control-Allow-Methods:
252
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
253
+ "^access-Control-Expose-Headers":
254
+ - Etag
255
+ Access-Control-Max-Age:
256
+ - '1728000'
257
+ body:
258
+ encoding: UTF-8
259
+ string: |
260
+ {
261
+ "fields": [
262
+ {
263
+ "name": "name",
264
+ "id": "name",
265
+ "type": "Text",
266
+ "uiid": "3fflnrplhc0",
267
+ "localized": true
268
+ },
269
+ {
270
+ "name": "age",
271
+ "id": "age",
272
+ "uiid": "2t5blkc7u2o",
273
+ "type": "Integer",
274
+ "localized": true
275
+ },
276
+ {
277
+ "name": "city",
278
+ "id": "city",
279
+ "type": "Location",
280
+ "uiid": "4fzl5jkm1a8",
281
+ "localized": false
282
+ },
283
+ {
284
+ "name": "assets",
285
+ "id": "assets",
286
+ "uiid": "3aqrgdyesxs",
287
+ "type": "Array",
288
+ "items": {
289
+ "type": "Link",
290
+ "linkType": "Asset"
291
+ },
292
+ "localized": true
293
+ },
294
+ {
295
+ "name": "entries",
296
+ "id": "entries",
297
+ "type": "Array",
298
+ "uiid": "3xi486kbchs",
299
+ "items": {
300
+ "type": "Link",
301
+ "linkType": "Entry"
302
+ }
303
+ },
304
+ {
305
+ "name": "entry",
306
+ "id": "entry",
307
+ "type": "Link",
308
+ "uiid": "3uxjdd1n5ds",
309
+ "linkType": "Entry"
310
+ },
311
+ {
312
+ "name": "asset",
313
+ "id": "asset",
314
+ "type": "Link",
315
+ "uiid": "40ilp8h1xc0",
316
+ "linkType": "Asset"
317
+ },
318
+ {
319
+ "name": "bool",
320
+ "id": "bool",
321
+ "type": "Boolean",
322
+ "uiid": "2i1bgmn2dj4",
323
+ "localized": true
324
+ },
325
+ {
326
+ "name": "symbols",
327
+ "id": "symbols",
328
+ "type": "Array",
329
+ "uiid": "38rbncxmzuo",
330
+ "items": {
331
+ "type": "Symbol"
332
+ }
333
+ },
334
+ {
335
+ "name": "birthday",
336
+ "id": "birthday",
337
+ "type": "Date",
338
+ "uiid": "41bdwbk06bk"
339
+ }
340
+ ],
341
+ "name": "Author",
342
+ "sys": {
343
+ "id": "5DSpuKrl04eMAGQoQckeIq",
344
+ "type": "ContentType",
345
+ "createdAt": "2014-07-30T12:35:01.110Z",
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": "yr5m0jky5hsh"
358
+ }
359
+ },
360
+ "firstPublishedAt": "2014-07-30T12:37:42.035Z",
361
+ "publishedCounter": 6,
362
+ "publishedAt": "2014-07-30T14:58:40.786Z",
363
+ "publishedBy": {
364
+ "sys": {
365
+ "type": "Link",
366
+ "linkType": "User",
367
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
368
+ }
369
+ },
370
+ "publishedVersion": 177,
371
+ "version": 178,
372
+ "updatedAt": "2014-07-30T14:58:40.796Z",
373
+ "updatedBy": {
374
+ "sys": {
375
+ "type": "Link",
376
+ "linkType": "User",
377
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
378
+ }
379
+ }
380
+ },
381
+ "description": null,
382
+ "displayField": "name"
383
+ }
384
+ http_version:
385
+ recorded_at: Thu, 31 Jul 2014 06:36:07 GMT
386
+ - request:
387
+ method: post
388
+ uri: https://api.contentful.com/spaces/yr5m0jky5hsh/entries/
389
+ body:
390
+ encoding: UTF-8
391
+ string: '{"fields":{"name":{"en-US":"EntryWithEntry"},"age":{"en-US":20},"entry":{"en-US":{"sys":{"type":"Link","linkType":"Entry","id":"4o6ghKSmSko4i828YCYaEo"}}}}}'
392
+ headers:
393
+ User-Agent:
394
+ - RubyContenfulManagementGem/0.0.1
395
+ Authorization:
396
+ - Bearer <ACCESS_TOKEN>
397
+ Content-Type:
398
+ - application/vnd.contentful.management.v1+json
399
+ X-Contentful-Content-Type:
400
+ - 5DSpuKrl04eMAGQoQckeIq
401
+ Host:
402
+ - api.contentful.com
403
+ response:
404
+ status:
405
+ code: 201
406
+ message: Created
407
+ headers:
408
+ Server:
409
+ - nginx
410
+ Date:
411
+ - Thu, 31 Jul 2014 06:36:08 GMT
412
+ Content-Type:
413
+ - application/vnd.contentful.management.v1+json
414
+ Content-Length:
415
+ - '1020'
416
+ Connection:
417
+ - keep-alive
418
+ X-Powered-By:
419
+ - Express
420
+ Cf-Space-Id:
421
+ - yr5m0jky5hsh
422
+ Etag:
423
+ - '"012cde2a7af4ada230cc5758739cbd07"'
424
+ Access-Control-Allow-Origin:
425
+ - "*"
426
+ Access-Control-Allow-Headers:
427
+ - 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
428
+ Access-Control-Allow-Methods:
429
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
430
+ "^access-Control-Expose-Headers":
431
+ - Etag
432
+ Access-Control-Max-Age:
433
+ - '1728000'
434
+ body:
435
+ encoding: UTF-8
436
+ string: |
437
+ {
438
+ "fields": {
439
+ "name": {
440
+ "en-US": "EntryWithEntry"
441
+ },
442
+ "age": {
443
+ "en-US": 20
444
+ },
445
+ "entry": {
446
+ "en-US": {
447
+ "sys": {
448
+ "type": "Link",
449
+ "linkType": "Entry",
450
+ "id": "4o6ghKSmSko4i828YCYaEo"
451
+ }
452
+ }
453
+ }
454
+ },
455
+ "sys": {
456
+ "id": "2NtXSTpsw0QGOwmg4CwE0i",
457
+ "type": "Entry",
458
+ "version": 1,
459
+ "createdAt": "2014-07-31T06:36:08.466Z",
460
+ "createdBy": {
461
+ "sys": {
462
+ "type": "Link",
463
+ "linkType": "User",
464
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
465
+ }
466
+ },
467
+ "space": {
468
+ "sys": {
469
+ "type": "Link",
470
+ "linkType": "Space",
471
+ "id": "yr5m0jky5hsh"
472
+ }
473
+ },
474
+ "contentType": {
475
+ "sys": {
476
+ "type": "Link",
477
+ "linkType": "ContentType",
478
+ "id": "5DSpuKrl04eMAGQoQckeIq"
479
+ }
480
+ },
481
+ "updatedAt": "2014-07-31T06:36:08.467Z",
482
+ "updatedBy": {
483
+ "sys": {
484
+ "type": "Link",
485
+ "linkType": "User",
486
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
487
+ }
488
+ }
489
+ }
490
+ }
491
+ http_version:
492
+ recorded_at: Thu, 31 Jul 2014 06:36:08 GMT
493
+ recorded_with: VCR 2.9.2