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,419 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/spaces/yr5m0jky5hsh/assets/codequest_id_test_custom
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
+ - Fri, 01 Aug 2014 08:55:42 GMT
29
+ Content-Type:
30
+ - application/vnd.contentful.management.v1+json
31
+ Content-Length:
32
+ - '1205'
33
+ Connection:
34
+ - keep-alive
35
+ X-Powered-By:
36
+ - Express
37
+ Cf-Space-Id:
38
+ - yr5m0jky5hsh
39
+ Etag:
40
+ - '"0ff4c4b8f43df017425d0b74e315f1d2"'
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
+ "title": {
57
+ "en-US": "titlebyCreateAPI_custom_id"
58
+ },
59
+ "description": {
60
+ "en-US": "descByAPI_custom_id"
61
+ },
62
+ "file": {
63
+ "en-US": {
64
+ "contentType": "image/jpeg",
65
+ "fileName": "codequest.jpg",
66
+ "details": {
67
+ "image": {
68
+ "width": 90,
69
+ "height": 90
70
+ },
71
+ "size": 7094
72
+ },
73
+ "url": "//images.contentful.com/yr5m0jky5hsh/codequest_id_test_custom/8c9205380d47c5fdd9a9f01acfc23aa0/codequest.jpg"
74
+ }
75
+ }
76
+ },
77
+ "sys": {
78
+ "id": "codequest_id_test_custom",
79
+ "type": "Asset",
80
+ "createdAt": "2014-07-31T07:38:09.232Z",
81
+ "createdBy": {
82
+ "sys": {
83
+ "type": "Link",
84
+ "linkType": "User",
85
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
86
+ }
87
+ },
88
+ "space": {
89
+ "sys": {
90
+ "type": "Link",
91
+ "linkType": "Space",
92
+ "id": "yr5m0jky5hsh"
93
+ }
94
+ },
95
+ "firstPublishedAt": "2014-07-31T13:21:14.146Z",
96
+ "publishedCounter": 1,
97
+ "version": 4,
98
+ "updatedAt": "2014-07-31T13:21:38.397Z",
99
+ "updatedBy": {
100
+ "sys": {
101
+ "type": "Link",
102
+ "linkType": "User",
103
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
104
+ }
105
+ }
106
+ }
107
+ }
108
+ http_version:
109
+ recorded_at: Fri, 01 Aug 2014 08:55:42 GMT
110
+ - request:
111
+ method: get
112
+ uri: https://api.contentful.com/spaces/yr5m0jky5hsh/content_types/5DSpuKrl04eMAGQoQckeIq
113
+ body:
114
+ encoding: US-ASCII
115
+ string: ''
116
+ headers:
117
+ User-Agent:
118
+ - RubyContenfulManagementGem/0.0.1
119
+ Authorization:
120
+ - Bearer <ACCESS_TOKEN>
121
+ Content-Type:
122
+ - application/vnd.contentful.management.v1+json
123
+ Content-Length:
124
+ - '0'
125
+ Host:
126
+ - api.contentful.com
127
+ response:
128
+ status:
129
+ code: 200
130
+ message: OK
131
+ headers:
132
+ Server:
133
+ - nginx
134
+ Date:
135
+ - Fri, 01 Aug 2014 08:55:42 GMT
136
+ Content-Type:
137
+ - application/vnd.contentful.management.v1+json
138
+ Content-Length:
139
+ - '2694'
140
+ Connection:
141
+ - keep-alive
142
+ X-Powered-By:
143
+ - Express
144
+ Cf-Space-Id:
145
+ - yr5m0jky5hsh
146
+ Etag:
147
+ - '"0d232e3ca0d9eea2582d69148be0df3b"'
148
+ Access-Control-Allow-Origin:
149
+ - "*"
150
+ Access-Control-Allow-Headers:
151
+ - 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
152
+ Access-Control-Allow-Methods:
153
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
154
+ "^access-Control-Expose-Headers":
155
+ - Etag
156
+ Access-Control-Max-Age:
157
+ - '1728000'
158
+ body:
159
+ encoding: UTF-8
160
+ string: |
161
+ {
162
+ "name": "Author",
163
+ "description": "Author content",
164
+ "fields": [
165
+ {
166
+ "id": "name",
167
+ "name": "name",
168
+ "type": "Text",
169
+ "localized": true,
170
+ "uiid": "3jp09h4ba4g"
171
+ },
172
+ {
173
+ "id": "age",
174
+ "name": "age",
175
+ "type": "Integer",
176
+ "localized": true,
177
+ "uiid": "43my1e8ybr4"
178
+ },
179
+ {
180
+ "id": "city",
181
+ "name": "city",
182
+ "type": "Location",
183
+ "uiid": "45uoowshekg"
184
+ },
185
+ {
186
+ "id": "assets",
187
+ "name": "assets",
188
+ "type": "Array",
189
+ "items": {
190
+ "type": "Link",
191
+ "linkType": "Asset"
192
+ },
193
+ "localized": true,
194
+ "uiid": "4p8d3di8b28"
195
+ },
196
+ {
197
+ "id": "entries",
198
+ "name": "entries",
199
+ "type": "Array",
200
+ "items": {
201
+ "type": "Link",
202
+ "linkType": "Entry"
203
+ },
204
+ "uiid": "4t2r2mpmwow"
205
+ },
206
+ {
207
+ "id": "entry",
208
+ "name": "entry",
209
+ "type": "Link",
210
+ "linkType": "Entry",
211
+ "uiid": "2u2x6csxtkw"
212
+ },
213
+ {
214
+ "id": "asset",
215
+ "name": "asset",
216
+ "type": "Link",
217
+ "linkType": "Asset",
218
+ "uiid": "3pktxccvjeo"
219
+ },
220
+ {
221
+ "id": "bool",
222
+ "name": "bool",
223
+ "type": "Boolean",
224
+ "localized": true,
225
+ "uiid": "4p882yc9728"
226
+ },
227
+ {
228
+ "id": "symbols",
229
+ "name": "symbols",
230
+ "type": "Array",
231
+ "items": {
232
+ "type": "Symbol"
233
+ },
234
+ "uiid": "2mcqj4tdczk"
235
+ },
236
+ {
237
+ "id": "birthday",
238
+ "name": "birthday",
239
+ "type": "Date",
240
+ "uiid": "3h1dkdm8we8"
241
+ },
242
+ {
243
+ "id": "symbol",
244
+ "name": "Symbol",
245
+ "type": "Symbol",
246
+ "required": true,
247
+ "localized": true,
248
+ "uiid": "30rwyn42a68"
249
+ },
250
+ {
251
+ "id": "eye_color",
252
+ "name": "Eyes color",
253
+ "type": "Text",
254
+ "uiid": "46h9q3btwcg"
255
+ }
256
+ ],
257
+ "sys": {
258
+ "id": "5DSpuKrl04eMAGQoQckeIq",
259
+ "type": "ContentType",
260
+ "createdAt": "2014-07-30T12:35:01.110Z",
261
+ "createdBy": {
262
+ "sys": {
263
+ "type": "Link",
264
+ "linkType": "User",
265
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
266
+ }
267
+ },
268
+ "space": {
269
+ "sys": {
270
+ "type": "Link",
271
+ "linkType": "Space",
272
+ "id": "yr5m0jky5hsh"
273
+ }
274
+ },
275
+ "firstPublishedAt": "2014-07-30T12:37:42.035Z",
276
+ "publishedCounter": 9,
277
+ "publishedAt": "2014-07-31T10:21:36.870Z",
278
+ "publishedBy": {
279
+ "sys": {
280
+ "type": "Link",
281
+ "linkType": "User",
282
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
283
+ }
284
+ },
285
+ "publishedVersion": 206,
286
+ "version": 213,
287
+ "updatedAt": "2014-07-31T13:23:46.624Z",
288
+ "updatedBy": {
289
+ "sys": {
290
+ "type": "Link",
291
+ "linkType": "User",
292
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
293
+ }
294
+ }
295
+ }
296
+ }
297
+ http_version:
298
+ recorded_at: Fri, 01 Aug 2014 08:55:42 GMT
299
+ - request:
300
+ method: post
301
+ uri: https://api.contentful.com/spaces/yr5m0jky5hsh/entries/
302
+ body:
303
+ encoding: UTF-8
304
+ string: '{"fields":{"name":{"en-US":"multiAssets"},"assets":{"en-US":[{"sys":{"type":"Link","linkType":"Asset","id":"codequest_id_test_custom"}},{"sys":{"type":"Link","linkType":"Asset","id":"codequest_id_test_custom"}},{"sys":{"type":"Link","linkType":"Asset","id":"codequest_id_test_custom"}}]}}}'
305
+ headers:
306
+ User-Agent:
307
+ - RubyContenfulManagementGem/0.0.1
308
+ Authorization:
309
+ - Bearer <ACCESS_TOKEN>
310
+ Content-Type:
311
+ - application/vnd.contentful.management.v1+json
312
+ X-Contentful-Content-Type:
313
+ - 5DSpuKrl04eMAGQoQckeIq
314
+ Host:
315
+ - api.contentful.com
316
+ response:
317
+ status:
318
+ code: 201
319
+ message: Created
320
+ headers:
321
+ Server:
322
+ - nginx
323
+ Date:
324
+ - Fri, 01 Aug 2014 08:55:43 GMT
325
+ Content-Type:
326
+ - application/vnd.contentful.management.v1+json
327
+ Content-Length:
328
+ - '1328'
329
+ Connection:
330
+ - keep-alive
331
+ X-Powered-By:
332
+ - Express
333
+ Cf-Space-Id:
334
+ - yr5m0jky5hsh
335
+ Etag:
336
+ - '"c20bc351552a32c0d2dc416d228f0345"'
337
+ Access-Control-Allow-Origin:
338
+ - "*"
339
+ Access-Control-Allow-Headers:
340
+ - 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
341
+ Access-Control-Allow-Methods:
342
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
343
+ "^access-Control-Expose-Headers":
344
+ - Etag
345
+ Access-Control-Max-Age:
346
+ - '1728000'
347
+ body:
348
+ encoding: UTF-8
349
+ string: |
350
+ {
351
+ "fields": {
352
+ "name": {
353
+ "en-US": "multiAssets"
354
+ },
355
+ "assets": {
356
+ "en-US": [
357
+ {
358
+ "sys": {
359
+ "type": "Link",
360
+ "linkType": "Asset",
361
+ "id": "codequest_id_test_custom"
362
+ }
363
+ },
364
+ {
365
+ "sys": {
366
+ "type": "Link",
367
+ "linkType": "Asset",
368
+ "id": "codequest_id_test_custom"
369
+ }
370
+ },
371
+ {
372
+ "sys": {
373
+ "type": "Link",
374
+ "linkType": "Asset",
375
+ "id": "codequest_id_test_custom"
376
+ }
377
+ }
378
+ ]
379
+ }
380
+ },
381
+ "sys": {
382
+ "id": "2bYVfn6HqMc0OigKymgMU6",
383
+ "type": "Entry",
384
+ "version": 1,
385
+ "createdAt": "2014-08-01T08:55:43.495Z",
386
+ "createdBy": {
387
+ "sys": {
388
+ "type": "Link",
389
+ "linkType": "User",
390
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
391
+ }
392
+ },
393
+ "space": {
394
+ "sys": {
395
+ "type": "Link",
396
+ "linkType": "Space",
397
+ "id": "yr5m0jky5hsh"
398
+ }
399
+ },
400
+ "contentType": {
401
+ "sys": {
402
+ "type": "Link",
403
+ "linkType": "ContentType",
404
+ "id": "5DSpuKrl04eMAGQoQckeIq"
405
+ }
406
+ },
407
+ "updatedAt": "2014-08-01T08:55:43.495Z",
408
+ "updatedBy": {
409
+ "sys": {
410
+ "type": "Link",
411
+ "linkType": "User",
412
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
413
+ }
414
+ }
415
+ }
416
+ }
417
+ http_version:
418
+ recorded_at: Fri, 01 Aug 2014 08:55:43 GMT
419
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,418 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/spaces/yr5m0jky5hsh/entries/1d1QDYzeiyWmgqQYysae8u
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:39:11 GMT
29
+ Content-Type:
30
+ - application/vnd.contentful.management.v1+json
31
+ Content-Length:
32
+ - '1227'
33
+ Connection:
34
+ - keep-alive
35
+ X-Powered-By:
36
+ - Express
37
+ Cf-Space-Id:
38
+ - yr5m0jky5hsh
39
+ Etag:
40
+ - '"1dbef3bc858d62efda5955b46c4d4e20"'
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
+ },
59
+ "age": {
60
+ "en-US": 30
61
+ },
62
+ "city": {
63
+ "en-US": {
64
+ "lat": 22.44,
65
+ "lon": 33.33
66
+ }
67
+ }
68
+ },
69
+ "sys": {
70
+ "id": "1d1QDYzeiyWmgqQYysae8u",
71
+ "type": "Entry",
72
+ "createdAt": "2014-07-30T13:07:10.630Z",
73
+ "createdBy": {
74
+ "sys": {
75
+ "type": "Link",
76
+ "linkType": "User",
77
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
78
+ }
79
+ },
80
+ "space": {
81
+ "sys": {
82
+ "type": "Link",
83
+ "linkType": "Space",
84
+ "id": "yr5m0jky5hsh"
85
+ }
86
+ },
87
+ "contentType": {
88
+ "sys": {
89
+ "type": "Link",
90
+ "linkType": "ContentType",
91
+ "id": "5DSpuKrl04eMAGQoQckeIq"
92
+ }
93
+ },
94
+ "firstPublishedAt": "2014-07-30T13:34:58.934Z",
95
+ "publishedCounter": 1,
96
+ "publishedAt": "2014-07-30T13:34:58.934Z",
97
+ "publishedBy": {
98
+ "sys": {
99
+ "type": "Link",
100
+ "linkType": "User",
101
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
102
+ }
103
+ },
104
+ "publishedVersion": 1,
105
+ "version": 2,
106
+ "updatedAt": "2014-07-30T13:34:58.938Z",
107
+ "updatedBy": {
108
+ "sys": {
109
+ "type": "Link",
110
+ "linkType": "User",
111
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
112
+ }
113
+ }
114
+ }
115
+ }
116
+ http_version:
117
+ recorded_at: Thu, 31 Jul 2014 06:39:11 GMT
118
+ - request:
119
+ method: get
120
+ uri: https://api.contentful.com/spaces/yr5m0jky5hsh/content_types/5DSpuKrl04eMAGQoQckeIq
121
+ body:
122
+ encoding: US-ASCII
123
+ string: ''
124
+ headers:
125
+ User-Agent:
126
+ - RubyContenfulManagementGem/0.0.1
127
+ Authorization:
128
+ - Bearer <ACCESS_TOKEN>
129
+ Content-Type:
130
+ - application/vnd.contentful.management.v1+json
131
+ Content-Length:
132
+ - '0'
133
+ Host:
134
+ - api.contentful.com
135
+ response:
136
+ status:
137
+ code: 200
138
+ message: OK
139
+ headers:
140
+ Server:
141
+ - nginx
142
+ Date:
143
+ - Thu, 31 Jul 2014 06:39:11 GMT
144
+ Content-Type:
145
+ - application/vnd.contentful.management.v1+json
146
+ Content-Length:
147
+ - '2458'
148
+ Connection:
149
+ - keep-alive
150
+ X-Powered-By:
151
+ - Express
152
+ Cf-Space-Id:
153
+ - yr5m0jky5hsh
154
+ Etag:
155
+ - '"22ac7b99fb23804fd7b079ade52f888e"'
156
+ Access-Control-Allow-Origin:
157
+ - "*"
158
+ Access-Control-Allow-Headers:
159
+ - 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
160
+ Access-Control-Allow-Methods:
161
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
162
+ "^access-Control-Expose-Headers":
163
+ - Etag
164
+ Access-Control-Max-Age:
165
+ - '1728000'
166
+ body:
167
+ encoding: UTF-8
168
+ string: |
169
+ {
170
+ "fields": [
171
+ {
172
+ "name": "name",
173
+ "id": "name",
174
+ "type": "Text",
175
+ "uiid": "3fflnrplhc0",
176
+ "localized": true
177
+ },
178
+ {
179
+ "name": "age",
180
+ "id": "age",
181
+ "uiid": "2t5blkc7u2o",
182
+ "type": "Integer",
183
+ "localized": true
184
+ },
185
+ {
186
+ "name": "city",
187
+ "id": "city",
188
+ "type": "Location",
189
+ "uiid": "4fzl5jkm1a8",
190
+ "localized": false
191
+ },
192
+ {
193
+ "name": "assets",
194
+ "id": "assets",
195
+ "uiid": "3aqrgdyesxs",
196
+ "type": "Array",
197
+ "items": {
198
+ "type": "Link",
199
+ "linkType": "Asset"
200
+ },
201
+ "localized": true
202
+ },
203
+ {
204
+ "name": "entries",
205
+ "id": "entries",
206
+ "type": "Array",
207
+ "uiid": "3xi486kbchs",
208
+ "items": {
209
+ "type": "Link",
210
+ "linkType": "Entry"
211
+ }
212
+ },
213
+ {
214
+ "name": "entry",
215
+ "id": "entry",
216
+ "type": "Link",
217
+ "uiid": "3uxjdd1n5ds",
218
+ "linkType": "Entry"
219
+ },
220
+ {
221
+ "name": "asset",
222
+ "id": "asset",
223
+ "type": "Link",
224
+ "uiid": "40ilp8h1xc0",
225
+ "linkType": "Asset"
226
+ },
227
+ {
228
+ "name": "bool",
229
+ "id": "bool",
230
+ "type": "Boolean",
231
+ "uiid": "2i1bgmn2dj4",
232
+ "localized": true
233
+ },
234
+ {
235
+ "name": "symbols",
236
+ "id": "symbols",
237
+ "type": "Array",
238
+ "uiid": "38rbncxmzuo",
239
+ "items": {
240
+ "type": "Symbol"
241
+ }
242
+ },
243
+ {
244
+ "name": "birthday",
245
+ "id": "birthday",
246
+ "type": "Date",
247
+ "uiid": "41bdwbk06bk"
248
+ }
249
+ ],
250
+ "name": "Author",
251
+ "sys": {
252
+ "id": "5DSpuKrl04eMAGQoQckeIq",
253
+ "type": "ContentType",
254
+ "createdAt": "2014-07-30T12:35:01.110Z",
255
+ "createdBy": {
256
+ "sys": {
257
+ "type": "Link",
258
+ "linkType": "User",
259
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
260
+ }
261
+ },
262
+ "space": {
263
+ "sys": {
264
+ "type": "Link",
265
+ "linkType": "Space",
266
+ "id": "yr5m0jky5hsh"
267
+ }
268
+ },
269
+ "firstPublishedAt": "2014-07-30T12:37:42.035Z",
270
+ "publishedCounter": 6,
271
+ "publishedAt": "2014-07-30T14:58:40.786Z",
272
+ "publishedBy": {
273
+ "sys": {
274
+ "type": "Link",
275
+ "linkType": "User",
276
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
277
+ }
278
+ },
279
+ "publishedVersion": 177,
280
+ "version": 178,
281
+ "updatedAt": "2014-07-30T14:58:40.796Z",
282
+ "updatedBy": {
283
+ "sys": {
284
+ "type": "Link",
285
+ "linkType": "User",
286
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
287
+ }
288
+ }
289
+ },
290
+ "description": null,
291
+ "displayField": "name"
292
+ }
293
+ http_version:
294
+ recorded_at: Thu, 31 Jul 2014 06:39:11 GMT
295
+ - request:
296
+ method: post
297
+ uri: https://api.contentful.com/spaces/yr5m0jky5hsh/entries/
298
+ body:
299
+ encoding: UTF-8
300
+ string: '{"fields":{"name":{"en-US":"EntryWithEntries"},"age":{"en-US":20},"entries":{"en-US":[{"sys":{"type":"Link","linkType":"Entry","id":"1d1QDYzeiyWmgqQYysae8u"}},{"sys":{"type":"Link","linkType":"Entry","id":"1d1QDYzeiyWmgqQYysae8u"}},{"sys":{"type":"Link","linkType":"Entry","id":"1d1QDYzeiyWmgqQYysae8u"}}]}}}'
301
+ headers:
302
+ User-Agent:
303
+ - RubyContenfulManagementGem/0.0.1
304
+ Authorization:
305
+ - Bearer <ACCESS_TOKEN>
306
+ Content-Type:
307
+ - application/vnd.contentful.management.v1+json
308
+ X-Contentful-Content-Type:
309
+ - 5DSpuKrl04eMAGQoQckeIq
310
+ Host:
311
+ - api.contentful.com
312
+ response:
313
+ status:
314
+ code: 201
315
+ message: Created
316
+ headers:
317
+ Server:
318
+ - nginx
319
+ Date:
320
+ - Thu, 31 Jul 2014 06:39:12 GMT
321
+ Content-Type:
322
+ - application/vnd.contentful.management.v1+json
323
+ Content-Length:
324
+ - '1366'
325
+ Connection:
326
+ - keep-alive
327
+ X-Powered-By:
328
+ - Express
329
+ Cf-Space-Id:
330
+ - yr5m0jky5hsh
331
+ Etag:
332
+ - '"156be1d3ba61361219734e595aa72dfe"'
333
+ Access-Control-Allow-Origin:
334
+ - "*"
335
+ Access-Control-Allow-Headers:
336
+ - 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
337
+ Access-Control-Allow-Methods:
338
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
339
+ "^access-Control-Expose-Headers":
340
+ - Etag
341
+ Access-Control-Max-Age:
342
+ - '1728000'
343
+ body:
344
+ encoding: UTF-8
345
+ string: |
346
+ {
347
+ "fields": {
348
+ "name": {
349
+ "en-US": "EntryWithEntries"
350
+ },
351
+ "age": {
352
+ "en-US": 20
353
+ },
354
+ "entries": {
355
+ "en-US": [
356
+ {
357
+ "sys": {
358
+ "type": "Link",
359
+ "linkType": "Entry",
360
+ "id": "1d1QDYzeiyWmgqQYysae8u"
361
+ }
362
+ },
363
+ {
364
+ "sys": {
365
+ "type": "Link",
366
+ "linkType": "Entry",
367
+ "id": "1d1QDYzeiyWmgqQYysae8u"
368
+ }
369
+ },
370
+ {
371
+ "sys": {
372
+ "type": "Link",
373
+ "linkType": "Entry",
374
+ "id": "1d1QDYzeiyWmgqQYysae8u"
375
+ }
376
+ }
377
+ ]
378
+ }
379
+ },
380
+ "sys": {
381
+ "id": "6o9tWUn4CkaokIOsOC0gEC",
382
+ "type": "Entry",
383
+ "version": 1,
384
+ "createdAt": "2014-07-31T06:39:12.708Z",
385
+ "createdBy": {
386
+ "sys": {
387
+ "type": "Link",
388
+ "linkType": "User",
389
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
390
+ }
391
+ },
392
+ "space": {
393
+ "sys": {
394
+ "type": "Link",
395
+ "linkType": "Space",
396
+ "id": "yr5m0jky5hsh"
397
+ }
398
+ },
399
+ "contentType": {
400
+ "sys": {
401
+ "type": "Link",
402
+ "linkType": "ContentType",
403
+ "id": "5DSpuKrl04eMAGQoQckeIq"
404
+ }
405
+ },
406
+ "updatedAt": "2014-07-31T06:39:12.708Z",
407
+ "updatedBy": {
408
+ "sys": {
409
+ "type": "Link",
410
+ "linkType": "User",
411
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
412
+ }
413
+ }
414
+ }
415
+ }
416
+ http_version:
417
+ recorded_at: Thu, 31 Jul 2014 06:39:12 GMT
418
+ recorded_with: VCR 2.9.2