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,508 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/spaces/yr5m0jky5hsh
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
+ - Wed, 30 Jul 2014 12:20:15 GMT
29
+ Content-Type:
30
+ - application/vnd.contentful.management.v1+json
31
+ Content-Length:
32
+ - '452'
33
+ Connection:
34
+ - keep-alive
35
+ Status:
36
+ - 200 OK
37
+ X-Contentful-Request-Id:
38
+ - 85f-1334319623
39
+ Etag:
40
+ - '"a964cca95dae35954c57c99f517f39e7"'
41
+ Accept-Ranges:
42
+ - bytes
43
+ Cache-Control:
44
+ - max-age=0
45
+ Access-Control-Allow-Origin:
46
+ - "*"
47
+ Access-Control-Allow-Headers:
48
+ - 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
49
+ Access-Control-Allow-Methods:
50
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
51
+ "^access-Control-Expose-Headers":
52
+ - Etag
53
+ Access-Control-Max-Age:
54
+ - '1728000'
55
+ body:
56
+ encoding: UTF-8
57
+ string: |
58
+ {
59
+ "sys":{
60
+ "type":"Space",
61
+ "id":"yr5m0jky5hsh",
62
+ "version":6,
63
+ "createdBy":{
64
+ "sys":{
65
+ "type":"Link",
66
+ "linkType":"User",
67
+ "id":"0fn5fOWn4WsKFyYla1gI5h"
68
+ }
69
+ },
70
+ "createdAt":"2014-07-30T07:46:19Z",
71
+ "updatedBy":{
72
+ "sys":{
73
+ "type":"Link",
74
+ "linkType":"User",
75
+ "id":"1E7acJL8I5XUXAMHQt9Grs"
76
+ }
77
+ },
78
+ "updatedAt":"2014-07-30T11:56:51Z"
79
+ },
80
+ "name":"SaveNewName"}
81
+ http_version:
82
+ recorded_at: Wed, 30 Jul 2014 12:20:15 GMT
83
+ - request:
84
+ method: get
85
+ uri: https://api.contentful.com/spaces/yr5m0jky5hsh/content_types
86
+ body:
87
+ encoding: US-ASCII
88
+ string: ''
89
+ headers:
90
+ User-Agent:
91
+ - RubyContenfulManagementGem/0.0.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
+ Server:
106
+ - nginx
107
+ Date:
108
+ - Wed, 30 Jul 2014 12:20:16 GMT
109
+ Content-Type:
110
+ - application/vnd.contentful.management.v1+json
111
+ Content-Length:
112
+ - '2501'
113
+ Connection:
114
+ - keep-alive
115
+ X-Powered-By:
116
+ - Express
117
+ Cf-Space-Id:
118
+ - yr5m0jky5hsh
119
+ Etag:
120
+ - '"b189a94a2f94b2ad197d2a5eddc83e38"'
121
+ Access-Control-Allow-Origin:
122
+ - "*"
123
+ Access-Control-Allow-Headers:
124
+ - 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
125
+ Access-Control-Allow-Methods:
126
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
127
+ "^access-Control-Expose-Headers":
128
+ - Etag
129
+ Access-Control-Max-Age:
130
+ - '1728000'
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
+ "name": "ContentTypeForSpace",
144
+ "description": null,
145
+ "fields": [],
146
+ "sys": {
147
+ "id": "1AZQOWKr2I8W2ugY0KiGEU",
148
+ "type": "ContentType",
149
+ "createdAt": "2014-07-30T11:17:14.857Z",
150
+ "createdBy": {
151
+ "sys": {
152
+ "type": "Link",
153
+ "linkType": "User",
154
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
155
+ }
156
+ },
157
+ "space": {
158
+ "sys": {
159
+ "type": "Link",
160
+ "linkType": "Space",
161
+ "id": "yr5m0jky5hsh"
162
+ }
163
+ },
164
+ "version": 1,
165
+ "updatedAt": "2014-07-30T11:17:14.861Z",
166
+ "updatedBy": {
167
+ "sys": {
168
+ "type": "Link",
169
+ "linkType": "User",
170
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
171
+ }
172
+ }
173
+ }
174
+ },
175
+ {
176
+ "name": "ContentTypeForSpace",
177
+ "description": null,
178
+ "fields": [],
179
+ "sys": {
180
+ "id": "2sdtNnLWwoIgowCM0wsW2G",
181
+ "type": "ContentType",
182
+ "createdAt": "2014-07-30T11:12:15.070Z",
183
+ "createdBy": {
184
+ "sys": {
185
+ "type": "Link",
186
+ "linkType": "User",
187
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
188
+ }
189
+ },
190
+ "space": {
191
+ "sys": {
192
+ "type": "Link",
193
+ "linkType": "Space",
194
+ "id": "yr5m0jky5hsh"
195
+ }
196
+ },
197
+ "version": 1,
198
+ "updatedAt": "2014-07-30T11:12:15.073Z",
199
+ "updatedBy": {
200
+ "sys": {
201
+ "type": "Link",
202
+ "linkType": "User",
203
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
204
+ }
205
+ }
206
+ }
207
+ },
208
+ {
209
+ "name": "TestingContentType",
210
+ "description": null,
211
+ "fields": [],
212
+ "sys": {
213
+ "id": "3Pv6UOQy9ikic4qOmmiU8i",
214
+ "type": "ContentType",
215
+ "createdAt": "2014-07-30T11:08:57.603Z",
216
+ "createdBy": {
217
+ "sys": {
218
+ "type": "Link",
219
+ "linkType": "User",
220
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
221
+ }
222
+ },
223
+ "space": {
224
+ "sys": {
225
+ "type": "Link",
226
+ "linkType": "Space",
227
+ "id": "yr5m0jky5hsh"
228
+ }
229
+ },
230
+ "version": 1,
231
+ "updatedAt": "2014-07-30T11:08:57.606Z",
232
+ "updatedBy": {
233
+ "sys": {
234
+ "type": "Link",
235
+ "linkType": "User",
236
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
237
+ }
238
+ }
239
+ }
240
+ }
241
+ ]
242
+ }
243
+ http_version:
244
+ recorded_at: Wed, 30 Jul 2014 12:20:16 GMT
245
+ - request:
246
+ method: get
247
+ uri: https://api.contentful.com/spaces/yr5m0jky5hsh/assets
248
+ body:
249
+ encoding: US-ASCII
250
+ string: ''
251
+ headers:
252
+ User-Agent:
253
+ - RubyContenfulManagementGem/0.0.1
254
+ Authorization:
255
+ - Bearer <ACCESS_TOKEN>
256
+ Content-Type:
257
+ - application/vnd.contentful.management.v1+json
258
+ Content-Length:
259
+ - '0'
260
+ Host:
261
+ - api.contentful.com
262
+ response:
263
+ status:
264
+ code: 200
265
+ message: OK
266
+ headers:
267
+ Server:
268
+ - nginx
269
+ Date:
270
+ - Wed, 30 Jul 2014 12:20:16 GMT
271
+ Content-Type:
272
+ - application/vnd.contentful.management.v1+json
273
+ Content-Length:
274
+ - '1436'
275
+ Connection:
276
+ - keep-alive
277
+ X-Powered-By:
278
+ - Express
279
+ Cf-Space-Id:
280
+ - yr5m0jky5hsh
281
+ Etag:
282
+ - '"6a36522012e7b20e2f0b69e4b8f42da4"'
283
+ Access-Control-Allow-Origin:
284
+ - "*"
285
+ Access-Control-Allow-Headers:
286
+ - 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
287
+ Access-Control-Allow-Methods:
288
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
289
+ "^access-Control-Expose-Headers":
290
+ - Etag
291
+ Access-Control-Max-Age:
292
+ - '1728000'
293
+ body:
294
+ encoding: UTF-8
295
+ string: |
296
+ {
297
+ "sys": {
298
+ "type": "Array"
299
+ },
300
+ "total": 1,
301
+ "skip": 0,
302
+ "limit": 100,
303
+ "items": [
304
+ {
305
+ "fields": {
306
+ "title": {
307
+ "en-US": "Dog photo"
308
+ },
309
+ "description": {
310
+ "en-US": "Photo of Dog"
311
+ },
312
+ "file": {
313
+ "en-US": {
314
+ "fileName": "piesel_tTWRRK8aCP,q250.jpg",
315
+ "contentType": "image/jpeg",
316
+ "details": {
317
+ "image": {
318
+ "width": 250,
319
+ "height": 250
320
+ },
321
+ "size": 22083
322
+ },
323
+ "url": "//images.contentful.com/yr5m0jky5hsh/6zEogZjpO8cq6YOOQigiAw/09037706e5c5e6c2b910f9a4160eb697/piesel_tTWRRK8aCP_q250.jpg"
324
+ }
325
+ }
326
+ },
327
+ "sys": {
328
+ "id": "6zEogZjpO8cq6YOOQigiAw",
329
+ "type": "Asset",
330
+ "createdAt": "2014-07-30T12:14:49.380Z",
331
+ "createdBy": {
332
+ "sys": {
333
+ "type": "Link",
334
+ "linkType": "User",
335
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
336
+ }
337
+ },
338
+ "space": {
339
+ "sys": {
340
+ "type": "Link",
341
+ "linkType": "Space",
342
+ "id": "yr5m0jky5hsh"
343
+ }
344
+ },
345
+ "version": 58,
346
+ "updatedAt": "2014-07-30T12:16:37.270Z",
347
+ "updatedBy": {
348
+ "sys": {
349
+ "type": "Link",
350
+ "linkType": "User",
351
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
352
+ }
353
+ }
354
+ }
355
+ }
356
+ ]
357
+ }
358
+ http_version:
359
+ recorded_at: Wed, 30 Jul 2014 12:20:17 GMT
360
+ - request:
361
+ method: post
362
+ uri: https://api.contentful.com/spaces/yr5m0jky5hsh/assets/
363
+ body:
364
+ encoding: UTF-8
365
+ string: '{"fields":{"title":{"en-US":"CodeQuest"},"description":{"en-US":"Logo
366
+ of Codequest"},"file":{"en-US":{"contentType":"image/jpeg","fileName":"codequest.jpg","upload":"http://static.goldenline.pl/firm_logo/082/firm_225106_22f37f_small.jpg"}}}}'
367
+ headers:
368
+ User-Agent:
369
+ - RubyContenfulManagementGem/0.0.1
370
+ Authorization:
371
+ - Bearer <ACCESS_TOKEN>
372
+ Content-Type:
373
+ - application/vnd.contentful.management.v1+json
374
+ Host:
375
+ - api.contentful.com
376
+ response:
377
+ status:
378
+ code: 201
379
+ message: Created
380
+ headers:
381
+ Server:
382
+ - nginx
383
+ Date:
384
+ - Wed, 30 Jul 2014 12:20:17 GMT
385
+ Content-Type:
386
+ - application/vnd.contentful.management.v1+json
387
+ Content-Length:
388
+ - '931'
389
+ Connection:
390
+ - keep-alive
391
+ X-Powered-By:
392
+ - Express
393
+ Cf-Space-Id:
394
+ - yr5m0jky5hsh
395
+ Etag:
396
+ - '"898c4f1fabc8515ef81317d1e6d2f1f5"'
397
+ Access-Control-Allow-Origin:
398
+ - "*"
399
+ Access-Control-Allow-Headers:
400
+ - 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
401
+ Access-Control-Allow-Methods:
402
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
403
+ "^access-Control-Expose-Headers":
404
+ - Etag
405
+ Access-Control-Max-Age:
406
+ - '1728000'
407
+ body:
408
+ encoding: UTF-8
409
+ string: |
410
+ {
411
+ "fields": {
412
+ "title": {
413
+ "en-US": "CodeQuest"
414
+ },
415
+ "description": {
416
+ "en-US": "Logo of Codequest"
417
+ },
418
+ "file": {
419
+ "en-US": {
420
+ "contentType": "image/jpeg",
421
+ "fileName": "codequest.jpg",
422
+ "upload": "http://static.goldenline.pl/firm_logo/082/firm_225106_22f37f_small.jpg"
423
+ }
424
+ }
425
+ },
426
+ "sys": {
427
+ "id": "4k8mYw2MzS6kYG0eGq0Yi0",
428
+ "type": "Asset",
429
+ "version": 1,
430
+ "createdAt": "2014-07-30T12:20:17.778Z",
431
+ "createdBy": {
432
+ "sys": {
433
+ "type": "Link",
434
+ "linkType": "User",
435
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
436
+ }
437
+ },
438
+ "space": {
439
+ "sys": {
440
+ "type": "Link",
441
+ "linkType": "Space",
442
+ "id": "yr5m0jky5hsh"
443
+ }
444
+ },
445
+ "updatedAt": "2014-07-30T12:20:17.778Z",
446
+ "updatedBy": {
447
+ "sys": {
448
+ "type": "Link",
449
+ "linkType": "User",
450
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
451
+ }
452
+ }
453
+ }
454
+ }
455
+ http_version:
456
+ recorded_at: Wed, 30 Jul 2014 12:20:17 GMT
457
+ - request:
458
+ method: put
459
+ uri: https://api.contentful.com/spaces/yr5m0jky5hsh/assets/4k8mYw2MzS6kYG0eGq0Yi0/files/en-US/process
460
+ body:
461
+ encoding: US-ASCII
462
+ string: ''
463
+ headers:
464
+ User-Agent:
465
+ - RubyContenfulManagementGem/0.0.1
466
+ Authorization:
467
+ - Bearer <ACCESS_TOKEN>
468
+ Content-Type:
469
+ - application/vnd.contentful.management.v1+json
470
+ X-Contentful-Version:
471
+ - '1'
472
+ Content-Length:
473
+ - '0'
474
+ Host:
475
+ - api.contentful.com
476
+ response:
477
+ status:
478
+ code: 204
479
+ message: No Content
480
+ headers:
481
+ Server:
482
+ - nginx
483
+ Date:
484
+ - Wed, 30 Jul 2014 12:20:18 GMT
485
+ Content-Type:
486
+ - application/vnd.contentful.management.v1+json
487
+ Connection:
488
+ - keep-alive
489
+ X-Powered-By:
490
+ - Express
491
+ Cf-Space-Id:
492
+ - yr5m0jky5hsh
493
+ Access-Control-Allow-Origin:
494
+ - "*"
495
+ Access-Control-Allow-Headers:
496
+ - 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
497
+ Access-Control-Allow-Methods:
498
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
499
+ "^access-Control-Expose-Headers":
500
+ - Etag
501
+ Access-Control-Max-Age:
502
+ - '1728000'
503
+ body:
504
+ encoding: UTF-8
505
+ string: ''
506
+ http_version:
507
+ recorded_at: Wed, 30 Jul 2014 12:20:18 GMT
508
+ recorded_with: VCR 2.9.2