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,72 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require_relative 'error'
3
+ require 'multi_json'
4
+
5
+ module Contentful
6
+ module Management
7
+ # An object representing an answer by the contentful service. It is later used
8
+ # to build a Resource, which is done by the ResourceBuilder.
9
+ #
10
+ # The Response parses the http response (as returned by the underlying http library) to
11
+ # a JSON object. Responses can be asked the following methods:
12
+ # - #raw (raw HTTP response by the HTTP library)
13
+ # - #object (the parsed JSON object)
14
+ # - #request (the request the response is refering to)
15
+ #
16
+ # It also sets a #status which can be one of:
17
+ # - :ok (seems to be a valid resource object)
18
+ # - :contentful_error (valid error object)
19
+ # - :not_contentful (valid json, but missing the contentful's sys property)
20
+ # - :unparsable_json (invalid json)
21
+ #
22
+ # Error Repsonses also contain a:
23
+ # - :error_message
24
+ class Response
25
+ attr_reader :raw, :object, :status, :error_message, :request
26
+
27
+ def initialize(raw, request = nil)
28
+ @raw = raw
29
+ @request = request
30
+ @status = :ok
31
+
32
+ if no_content_response?
33
+ @status = :no_content
34
+ @object = true
35
+ elsif parse_json!
36
+ parse_contentful_error!
37
+ end
38
+ end
39
+
40
+ private
41
+
42
+ def no_content_response?
43
+ @raw.to_s == '' && @raw.status == 204
44
+ end
45
+
46
+ def parse_json!
47
+ @object = MultiJson.load(raw.to_s)
48
+ true
49
+ rescue MultiJson::LoadError => e
50
+ @status = :unparsable_json
51
+ @error_message = e.message
52
+ @object = e
53
+ false
54
+ end
55
+
56
+ def parse_contentful_error!
57
+ if @object && @object['sys']
58
+ if @object['sys']['type'] == 'Error'
59
+ @status = :contentful_error
60
+ @error_message = object['message']
61
+ true
62
+ else
63
+ false
64
+ end
65
+ else
66
+ @status = :not_contentful
67
+ @error_message = 'No contentful system properties found in object'
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,159 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require_relative 'resource'
3
+ require_relative 'locale'
4
+ require_relative 'content_type'
5
+ require_relative 'asset'
6
+ require_relative 'entry'
7
+
8
+ module Contentful
9
+ module Management
10
+ class Space
11
+ include Contentful::Management::Resource
12
+ include Contentful::Management::Resource::SystemProperties
13
+ include Contentful::Management::Resource::Refresher
14
+
15
+ property :name, :string
16
+ property :organization, :string
17
+ property :locales, Locale
18
+
19
+ def self.all
20
+ request = Request.new('')
21
+ response = request.get
22
+ result = ResourceBuilder.new(self, response, {}, {})
23
+ spaces = result.run
24
+ Contentful::Management::Client.shared_instance.update_dynamic_entry_cache_for_spaces!(spaces)
25
+ spaces
26
+ end
27
+
28
+ def self.find(space_id)
29
+ request = Request.new("/#{ space_id }")
30
+ response = request.get
31
+ result = ResourceBuilder.new(self, response, {}, {})
32
+ space = result.run
33
+ Contentful::Management::Client.shared_instance.update_dynamic_entry_cache_for_space!(space) if space.is_a?Space
34
+ space
35
+ end
36
+
37
+ def self.create(attributes)
38
+ request = Request.new('', { 'name' => attributes.fetch(:name) }, id = nil, organization_id: attributes[:organization_id])
39
+ response = request.post
40
+ result = ResourceBuilder.new(self, response, {}, {})
41
+ result.run
42
+ end
43
+
44
+ def update(attributes)
45
+ request = Request.new("/#{ id }", { 'name' => attributes.fetch(:name) }, id = nil,{ version: sys[:version], organization_id: attributes[:organization_id]})
46
+ response = request.put
47
+ result = ResourceBuilder.new(self, response, {}, {})
48
+ refresh_data(result.run)
49
+ end
50
+
51
+ def save
52
+ if id.nil?
53
+ new_instance = self.class.create(name: name, organization_id: organization)
54
+ refresh_data(new_instance)
55
+ else
56
+ update(name: name, organization_id: organization)
57
+ end
58
+ end
59
+
60
+ def destroy
61
+ request = Request.new("/#{ id }")
62
+ response = request.delete
63
+ if response.status == :no_content
64
+ return true
65
+ else
66
+ ResourceBuilder.new(self, response, {}, {}).run
67
+ end
68
+ end
69
+
70
+ def content_types
71
+ content_types = ContentType.all(id)
72
+
73
+ content_types.instance_exec(self) do |space|
74
+
75
+ define_singleton_method(:all) do
76
+ ContentType.all(space.id)
77
+ end
78
+
79
+ define_singleton_method(:create) do |params|
80
+ ContentType.create(space.id, params)
81
+ end
82
+
83
+ define_singleton_method(:find) do |content_type_id|
84
+ ContentType.find(space.id, content_type_id)
85
+ end
86
+
87
+ define_singleton_method(:new) do
88
+ ct = ContentType.new
89
+ ct.sys[:space] = space
90
+ ct
91
+ end
92
+
93
+ end
94
+ content_types
95
+ end
96
+
97
+ def locales
98
+ locales = Locale.all(id)
99
+
100
+ locales.instance_exec(self) do |space|
101
+ define_singleton_method(:all) do
102
+ Locale.all(space.id)
103
+ end
104
+
105
+ define_singleton_method(:create) do |params|
106
+ Locale.create(space.id, params)
107
+ end
108
+
109
+ define_singleton_method(:find) do |locale_id|
110
+ Locale.find(space.id, locale_id)
111
+ end
112
+ end
113
+
114
+ locales
115
+ end
116
+
117
+ def assets
118
+ assets = Asset.all(id)
119
+
120
+ assets.instance_exec(self) do |space|
121
+ define_singleton_method(:all) do
122
+ Asset.all(space.id)
123
+ end
124
+
125
+ define_singleton_method(:find) do |asset_id|
126
+ Asset.find(space.id, asset_id)
127
+ end
128
+
129
+ define_singleton_method(:create) do |params|
130
+ Asset.create(space.id, params)
131
+ end
132
+
133
+ define_singleton_method(:new) do
134
+ asset = Asset.new
135
+ asset.sys[:space] = space
136
+ asset
137
+ end
138
+ end
139
+ assets
140
+ end
141
+
142
+ def entries
143
+ entries = Entry.all(id)
144
+
145
+ entries.instance_exec(self) do |space|
146
+ define_singleton_method(:all) do
147
+ Entry.all(space.id)
148
+ end
149
+
150
+ define_singleton_method(:find) do |entry_id|
151
+ Entry.find(space.id, entry_id)
152
+ end
153
+ end
154
+ entries
155
+ end
156
+
157
+ end
158
+ end
159
+ end
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ module Contentful
3
+ module Management
4
+ # Utility methods used by the contentful gemend
5
+ module Support
6
+ class << self
7
+ # Transforms CamelCase into snake_case (taken from zucker)
8
+ def snakify(object)
9
+ snake = String(object).gsub(/(?<!^)[A-Z]/) { "_#$&" }
10
+ snake.downcase
11
+ end
12
+
13
+ def deep_hash_merge(hash_1, hash_2)
14
+ hash_1.merge(hash_2) do |_key, oldval, newval|
15
+ oldval = oldval.to_hash if oldval.respond_to?(:to_hash)
16
+ newval = newval.to_hash if newval.respond_to?(:to_hash)
17
+ oldval.class.to_s == 'Hash' && newval.class.to_s == 'Hash' ? self.deep_hash_merge(oldval, newval) : newval
18
+ end
19
+ end
20
+
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,6 @@
1
+ # -*- encoding: utf-8 -*-
2
+ module Contentful
3
+ module Management
4
+ VERSION = '0.0.1.pre'
5
+ end
6
+ end
@@ -0,0 +1,1337 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/spaces
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 13:57:44 GMT
29
+ Content-Type:
30
+ - application/vnd.contentful.management.v1+json
31
+ Content-Length:
32
+ - '2868'
33
+ Connection:
34
+ - keep-alive
35
+ Status:
36
+ - 200 OK
37
+ X-Contentful-Request-Id:
38
+ - 85f-1334625580
39
+ Etag:
40
+ - '"5c57b11337cbfadefcdd4ad178133ffd"'
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":"Array"
61
+ },
62
+ "items":[
63
+ {
64
+ "sys":{
65
+ "type":"Space",
66
+ "id":"l6a1rhnfkzbm",
67
+ "version":1,
68
+ "createdBy":{
69
+ "sys":{
70
+ "type":"Link",
71
+ "linkType":"User",
72
+ "id":"1E7acJL8I5XUXAMHQt9Grs"
73
+ }
74
+ },
75
+ "createdAt":"2014-07-04T13:15:37Z",
76
+ "updatedBy":{
77
+ "sys":{
78
+ "type":"Link",
79
+ "linkType":"User",
80
+ "id":"1E7acJL8I5XUXAMHQt9Grs"
81
+ }
82
+ },
83
+ "updatedAt":"2014-07-04T13:15:37Z"
84
+ },
85
+ "name":"Playground",
86
+ "tutorial":true
87
+ },
88
+ {
89
+ "sys":{
90
+ "type":"Space",
91
+ "id":"n6spjc167pc2",
92
+ "version":13,
93
+ "createdBy":{
94
+ "sys":{
95
+ "type":"Link",
96
+ "linkType":"User",
97
+ "id":"1E7acJL8I5XUXAMHQt9Grs"
98
+ }
99
+ },
100
+ "createdAt":"2014-07-09T11:04:14Z",
101
+ "updatedBy":{
102
+ "sys":{
103
+ "type":"Link",
104
+ "linkType":"User",
105
+ "id":"1E7acJL8I5XUXAMHQt9Grs"
106
+ }
107
+ },
108
+ "updatedAt":"2014-07-31T06:42:35Z"
109
+ },
110
+ "name":"NewNameSpace"
111
+ },
112
+ {
113
+ "sys":{
114
+ "type":"Space",
115
+ "id":"yr5m0jky5hsh",
116
+ "version":10,
117
+ "createdBy":{
118
+ "sys":{
119
+ "type":"Link",
120
+ "linkType":"User",
121
+ "id":"0fn5fOWn4WsKFyYla1gI5h"
122
+ }
123
+ },
124
+ "createdAt":"2014-07-30T07:46:19Z",
125
+ "updatedBy":{
126
+ "sys":{
127
+ "type":"Link",
128
+ "linkType":"User",
129
+ "id":"1E7acJL8I5XUXAMHQt9Grs"
130
+ }
131
+ },
132
+ "updatedAt":"2014-07-31T07:26:59Z"
133
+ },
134
+ "name":"BlogSpace"
135
+ },
136
+ {
137
+ "sys":{
138
+ "type":"Space",
139
+ "id":"1db9wmjkhf78",
140
+ "version":1,
141
+ "createdBy":{
142
+ "sys":{
143
+ "type":"Link",
144
+ "linkType":"User",
145
+ "id":"1E7acJL8I5XUXAMHQt9Grs"
146
+ }
147
+ },
148
+ "createdAt":"2014-07-30T09:28:50Z",
149
+ "updatedBy":{
150
+ "sys":{
151
+ "type":"Link",
152
+ "linkType":"User",
153
+ "id":"1E7acJL8I5XUXAMHQt9Grs"
154
+ }
155
+ },
156
+ "updatedAt":"2014-07-30T09:28:51Z"
157
+ },
158
+ "name":"My Test Space"
159
+ },
160
+ {
161
+ "sys":{
162
+ "type":"Space",
163
+ "id":"cbvgg8sz6wyh",
164
+ "version":1,
165
+ "createdBy":{
166
+ "sys":{
167
+ "type":"Link",
168
+ "linkType":"User",
169
+ "id":"1E7acJL8I5XUXAMHQt9Grs"
170
+ }
171
+ },
172
+ "createdAt":"2014-07-30T09:29:21Z",
173
+ "updatedBy":{
174
+ "sys":{
175
+ "type":"Link",
176
+ "linkType":"User",
177
+ "id":"1E7acJL8I5XUXAMHQt9Grs"
178
+ }
179
+ },
180
+ "updatedAt":"2014-07-30T09:29:21Z"
181
+ },
182
+ "name":"My Test Space"
183
+ }
184
+ ],
185
+ "total":5,
186
+ "limit":25,
187
+ "skip":0}
188
+ http_version:
189
+ recorded_at: Fri, 01 Aug 2014 13:57:44 GMT
190
+ - request:
191
+ method: get
192
+ uri: https://api.contentful.com/spaces/l6a1rhnfkzbm/content_types
193
+ body:
194
+ encoding: US-ASCII
195
+ string: ''
196
+ headers:
197
+ User-Agent:
198
+ - RubyContenfulManagementGem/0.0.1
199
+ Authorization:
200
+ - Bearer <ACCESS_TOKEN>
201
+ Content-Type:
202
+ - application/vnd.contentful.management.v1+json
203
+ Content-Length:
204
+ - '0'
205
+ Host:
206
+ - api.contentful.com
207
+ response:
208
+ status:
209
+ code: 200
210
+ message: OK
211
+ headers:
212
+ Server:
213
+ - nginx
214
+ Date:
215
+ - Fri, 01 Aug 2014 13:57:45 GMT
216
+ Content-Type:
217
+ - application/vnd.contentful.management.v1+json
218
+ Content-Length:
219
+ - '1933'
220
+ Connection:
221
+ - keep-alive
222
+ X-Powered-By:
223
+ - Express
224
+ Cf-Space-Id:
225
+ - l6a1rhnfkzbm
226
+ Etag:
227
+ - '"311ac8c5ed89cece451c254973ececa5"'
228
+ Access-Control-Allow-Origin:
229
+ - "*"
230
+ Access-Control-Allow-Headers:
231
+ - 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
232
+ Access-Control-Allow-Methods:
233
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
234
+ "^access-Control-Expose-Headers":
235
+ - Etag
236
+ Access-Control-Max-Age:
237
+ - '1728000'
238
+ body:
239
+ encoding: UTF-8
240
+ string: |
241
+ {
242
+ "sys": {
243
+ "type": "Array"
244
+ },
245
+ "total": 1,
246
+ "skip": 0,
247
+ "limit": 100,
248
+ "items": [
249
+ {
250
+ "fields": [
251
+ {
252
+ "name": "Username",
253
+ "id": "username",
254
+ "type": "Text",
255
+ "uiid": "3wognc1mtj4"
256
+ },
257
+ {
258
+ "name": "Birthday",
259
+ "id": "birthday",
260
+ "type": "Date",
261
+ "uiid": "2qivbxie6tc"
262
+ },
263
+ {
264
+ "name": "Eye color",
265
+ "id": "eyeColor",
266
+ "type": "Object",
267
+ "uiid": "4ajqyjynmkg",
268
+ "disabled": false
269
+ },
270
+ {
271
+ "name": "Photo",
272
+ "id": "photo",
273
+ "type": "Link",
274
+ "uiid": "2m691fsu5mo",
275
+ "linkType": "Asset",
276
+ "validations": []
277
+ }
278
+ ],
279
+ "name": "PiotrekCodeQuest",
280
+ "sys": {
281
+ "id": "4pbVYE1kkMwEoKywekEwwg",
282
+ "type": "ContentType",
283
+ "createdAt": "2014-07-05T10:37:13.492Z",
284
+ "createdBy": {
285
+ "sys": {
286
+ "type": "Link",
287
+ "linkType": "User",
288
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
289
+ }
290
+ },
291
+ "space": {
292
+ "sys": {
293
+ "type": "Link",
294
+ "linkType": "Space",
295
+ "id": "l6a1rhnfkzbm"
296
+ }
297
+ },
298
+ "firstPublishedAt": "2014-07-05T10:41:31.485Z",
299
+ "publishedCounter": 2,
300
+ "publishedAt": "2014-07-05T10:48:23.983Z",
301
+ "publishedBy": {
302
+ "sys": {
303
+ "type": "Link",
304
+ "linkType": "User",
305
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
306
+ }
307
+ },
308
+ "publishedVersion": 139,
309
+ "version": 140,
310
+ "updatedAt": "2014-07-05T10:48:23.988Z",
311
+ "updatedBy": {
312
+ "sys": {
313
+ "type": "Link",
314
+ "linkType": "User",
315
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
316
+ }
317
+ }
318
+ },
319
+ "description": "Testing contentful...",
320
+ "displayField": "username"
321
+ }
322
+ ]
323
+ }
324
+ http_version:
325
+ recorded_at: Fri, 01 Aug 2014 13:57:45 GMT
326
+ - request:
327
+ method: get
328
+ uri: https://api.contentful.com/spaces/n6spjc167pc2/content_types
329
+ body:
330
+ encoding: US-ASCII
331
+ string: ''
332
+ headers:
333
+ User-Agent:
334
+ - RubyContenfulManagementGem/0.0.1
335
+ Authorization:
336
+ - Bearer <ACCESS_TOKEN>
337
+ Content-Type:
338
+ - application/vnd.contentful.management.v1+json
339
+ Content-Length:
340
+ - '0'
341
+ Host:
342
+ - api.contentful.com
343
+ response:
344
+ status:
345
+ code: 200
346
+ message: OK
347
+ headers:
348
+ Server:
349
+ - nginx
350
+ Date:
351
+ - Fri, 01 Aug 2014 13:57:46 GMT
352
+ Content-Type:
353
+ - application/vnd.contentful.management.v1+json
354
+ Content-Length:
355
+ - '10227'
356
+ Connection:
357
+ - keep-alive
358
+ X-Powered-By:
359
+ - Express
360
+ Cf-Space-Id:
361
+ - n6spjc167pc2
362
+ Etag:
363
+ - '"aa6a8c371bba040d15223e1307a8f92a"'
364
+ Access-Control-Allow-Origin:
365
+ - "*"
366
+ Access-Control-Allow-Headers:
367
+ - 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
368
+ Access-Control-Allow-Methods:
369
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
370
+ "^access-Control-Expose-Headers":
371
+ - Etag
372
+ Access-Control-Max-Age:
373
+ - '1728000'
374
+ body:
375
+ encoding: UTF-8
376
+ string: |
377
+ {
378
+ "sys": {
379
+ "type": "Array"
380
+ },
381
+ "total": 6,
382
+ "skip": 0,
383
+ "limit": 100,
384
+ "items": [
385
+ {
386
+ "fields": [
387
+ {
388
+ "name": "text",
389
+ "id": "text",
390
+ "type": "Text",
391
+ "uiid": "3o0tc4nuv40",
392
+ "localized": true
393
+ },
394
+ {
395
+ "name": "numer",
396
+ "id": "numer",
397
+ "type": "Integer",
398
+ "uiid": "48v3t1f8xs0",
399
+ "localized": true
400
+ },
401
+ {
402
+ "name": "asset",
403
+ "id": "asset",
404
+ "type": "Link",
405
+ "uiid": "2ic3kjpcsg0",
406
+ "linkType": "Asset"
407
+ }
408
+ ],
409
+ "name": "ttesttest",
410
+ "sys": {
411
+ "id": "4Xf5GFNR2geAkQQomOa6Ik",
412
+ "type": "ContentType",
413
+ "createdAt": "2014-07-22T07:47:11.938Z",
414
+ "createdBy": {
415
+ "sys": {
416
+ "type": "Link",
417
+ "linkType": "User",
418
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
419
+ }
420
+ },
421
+ "space": {
422
+ "sys": {
423
+ "type": "Link",
424
+ "linkType": "Space",
425
+ "id": "n6spjc167pc2"
426
+ }
427
+ },
428
+ "firstPublishedAt": "2014-07-22T07:48:02.222Z",
429
+ "publishedCounter": 1,
430
+ "publishedAt": "2014-07-22T07:48:02.222Z",
431
+ "publishedBy": {
432
+ "sys": {
433
+ "type": "Link",
434
+ "linkType": "User",
435
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
436
+ }
437
+ },
438
+ "publishedVersion": 38,
439
+ "version": 39,
440
+ "updatedAt": "2014-07-22T07:48:02.227Z",
441
+ "updatedBy": {
442
+ "sys": {
443
+ "type": "Link",
444
+ "linkType": "User",
445
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
446
+ }
447
+ }
448
+ },
449
+ "description": "ttesttestdesc",
450
+ "displayField": "tex"
451
+ },
452
+ {
453
+ "name": "TestingContentType",
454
+ "description": "someTests",
455
+ "fields": [
456
+ {
457
+ "name": "name",
458
+ "id": "name",
459
+ "uiid": "4dk8vydh05c",
460
+ "type": "Text",
461
+ "localized": true
462
+ },
463
+ {
464
+ "name": "number",
465
+ "id": "number",
466
+ "uiid": "3m7igqmwbgg",
467
+ "type": "Integer",
468
+ "localized": true
469
+ },
470
+ {
471
+ "name": "file",
472
+ "id": "file",
473
+ "uiid": "4gmlkz2dslc",
474
+ "type": "Link",
475
+ "linkType": "Asset",
476
+ "localized": true
477
+ },
478
+ {
479
+ "id": "my_array_field",
480
+ "name": "My Array Field",
481
+ "type": "Array",
482
+ "items": {
483
+ "type": "Link",
484
+ "linkType": "Entry"
485
+ },
486
+ "uiid": "2s0iacnggsg"
487
+ }
488
+ ],
489
+ "sys": {
490
+ "id": "LE3x1rgCgU6QO0guSEm64",
491
+ "type": "ContentType",
492
+ "createdAt": "2014-07-10T13:57:51.634Z",
493
+ "createdBy": {
494
+ "sys": {
495
+ "type": "Link",
496
+ "linkType": "User",
497
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
498
+ }
499
+ },
500
+ "space": {
501
+ "sys": {
502
+ "type": "Link",
503
+ "linkType": "Space",
504
+ "id": "n6spjc167pc2"
505
+ }
506
+ },
507
+ "firstPublishedAt": "2014-07-10T13:58:20.920Z",
508
+ "publishedCounter": 2,
509
+ "publishedAt": "2014-07-21T11:27:19.105Z",
510
+ "publishedBy": {
511
+ "sys": {
512
+ "type": "Link",
513
+ "linkType": "User",
514
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
515
+ }
516
+ },
517
+ "publishedVersion": 77,
518
+ "version": 80,
519
+ "updatedAt": "2014-07-22T09:14:59.694Z",
520
+ "updatedBy": {
521
+ "sys": {
522
+ "type": "Link",
523
+ "linkType": "User",
524
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
525
+ }
526
+ }
527
+ },
528
+ "displayField": "name"
529
+ },
530
+ {
531
+ "fields": [
532
+ {
533
+ "name": "name",
534
+ "id": "name",
535
+ "type": "Text",
536
+ "uiid": "2uzhsxi0r9c",
537
+ "localized": true
538
+ },
539
+ {
540
+ "name": "symbol",
541
+ "id": "symbol",
542
+ "type": "Symbol",
543
+ "uiid": "2xlhnoyrgu8"
544
+ },
545
+ {
546
+ "name": "number",
547
+ "id": "number",
548
+ "type": "Integer",
549
+ "uiid": "3uqp6c33xmo"
550
+ },
551
+ {
552
+ "name": "bool",
553
+ "id": "bool",
554
+ "type": "Boolean",
555
+ "uiid": "4vw89vv8jk0",
556
+ "localized": true
557
+ },
558
+ {
559
+ "name": "date",
560
+ "id": "date",
561
+ "type": "Date",
562
+ "uiid": "3cgmylszk00"
563
+ },
564
+ {
565
+ "name": "location",
566
+ "id": "location",
567
+ "type": "Location",
568
+ "uiid": "2x8qeasvrb4",
569
+ "localized": true
570
+ },
571
+ {
572
+ "name": "entrytest_multi",
573
+ "id": "entrytest",
574
+ "type": "Array",
575
+ "uiid": "3n9ykr5ds00",
576
+ "items": {
577
+ "type": "Link",
578
+ "linkType": "Entry"
579
+ },
580
+ "localized": true,
581
+ "disabled": false
582
+ },
583
+ {
584
+ "name": "entrytest_single",
585
+ "id": "entrytestSingle",
586
+ "type": "Link",
587
+ "uiid": "2xhpzp3negw",
588
+ "linkType": "Entry"
589
+ },
590
+ {
591
+ "name": "asset",
592
+ "id": "asset",
593
+ "type": "Link",
594
+ "uiid": "4p5gxtphr0g",
595
+ "linkType": "Asset",
596
+ "localized": true
597
+ },
598
+ {
599
+ "name": "assets",
600
+ "id": "assets",
601
+ "uiid": "4mm8rtna7ls",
602
+ "type": "Array",
603
+ "items": {
604
+ "type": "Link",
605
+ "linkType": "Asset"
606
+ }
607
+ },
608
+ {
609
+ "name": "symbols",
610
+ "id": "symbols",
611
+ "type": "Array",
612
+ "uiid": "2oimrhac4jk",
613
+ "items": {
614
+ "type": "Symbol"
615
+ }
616
+ }
617
+ ],
618
+ "name": "ContToEntries",
619
+ "sys": {
620
+ "id": "3cVKt1esC4a0WgQsMeOyMW",
621
+ "type": "ContentType",
622
+ "createdAt": "2014-07-22T14:26:22.821Z",
623
+ "createdBy": {
624
+ "sys": {
625
+ "type": "Link",
626
+ "linkType": "User",
627
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
628
+ }
629
+ },
630
+ "space": {
631
+ "sys": {
632
+ "type": "Link",
633
+ "linkType": "Space",
634
+ "id": "n6spjc167pc2"
635
+ }
636
+ },
637
+ "firstPublishedAt": "2014-07-22T14:28:35.999Z",
638
+ "publishedCounter": 9,
639
+ "publishedAt": "2014-07-24T13:44:40.047Z",
640
+ "publishedBy": {
641
+ "sys": {
642
+ "type": "Link",
643
+ "linkType": "User",
644
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
645
+ }
646
+ },
647
+ "publishedVersion": 216,
648
+ "version": 217,
649
+ "updatedAt": "2014-07-24T13:44:40.054Z",
650
+ "updatedBy": {
651
+ "sys": {
652
+ "type": "Link",
653
+ "linkType": "User",
654
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
655
+ }
656
+ }
657
+ },
658
+ "description": "Add new entries by API",
659
+ "displayField": "name"
660
+ },
661
+ {
662
+ "name": "Post",
663
+ "description": "",
664
+ "fields": [
665
+ {
666
+ "id": "post_title",
667
+ "name": "Post Title",
668
+ "type": "Text",
669
+ "required": false,
670
+ "localized": true,
671
+ "uiid": "2vg5he0xbeo"
672
+ },
673
+ {
674
+ "id": "post_author",
675
+ "name": "Post Author",
676
+ "type": "Text",
677
+ "required": false,
678
+ "localized": true,
679
+ "uiid": "4kft9qp9kao"
680
+ },
681
+ {
682
+ "id": "post_body",
683
+ "name": "Post Body",
684
+ "type": "Text",
685
+ "localized": true,
686
+ "uiid": "2zg6lzrdqtc"
687
+ }
688
+ ],
689
+ "sys": {
690
+ "id": "2z4MCokfNecisIIwKIWsOg",
691
+ "type": "ContentType",
692
+ "createdAt": "2014-07-29T14:15:41.420Z",
693
+ "createdBy": {
694
+ "sys": {
695
+ "type": "Link",
696
+ "linkType": "User",
697
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
698
+ }
699
+ },
700
+ "space": {
701
+ "sys": {
702
+ "type": "Link",
703
+ "linkType": "Space",
704
+ "id": "n6spjc167pc2"
705
+ }
706
+ },
707
+ "version": 5,
708
+ "updatedAt": "2014-07-29T14:16:10.571Z",
709
+ "updatedBy": {
710
+ "sys": {
711
+ "type": "Link",
712
+ "linkType": "User",
713
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
714
+ }
715
+ }
716
+ }
717
+ },
718
+ {
719
+ "name": "Category",
720
+ "description": "",
721
+ "fields": [
722
+ {
723
+ "id": "category_name",
724
+ "name": "Category Name",
725
+ "type": "Text",
726
+ "required": false,
727
+ "localized": true,
728
+ "uiid": "3vablh5gpvk"
729
+ },
730
+ {
731
+ "id": "category_description",
732
+ "name": "Category Description",
733
+ "type": "Text",
734
+ "localized": true,
735
+ "uiid": "4vdhf4axnnk"
736
+ }
737
+ ],
738
+ "sys": {
739
+ "id": "5N8oxLtaqQEWGO6IAagMwA",
740
+ "type": "ContentType",
741
+ "createdAt": "2014-07-29T14:14:36.058Z",
742
+ "createdBy": {
743
+ "sys": {
744
+ "type": "Link",
745
+ "linkType": "User",
746
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
747
+ }
748
+ },
749
+ "space": {
750
+ "sys": {
751
+ "type": "Link",
752
+ "linkType": "Space",
753
+ "id": "n6spjc167pc2"
754
+ }
755
+ },
756
+ "version": 4,
757
+ "updatedAt": "2014-07-29T14:15:00.135Z",
758
+ "updatedBy": {
759
+ "sys": {
760
+ "type": "Link",
761
+ "linkType": "User",
762
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
763
+ }
764
+ }
765
+ }
766
+ },
767
+ {
768
+ "name": "TestingContentType",
769
+ "description": null,
770
+ "fields": [],
771
+ "sys": {
772
+ "id": "1DvqU3pwFieqc88qEYugg",
773
+ "type": "ContentType",
774
+ "createdAt": "2014-07-31T06:42:31.222Z",
775
+ "createdBy": {
776
+ "sys": {
777
+ "type": "Link",
778
+ "linkType": "User",
779
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
780
+ }
781
+ },
782
+ "space": {
783
+ "sys": {
784
+ "type": "Link",
785
+ "linkType": "Space",
786
+ "id": "n6spjc167pc2"
787
+ }
788
+ },
789
+ "version": 1,
790
+ "updatedAt": "2014-07-31T06:42:31.226Z",
791
+ "updatedBy": {
792
+ "sys": {
793
+ "type": "Link",
794
+ "linkType": "User",
795
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
796
+ }
797
+ }
798
+ }
799
+ }
800
+ ]
801
+ }
802
+ http_version:
803
+ recorded_at: Fri, 01 Aug 2014 13:57:46 GMT
804
+ - request:
805
+ method: get
806
+ uri: https://api.contentful.com/spaces/yr5m0jky5hsh/content_types
807
+ body:
808
+ encoding: US-ASCII
809
+ string: ''
810
+ headers:
811
+ User-Agent:
812
+ - RubyContenfulManagementGem/0.0.1
813
+ Authorization:
814
+ - Bearer <ACCESS_TOKEN>
815
+ Content-Type:
816
+ - application/vnd.contentful.management.v1+json
817
+ Content-Length:
818
+ - '0'
819
+ Host:
820
+ - api.contentful.com
821
+ response:
822
+ status:
823
+ code: 200
824
+ message: OK
825
+ headers:
826
+ Server:
827
+ - nginx
828
+ Date:
829
+ - Fri, 01 Aug 2014 13:57:46 GMT
830
+ Content-Type:
831
+ - application/vnd.contentful.management.v1+json
832
+ Content-Length:
833
+ - '8630'
834
+ Connection:
835
+ - keep-alive
836
+ X-Powered-By:
837
+ - Express
838
+ Cf-Space-Id:
839
+ - yr5m0jky5hsh
840
+ Etag:
841
+ - '"7a4f5c97b83b62117203abbd5b67796e"'
842
+ Access-Control-Allow-Origin:
843
+ - "*"
844
+ Access-Control-Allow-Headers:
845
+ - 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
846
+ Access-Control-Allow-Methods:
847
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
848
+ "^access-Control-Expose-Headers":
849
+ - Etag
850
+ Access-Control-Max-Age:
851
+ - '1728000'
852
+ body:
853
+ encoding: UTF-8
854
+ string: |
855
+ {
856
+ "sys": {
857
+ "type": "Array"
858
+ },
859
+ "total": 4,
860
+ "skip": 0,
861
+ "limit": 100,
862
+ "items": [
863
+ {
864
+ "name": "Author",
865
+ "description": "Author content",
866
+ "fields": [
867
+ {
868
+ "id": "name",
869
+ "name": "name",
870
+ "type": "Text",
871
+ "localized": true,
872
+ "uiid": "3jp09h4ba4g"
873
+ },
874
+ {
875
+ "id": "age",
876
+ "name": "age",
877
+ "type": "Integer",
878
+ "localized": true,
879
+ "uiid": "43my1e8ybr4"
880
+ },
881
+ {
882
+ "id": "city",
883
+ "name": "city",
884
+ "type": "Location",
885
+ "uiid": "45uoowshekg"
886
+ },
887
+ {
888
+ "id": "assets",
889
+ "name": "assets",
890
+ "type": "Array",
891
+ "items": {
892
+ "type": "Link",
893
+ "linkType": "Asset"
894
+ },
895
+ "localized": true,
896
+ "uiid": "4p8d3di8b28"
897
+ },
898
+ {
899
+ "id": "entries",
900
+ "name": "entries",
901
+ "type": "Array",
902
+ "items": {
903
+ "type": "Link",
904
+ "linkType": "Entry"
905
+ },
906
+ "uiid": "4t2r2mpmwow"
907
+ },
908
+ {
909
+ "id": "entry",
910
+ "name": "entry",
911
+ "type": "Link",
912
+ "linkType": "Entry",
913
+ "uiid": "2u2x6csxtkw"
914
+ },
915
+ {
916
+ "id": "asset",
917
+ "name": "asset",
918
+ "type": "Link",
919
+ "linkType": "Asset",
920
+ "uiid": "3pktxccvjeo"
921
+ },
922
+ {
923
+ "id": "bool",
924
+ "name": "bool",
925
+ "type": "Boolean",
926
+ "localized": true,
927
+ "uiid": "4p882yc9728"
928
+ },
929
+ {
930
+ "id": "symbols",
931
+ "name": "symbols",
932
+ "type": "Array",
933
+ "items": {
934
+ "type": "Symbol"
935
+ },
936
+ "uiid": "2mcqj4tdczk"
937
+ },
938
+ {
939
+ "id": "birthday",
940
+ "name": "birthday",
941
+ "type": "Date",
942
+ "uiid": "3h1dkdm8we8"
943
+ },
944
+ {
945
+ "id": "symbol",
946
+ "name": "Symbol",
947
+ "type": "Symbol",
948
+ "required": true,
949
+ "localized": true,
950
+ "uiid": "30rwyn42a68"
951
+ },
952
+ {
953
+ "id": "eye_color",
954
+ "name": "Eyes color",
955
+ "type": "Text",
956
+ "uiid": "46h9q3btwcg"
957
+ }
958
+ ],
959
+ "sys": {
960
+ "id": "5DSpuKrl04eMAGQoQckeIq",
961
+ "type": "ContentType",
962
+ "createdAt": "2014-07-30T12:35:01.110Z",
963
+ "createdBy": {
964
+ "sys": {
965
+ "type": "Link",
966
+ "linkType": "User",
967
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
968
+ }
969
+ },
970
+ "space": {
971
+ "sys": {
972
+ "type": "Link",
973
+ "linkType": "Space",
974
+ "id": "yr5m0jky5hsh"
975
+ }
976
+ },
977
+ "firstPublishedAt": "2014-07-30T12:37:42.035Z",
978
+ "publishedCounter": 9,
979
+ "publishedAt": "2014-07-31T10:21:36.870Z",
980
+ "publishedBy": {
981
+ "sys": {
982
+ "type": "Link",
983
+ "linkType": "User",
984
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
985
+ }
986
+ },
987
+ "publishedVersion": 206,
988
+ "version": 213,
989
+ "updatedAt": "2014-07-31T13:23:46.624Z",
990
+ "updatedBy": {
991
+ "sys": {
992
+ "type": "Link",
993
+ "linkType": "User",
994
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
995
+ }
996
+ }
997
+ }
998
+ },
999
+ {
1000
+ "fields": [
1001
+ {
1002
+ "name": "post_title",
1003
+ "id": "post_title",
1004
+ "type": "Text",
1005
+ "uiid": "3y811ua4gsg",
1006
+ "localized": true
1007
+ },
1008
+ {
1009
+ "name": "post_body",
1010
+ "id": "post_body",
1011
+ "type": "Text",
1012
+ "uiid": "2wcy8gvpn28",
1013
+ "localized": true
1014
+ },
1015
+ {
1016
+ "name": "post_code",
1017
+ "id": "post_code",
1018
+ "type": "Symbol",
1019
+ "uiid": "42ip6svqlts",
1020
+ "localized": true
1021
+ },
1022
+ {
1023
+ "name": "post_created",
1024
+ "id": "post_created",
1025
+ "type": "Date",
1026
+ "uiid": "3qb1v37yebk"
1027
+ }
1028
+ ],
1029
+ "name": "Post",
1030
+ "sys": {
1031
+ "id": "4EnwylPOikyMGUIy8uQgQY",
1032
+ "type": "ContentType",
1033
+ "createdAt": "2014-07-31T08:46:36.678Z",
1034
+ "createdBy": {
1035
+ "sys": {
1036
+ "type": "Link",
1037
+ "linkType": "User",
1038
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
1039
+ }
1040
+ },
1041
+ "space": {
1042
+ "sys": {
1043
+ "type": "Link",
1044
+ "linkType": "Space",
1045
+ "id": "yr5m0jky5hsh"
1046
+ }
1047
+ },
1048
+ "firstPublishedAt": "2014-07-31T08:51:14.655Z",
1049
+ "publishedCounter": 6,
1050
+ "publishedAt": "2014-08-01T09:23:05.507Z",
1051
+ "publishedBy": {
1052
+ "sys": {
1053
+ "type": "Link",
1054
+ "linkType": "User",
1055
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
1056
+ }
1057
+ },
1058
+ "publishedVersion": 214,
1059
+ "version": 215,
1060
+ "updatedAt": "2014-08-01T09:23:05.513Z",
1061
+ "updatedBy": {
1062
+ "sys": {
1063
+ "type": "Link",
1064
+ "linkType": "User",
1065
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
1066
+ }
1067
+ }
1068
+ },
1069
+ "description": "Content with Post fields",
1070
+ "displayField": "postTitl"
1071
+ },
1072
+ {
1073
+ "name": "Blog",
1074
+ "description": "Blog's content type",
1075
+ "fields": [
1076
+ {
1077
+ "id": "blog_name",
1078
+ "name": "blog_name",
1079
+ "type": "Text",
1080
+ "uiid": "4j6nspw3bb4"
1081
+ },
1082
+ {
1083
+ "id": "blog_entries",
1084
+ "name": "Entries",
1085
+ "type": "Array",
1086
+ "items": {
1087
+ "type": "Link",
1088
+ "linkType": "Entry"
1089
+ },
1090
+ "localized": true,
1091
+ "uiid": "4fb61794mio"
1092
+ }
1093
+ ],
1094
+ "sys": {
1095
+ "id": "6xzrdCr33OMAeIYUgs6UKi",
1096
+ "type": "ContentType",
1097
+ "createdAt": "2014-07-31T10:33:50.934Z",
1098
+ "createdBy": {
1099
+ "sys": {
1100
+ "type": "Link",
1101
+ "linkType": "User",
1102
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
1103
+ }
1104
+ },
1105
+ "space": {
1106
+ "sys": {
1107
+ "type": "Link",
1108
+ "linkType": "Space",
1109
+ "id": "yr5m0jky5hsh"
1110
+ }
1111
+ },
1112
+ "firstPublishedAt": "2014-07-31T10:34:14.463Z",
1113
+ "publishedCounter": 3,
1114
+ "publishedAt": "2014-08-01T09:23:53.039Z",
1115
+ "publishedBy": {
1116
+ "sys": {
1117
+ "type": "Link",
1118
+ "linkType": "User",
1119
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
1120
+ }
1121
+ },
1122
+ "publishedVersion": 50,
1123
+ "version": 51,
1124
+ "updatedAt": "2014-08-01T09:23:53.043Z",
1125
+ "updatedBy": {
1126
+ "sys": {
1127
+ "type": "Link",
1128
+ "linkType": "User",
1129
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
1130
+ }
1131
+ }
1132
+ }
1133
+ },
1134
+ {
1135
+ "fields": [
1136
+ {
1137
+ "name": "car_mark",
1138
+ "id": "carMark",
1139
+ "type": "Text",
1140
+ "uiid": "2tak96o94ow",
1141
+ "localized": true
1142
+ },
1143
+ {
1144
+ "name": "car_city_plate",
1145
+ "id": "carCityPlate",
1146
+ "type": "Symbol",
1147
+ "uiid": "4gqwj4k6k8w",
1148
+ "localized": true
1149
+ },
1150
+ {
1151
+ "name": "car_capacity",
1152
+ "id": "carCapacity",
1153
+ "type": "Number",
1154
+ "uiid": "2ms8n1w14ao",
1155
+ "localized": true
1156
+ },
1157
+ {
1158
+ "name": "car_photo",
1159
+ "id": "carPhoto",
1160
+ "type": "Link",
1161
+ "uiid": "33wtzyo9e68",
1162
+ "linkType": "Asset",
1163
+ "localized": true
1164
+ }
1165
+ ],
1166
+ "name": "Car",
1167
+ "sys": {
1168
+ "id": "4esHTHIVgc0uWkiwGwOsa6",
1169
+ "type": "ContentType",
1170
+ "createdAt": "2014-08-01T10:30:19.224Z",
1171
+ "createdBy": {
1172
+ "sys": {
1173
+ "type": "Link",
1174
+ "linkType": "User",
1175
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
1176
+ }
1177
+ },
1178
+ "space": {
1179
+ "sys": {
1180
+ "type": "Link",
1181
+ "linkType": "Space",
1182
+ "id": "yr5m0jky5hsh"
1183
+ }
1184
+ },
1185
+ "firstPublishedAt": "2014-08-01T10:32:26.083Z",
1186
+ "publishedCounter": 2,
1187
+ "publishedAt": "2014-08-01T11:14:19.463Z",
1188
+ "publishedBy": {
1189
+ "sys": {
1190
+ "type": "Link",
1191
+ "linkType": "User",
1192
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
1193
+ }
1194
+ },
1195
+ "publishedVersion": 85,
1196
+ "version": 86,
1197
+ "updatedAt": "2014-08-01T11:14:19.470Z",
1198
+ "updatedBy": {
1199
+ "sys": {
1200
+ "type": "Link",
1201
+ "linkType": "User",
1202
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
1203
+ }
1204
+ }
1205
+ },
1206
+ "description": "Car content type",
1207
+ "displayField": "carMark"
1208
+ }
1209
+ ]
1210
+ }
1211
+ http_version:
1212
+ recorded_at: Fri, 01 Aug 2014 13:57:47 GMT
1213
+ - request:
1214
+ method: get
1215
+ uri: https://api.contentful.com/spaces/1db9wmjkhf78/content_types
1216
+ body:
1217
+ encoding: US-ASCII
1218
+ string: ''
1219
+ headers:
1220
+ User-Agent:
1221
+ - RubyContenfulManagementGem/0.0.1
1222
+ Authorization:
1223
+ - Bearer <ACCESS_TOKEN>
1224
+ Content-Type:
1225
+ - application/vnd.contentful.management.v1+json
1226
+ Content-Length:
1227
+ - '0'
1228
+ Host:
1229
+ - api.contentful.com
1230
+ response:
1231
+ status:
1232
+ code: 200
1233
+ message: OK
1234
+ headers:
1235
+ Server:
1236
+ - nginx
1237
+ Date:
1238
+ - Fri, 01 Aug 2014 13:57:47 GMT
1239
+ Content-Type:
1240
+ - application/vnd.contentful.management.v1+json
1241
+ Content-Length:
1242
+ - '97'
1243
+ Connection:
1244
+ - keep-alive
1245
+ X-Powered-By:
1246
+ - Express
1247
+ Cf-Space-Id:
1248
+ - 1db9wmjkhf78
1249
+ Etag:
1250
+ - '"29f2c21be26360c424f617d8592cf6f9"'
1251
+ Access-Control-Allow-Origin:
1252
+ - "*"
1253
+ Access-Control-Allow-Headers:
1254
+ - 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
1255
+ Access-Control-Allow-Methods:
1256
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
1257
+ "^access-Control-Expose-Headers":
1258
+ - Etag
1259
+ Access-Control-Max-Age:
1260
+ - '1728000'
1261
+ body:
1262
+ encoding: UTF-8
1263
+ string: |
1264
+ {
1265
+ "sys": {
1266
+ "type": "Array"
1267
+ },
1268
+ "total": 0,
1269
+ "skip": 0,
1270
+ "limit": 100,
1271
+ "items": []
1272
+ }
1273
+ http_version:
1274
+ recorded_at: Fri, 01 Aug 2014 13:57:47 GMT
1275
+ - request:
1276
+ method: get
1277
+ uri: https://api.contentful.com/spaces/cbvgg8sz6wyh/content_types
1278
+ body:
1279
+ encoding: US-ASCII
1280
+ string: ''
1281
+ headers:
1282
+ User-Agent:
1283
+ - RubyContenfulManagementGem/0.0.1
1284
+ Authorization:
1285
+ - Bearer <ACCESS_TOKEN>
1286
+ Content-Type:
1287
+ - application/vnd.contentful.management.v1+json
1288
+ Content-Length:
1289
+ - '0'
1290
+ Host:
1291
+ - api.contentful.com
1292
+ response:
1293
+ status:
1294
+ code: 200
1295
+ message: OK
1296
+ headers:
1297
+ Server:
1298
+ - nginx
1299
+ Date:
1300
+ - Fri, 01 Aug 2014 13:57:48 GMT
1301
+ Content-Type:
1302
+ - application/vnd.contentful.management.v1+json
1303
+ Content-Length:
1304
+ - '97'
1305
+ Connection:
1306
+ - keep-alive
1307
+ X-Powered-By:
1308
+ - Express
1309
+ Cf-Space-Id:
1310
+ - cbvgg8sz6wyh
1311
+ Etag:
1312
+ - '"29f2c21be26360c424f617d8592cf6f9"'
1313
+ Access-Control-Allow-Origin:
1314
+ - "*"
1315
+ Access-Control-Allow-Headers:
1316
+ - 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
1317
+ Access-Control-Allow-Methods:
1318
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
1319
+ "^access-Control-Expose-Headers":
1320
+ - Etag
1321
+ Access-Control-Max-Age:
1322
+ - '1728000'
1323
+ body:
1324
+ encoding: UTF-8
1325
+ string: |
1326
+ {
1327
+ "sys": {
1328
+ "type": "Array"
1329
+ },
1330
+ "total": 0,
1331
+ "skip": 0,
1332
+ "limit": 100,
1333
+ "items": []
1334
+ }
1335
+ http_version:
1336
+ recorded_at: Fri, 01 Aug 2014 13:57:48 GMT
1337
+ recorded_with: VCR 2.9.2