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,221 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/spaces/yr5m0jky5hsh/content_types/qw3F2rn3FeoOiceqAiCSC
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 10:32:23 GMT
29
+ Content-Type:
30
+ - application/vnd.contentful.management.v1+json
31
+ Content-Length:
32
+ - '1121'
33
+ Connection:
34
+ - keep-alive
35
+ X-Powered-By:
36
+ - Express
37
+ Cf-Space-Id:
38
+ - yr5m0jky5hsh
39
+ Etag:
40
+ - '"029c336b84a59aa7ab0f6ae856b87c94"'
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
+ "name": "Blog Content",
56
+ "description": "Blogs content type",
57
+ "fields": [
58
+ {
59
+ "id": "blog_author",
60
+ "name": "blog_author",
61
+ "type": "Text",
62
+ "localized": true,
63
+ "uiid": "40u3yg9v7cw"
64
+ }
65
+ ],
66
+ "sys": {
67
+ "id": "qw3F2rn3FeoOiceqAiCSC",
68
+ "type": "ContentType",
69
+ "createdAt": "2014-07-31T09:12:04.064Z",
70
+ "createdBy": {
71
+ "sys": {
72
+ "type": "Link",
73
+ "linkType": "User",
74
+ "id": "0fn5fOWn4WsKFyYla1gI5h"
75
+ }
76
+ },
77
+ "space": {
78
+ "sys": {
79
+ "type": "Link",
80
+ "linkType": "Space",
81
+ "id": "yr5m0jky5hsh"
82
+ }
83
+ },
84
+ "firstPublishedAt": "2014-07-31T09:42:50.228Z",
85
+ "publishedCounter": 6,
86
+ "publishedAt": "2014-07-31T10:06:34.907Z",
87
+ "publishedBy": {
88
+ "sys": {
89
+ "type": "Link",
90
+ "linkType": "User",
91
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
92
+ }
93
+ },
94
+ "publishedVersion": 181,
95
+ "version": 184,
96
+ "updatedAt": "2014-07-31T10:15:12.026Z",
97
+ "updatedBy": {
98
+ "sys": {
99
+ "type": "Link",
100
+ "linkType": "User",
101
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
102
+ }
103
+ }
104
+ }
105
+ }
106
+ http_version:
107
+ recorded_at: Thu, 31 Jul 2014 10:32:24 GMT
108
+ - request:
109
+ method: put
110
+ uri: https://api.contentful.com/spaces/yr5m0jky5hsh/content_types/qw3F2rn3FeoOiceqAiCSC
111
+ body:
112
+ encoding: UTF-8
113
+ string: '{"name":"Blog Content","description":"Blogs content type","fields":[{"id":"blog_author","name":"blog_author","type":"Text","localized":true},{"id":"blog_avatar","name":"Blog
114
+ avatar","type":"Link","linkType":"Asset","required":true,"localized":true}]}'
115
+ headers:
116
+ User-Agent:
117
+ - RubyContenfulManagementGem/0.0.1
118
+ Authorization:
119
+ - Bearer <ACCESS_TOKEN>
120
+ Content-Type:
121
+ - application/vnd.contentful.management.v1+json
122
+ X-Contentful-Version:
123
+ - '184'
124
+ Host:
125
+ - api.contentful.com
126
+ response:
127
+ status:
128
+ code: 200
129
+ message: OK
130
+ headers:
131
+ Server:
132
+ - nginx
133
+ Date:
134
+ - Thu, 31 Jul 2014 10:32:24 GMT
135
+ Content-Type:
136
+ - application/vnd.contentful.management.v1+json
137
+ Content-Length:
138
+ - '1258'
139
+ Connection:
140
+ - keep-alive
141
+ X-Powered-By:
142
+ - Express
143
+ Cf-Space-Id:
144
+ - yr5m0jky5hsh
145
+ Etag:
146
+ - '"71ab34b36df54507f6a7b08ebfdc2838"'
147
+ Access-Control-Allow-Origin:
148
+ - "*"
149
+ Access-Control-Allow-Headers:
150
+ - 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
151
+ Access-Control-Allow-Methods:
152
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
153
+ "^access-Control-Expose-Headers":
154
+ - Etag
155
+ Access-Control-Max-Age:
156
+ - '1728000'
157
+ body:
158
+ encoding: UTF-8
159
+ string: |
160
+ {
161
+ "name": "Blog Content",
162
+ "description": "Blogs content type",
163
+ "fields": [
164
+ {
165
+ "id": "blog_author",
166
+ "name": "blog_author",
167
+ "type": "Text",
168
+ "localized": true
169
+ },
170
+ {
171
+ "id": "blog_avatar",
172
+ "name": "Blog avatar",
173
+ "type": "Link",
174
+ "linkType": "Asset",
175
+ "required": true,
176
+ "localized": true
177
+ }
178
+ ],
179
+ "sys": {
180
+ "id": "qw3F2rn3FeoOiceqAiCSC",
181
+ "type": "ContentType",
182
+ "createdAt": "2014-07-31T09:12:04.064Z",
183
+ "createdBy": {
184
+ "sys": {
185
+ "type": "Link",
186
+ "linkType": "User",
187
+ "id": "0fn5fOWn4WsKFyYla1gI5h"
188
+ }
189
+ },
190
+ "space": {
191
+ "sys": {
192
+ "type": "Link",
193
+ "linkType": "Space",
194
+ "id": "yr5m0jky5hsh"
195
+ }
196
+ },
197
+ "firstPublishedAt": "2014-07-31T09:42:50.228Z",
198
+ "publishedCounter": 6,
199
+ "publishedAt": "2014-07-31T10:06:34.907Z",
200
+ "publishedBy": {
201
+ "sys": {
202
+ "type": "Link",
203
+ "linkType": "User",
204
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
205
+ }
206
+ },
207
+ "publishedVersion": 181,
208
+ "version": 185,
209
+ "updatedAt": "2014-07-31T10:32:24.638Z",
210
+ "updatedBy": {
211
+ "sys": {
212
+ "type": "Link",
213
+ "linkType": "User",
214
+ "id": "0fn5fOWn4WsKFyYla1gI5h"
215
+ }
216
+ }
217
+ }
218
+ }
219
+ http_version:
220
+ recorded_at: Thu, 31 Jul 2014 10:32:24 GMT
221
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,349 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/spaces/yr5m0jky5hsh/content_types/5DSpuKrl04eMAGQoQckeIq
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 10:23:16 GMT
29
+ Content-Type:
30
+ - application/vnd.contentful.management.v1+json
31
+ Content-Length:
32
+ - '2535'
33
+ Connection:
34
+ - keep-alive
35
+ X-Powered-By:
36
+ - Express
37
+ Cf-Space-Id:
38
+ - yr5m0jky5hsh
39
+ Etag:
40
+ - '"be937072a9c3c5df5da8c8918380abb3"'
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
+ "name": "Author",
56
+ "description": "Author content",
57
+ "fields": [
58
+ {
59
+ "id": "name",
60
+ "name": "name",
61
+ "type": "Text",
62
+ "localized": true,
63
+ "uiid": "3fnjrmrzsw0"
64
+ },
65
+ {
66
+ "id": "age",
67
+ "name": "age",
68
+ "type": "Integer",
69
+ "localized": true,
70
+ "uiid": "2x7le5rj8cg"
71
+ },
72
+ {
73
+ "id": "city",
74
+ "name": "city",
75
+ "type": "Location",
76
+ "uiid": "34nyz99kwsg"
77
+ },
78
+ {
79
+ "id": "assets",
80
+ "name": "assets",
81
+ "type": "Array",
82
+ "items": {
83
+ "type": "Link",
84
+ "linkType": "Asset"
85
+ },
86
+ "localized": true,
87
+ "uiid": "4v30b6wwsg0"
88
+ },
89
+ {
90
+ "id": "entries",
91
+ "name": "entries",
92
+ "type": "Array",
93
+ "items": {
94
+ "type": "Link",
95
+ "linkType": "Entry"
96
+ },
97
+ "uiid": "3ma074wuq68"
98
+ },
99
+ {
100
+ "id": "entry",
101
+ "name": "entry",
102
+ "type": "Link",
103
+ "linkType": "Entry",
104
+ "uiid": "2oc56lgyx34"
105
+ },
106
+ {
107
+ "id": "asset",
108
+ "name": "asset",
109
+ "type": "Link",
110
+ "linkType": "Asset",
111
+ "uiid": "2kim1fokp34"
112
+ },
113
+ {
114
+ "id": "bool",
115
+ "name": "bool",
116
+ "type": "Boolean",
117
+ "localized": true,
118
+ "uiid": "4h4gopvuvwg"
119
+ },
120
+ {
121
+ "id": "symbols",
122
+ "name": "symbols",
123
+ "type": "Array",
124
+ "items": {
125
+ "type": "Symbol"
126
+ },
127
+ "uiid": "2lwayq7txxc"
128
+ },
129
+ {
130
+ "id": "birthday",
131
+ "name": "birthday",
132
+ "type": "Date",
133
+ "uiid": "3i04fu9wkcg"
134
+ },
135
+ {
136
+ "id": "blog_title",
137
+ "name": "Blog Title",
138
+ "type": "Text",
139
+ "uiid": "2j1b0pmy9s0"
140
+ }
141
+ ],
142
+ "sys": {
143
+ "id": "5DSpuKrl04eMAGQoQckeIq",
144
+ "type": "ContentType",
145
+ "createdAt": "2014-07-30T12:35:01.110Z",
146
+ "createdBy": {
147
+ "sys": {
148
+ "type": "Link",
149
+ "linkType": "User",
150
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
151
+ }
152
+ },
153
+ "space": {
154
+ "sys": {
155
+ "type": "Link",
156
+ "linkType": "Space",
157
+ "id": "yr5m0jky5hsh"
158
+ }
159
+ },
160
+ "firstPublishedAt": "2014-07-30T12:37:42.035Z",
161
+ "publishedCounter": 9,
162
+ "publishedAt": "2014-07-31T10:21:36.870Z",
163
+ "publishedBy": {
164
+ "sys": {
165
+ "type": "Link",
166
+ "linkType": "User",
167
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
168
+ }
169
+ },
170
+ "publishedVersion": 206,
171
+ "version": 207,
172
+ "updatedAt": "2014-07-31T10:21:36.883Z",
173
+ "updatedBy": {
174
+ "sys": {
175
+ "type": "Link",
176
+ "linkType": "User",
177
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
178
+ }
179
+ }
180
+ }
181
+ }
182
+ http_version:
183
+ recorded_at: Thu, 31 Jul 2014 10:23:16 GMT
184
+ - request:
185
+ method: put
186
+ uri: https://api.contentful.com/spaces/yr5m0jky5hsh/content_types/5DSpuKrl04eMAGQoQckeIq
187
+ body:
188
+ encoding: UTF-8
189
+ string: '{"name":"Author","description":"Author content","fields":[{"id":"name","name":"name","type":"Text","localized":true},{"id":"age","name":"age","type":"Integer","localized":true},{"id":"city","name":"city","type":"Location"},{"id":"assets","name":"assets","type":"Array","items":{"type":"Link","linkType":"Asset"},"localized":true},{"id":"entries","name":"entries","type":"Array","items":{"type":"Link","linkType":"Entry"}},{"id":"entry","name":"entry","type":"Link","linkType":"Entry"},{"id":"asset","name":"asset","type":"Link","linkType":"Asset"},{"id":"bool","name":"bool","type":"Boolean","localized":true},{"id":"symbols","name":"symbols","type":"Array","items":{"type":"Symbol"}},{"id":"birthday","name":"birthday","type":"Date"}]}'
190
+ headers:
191
+ User-Agent:
192
+ - RubyContenfulManagementGem/0.0.1
193
+ Authorization:
194
+ - Bearer <ACCESS_TOKEN>
195
+ Content-Type:
196
+ - application/vnd.contentful.management.v1+json
197
+ X-Contentful-Version:
198
+ - '207'
199
+ Host:
200
+ - api.contentful.com
201
+ response:
202
+ status:
203
+ code: 200
204
+ message: OK
205
+ headers:
206
+ Server:
207
+ - nginx
208
+ Date:
209
+ - Thu, 31 Jul 2014 10:23:17 GMT
210
+ Content-Type:
211
+ - application/vnd.contentful.management.v1+json
212
+ Content-Length:
213
+ - '2128'
214
+ Connection:
215
+ - keep-alive
216
+ X-Powered-By:
217
+ - Express
218
+ Cf-Space-Id:
219
+ - yr5m0jky5hsh
220
+ Etag:
221
+ - '"1d146002978f50a10868aa7da2ad2c9a"'
222
+ Access-Control-Allow-Origin:
223
+ - "*"
224
+ Access-Control-Allow-Headers:
225
+ - 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
226
+ Access-Control-Allow-Methods:
227
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
228
+ "^access-Control-Expose-Headers":
229
+ - Etag
230
+ Access-Control-Max-Age:
231
+ - '1728000'
232
+ body:
233
+ encoding: UTF-8
234
+ string: |
235
+ {
236
+ "name": "Author",
237
+ "description": "Author content",
238
+ "fields": [
239
+ {
240
+ "id": "name",
241
+ "name": "name",
242
+ "type": "Text",
243
+ "localized": true
244
+ },
245
+ {
246
+ "id": "age",
247
+ "name": "age",
248
+ "type": "Integer",
249
+ "localized": true
250
+ },
251
+ {
252
+ "id": "city",
253
+ "name": "city",
254
+ "type": "Location"
255
+ },
256
+ {
257
+ "id": "assets",
258
+ "name": "assets",
259
+ "type": "Array",
260
+ "items": {
261
+ "type": "Link",
262
+ "linkType": "Asset"
263
+ },
264
+ "localized": true
265
+ },
266
+ {
267
+ "id": "entries",
268
+ "name": "entries",
269
+ "type": "Array",
270
+ "items": {
271
+ "type": "Link",
272
+ "linkType": "Entry"
273
+ }
274
+ },
275
+ {
276
+ "id": "entry",
277
+ "name": "entry",
278
+ "type": "Link",
279
+ "linkType": "Entry"
280
+ },
281
+ {
282
+ "id": "asset",
283
+ "name": "asset",
284
+ "type": "Link",
285
+ "linkType": "Asset"
286
+ },
287
+ {
288
+ "id": "bool",
289
+ "name": "bool",
290
+ "type": "Boolean",
291
+ "localized": true
292
+ },
293
+ {
294
+ "id": "symbols",
295
+ "name": "symbols",
296
+ "type": "Array",
297
+ "items": {
298
+ "type": "Symbol"
299
+ }
300
+ },
301
+ {
302
+ "id": "birthday",
303
+ "name": "birthday",
304
+ "type": "Date"
305
+ }
306
+ ],
307
+ "sys": {
308
+ "id": "5DSpuKrl04eMAGQoQckeIq",
309
+ "type": "ContentType",
310
+ "createdAt": "2014-07-30T12:35:01.110Z",
311
+ "createdBy": {
312
+ "sys": {
313
+ "type": "Link",
314
+ "linkType": "User",
315
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
316
+ }
317
+ },
318
+ "space": {
319
+ "sys": {
320
+ "type": "Link",
321
+ "linkType": "Space",
322
+ "id": "yr5m0jky5hsh"
323
+ }
324
+ },
325
+ "firstPublishedAt": "2014-07-30T12:37:42.035Z",
326
+ "publishedCounter": 9,
327
+ "publishedAt": "2014-07-31T10:21:36.870Z",
328
+ "publishedBy": {
329
+ "sys": {
330
+ "type": "Link",
331
+ "linkType": "User",
332
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
333
+ }
334
+ },
335
+ "publishedVersion": 206,
336
+ "version": 208,
337
+ "updatedAt": "2014-07-31T10:23:17.141Z",
338
+ "updatedBy": {
339
+ "sys": {
340
+ "type": "Link",
341
+ "linkType": "User",
342
+ "id": "0fn5fOWn4WsKFyYla1gI5h"
343
+ }
344
+ }
345
+ }
346
+ }
347
+ http_version:
348
+ recorded_at: Thu, 31 Jul 2014 10:23:17 GMT
349
+ recorded_with: VCR 2.9.2