contentful-management 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +11 -6
- data/RELEASE.md +8 -0
- data/examples/blog.rb +2 -2
- data/examples/content_types.rb +2 -2
- data/examples/create_space.rb +0 -1
- data/lib/contentful/management/asset.rb +7 -8
- data/lib/contentful/management/client.rb +7 -7
- data/lib/contentful/management/content_type.rb +13 -13
- data/lib/contentful/management/content_type_entry_methods_factory.rb +1 -3
- data/lib/contentful/management/dynamic_entry.rb +8 -8
- data/lib/contentful/management/entry.rb +15 -29
- data/lib/contentful/management/field.rb +1 -1
- data/lib/contentful/management/locale.rb +2 -2
- data/lib/contentful/management/request.rb +3 -3
- data/lib/contentful/management/resource.rb +5 -5
- data/lib/contentful/management/resource/array_like.rb +2 -2
- data/lib/contentful/management/resource/asset_fields.rb +3 -3
- data/lib/contentful/management/resource/fields.rb +0 -1
- data/lib/contentful/management/resource/system_properties.rb +9 -9
- data/lib/contentful/management/resource_builder.rb +8 -8
- data/lib/contentful/management/response.rb +1 -1
- data/lib/contentful/management/space_asset_methods_factory.rb +1 -3
- data/lib/contentful/management/space_association_methods_factory.rb +2 -4
- data/lib/contentful/management/space_content_type_methods_factory.rb +1 -3
- data/lib/contentful/management/space_entry_methods_factory.rb +2 -4
- data/lib/contentful/management/space_locale_methods_factory.rb +1 -3
- data/lib/contentful/management/space_webhook_methods_factory.rb +2 -4
- data/lib/contentful/management/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/entry/create.yml +412 -85
- data/spec/fixtures/vcr_cassettes/entry/create_with_symbols.yml +2 -3
- data/spec/lib/contentful/management/content_type_spec.rb +2 -2
- data/spec/lib/contentful/management/entry_spec.rb +94 -6
- metadata +5 -6
- data/spec/fixtures/vcr_cassettes/entry/create_test.yml +0 -150
@@ -5,15 +5,15 @@ module Contentful
|
|
5
5
|
# Adds the feature to have system properties to a Resource.
|
6
6
|
module SystemProperties
|
7
7
|
SYS_COERCIONS = {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
8
|
+
type: :string,
|
9
|
+
id: :string,
|
10
|
+
space: nil,
|
11
|
+
contentType: nil,
|
12
|
+
linkType: :string,
|
13
|
+
revision: :integer,
|
14
|
+
createdAt: :date,
|
15
|
+
updatedAt: :date,
|
16
|
+
locale: :string
|
17
17
|
}
|
18
18
|
attr_reader :sys
|
19
19
|
|
@@ -16,13 +16,13 @@ module Contentful
|
|
16
16
|
# See example/resource_mapping.rb for avanced usage
|
17
17
|
class ResourceBuilder
|
18
18
|
DEFAULT_RESOURCE_MAPPING = {
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
'Space' => Contentful::Management::Space,
|
20
|
+
'ContentType' => Contentful::Management::ContentType,
|
21
|
+
'Entry' => :find_entry_class,
|
22
|
+
'Asset' => Contentful::Management::Asset,
|
23
|
+
'Array' => :array_or_sync_page,
|
24
|
+
'Link' => Contentful::Management::Link,
|
25
|
+
'WebhookDefinition' => Contentful::Management::Webhook
|
26
26
|
}
|
27
27
|
DEFAULT_ENTRY_MAPPING = {}
|
28
28
|
|
@@ -139,7 +139,7 @@ module Contentful
|
|
139
139
|
when Proc
|
140
140
|
res_class[object]
|
141
141
|
when nil
|
142
|
-
|
142
|
+
fail UnparsableResource.new(response)
|
143
143
|
else
|
144
144
|
res_class
|
145
145
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module Contentful
|
2
2
|
module Management
|
3
3
|
module SpaceAssociationMethodsFactory
|
4
|
-
|
5
4
|
attr_reader :space
|
6
5
|
|
7
6
|
def initialize(space)
|
@@ -28,11 +27,10 @@ module Contentful
|
|
28
27
|
|
29
28
|
def associated_class
|
30
29
|
class_name = /\A(.+)Space(.+)MethodsFactory\z/.match(self.class.name).captures.join
|
31
|
-
class_name.split('::').
|
30
|
+
class_name.split('::').reduce(Object) do |mod, class_name|
|
32
31
|
mod.const_get(class_name)
|
33
32
|
end
|
34
33
|
end
|
35
|
-
|
36
34
|
end
|
37
35
|
end
|
38
|
-
end
|
36
|
+
end
|
@@ -3,17 +3,15 @@ require_relative 'space_association_methods_factory'
|
|
3
3
|
module Contentful
|
4
4
|
module Management
|
5
5
|
class SpaceEntryMethodsFactory
|
6
|
-
|
7
6
|
include Contentful::Management::SpaceAssociationMethodsFactory
|
8
7
|
|
9
|
-
def create(
|
8
|
+
def create(_attributes)
|
10
9
|
fail 'Not supported'
|
11
10
|
end
|
12
11
|
|
13
12
|
def new
|
14
13
|
fail 'Not supported'
|
15
14
|
end
|
16
|
-
|
17
15
|
end
|
18
16
|
end
|
19
|
-
end
|
17
|
+
end
|
@@ -3,13 +3,11 @@ require_relative 'space_association_methods_factory'
|
|
3
3
|
module Contentful
|
4
4
|
module Management
|
5
5
|
class SpaceLocaleMethodsFactory
|
6
|
-
|
7
6
|
include Contentful::Management::SpaceAssociationMethodsFactory
|
8
7
|
|
9
8
|
def new
|
10
9
|
fail 'Not supported'
|
11
10
|
end
|
12
|
-
|
13
11
|
end
|
14
12
|
end
|
15
|
-
end
|
13
|
+
end
|
@@ -3,17 +3,15 @@ require_relative 'space_association_methods_factory'
|
|
3
3
|
module Contentful
|
4
4
|
module Management
|
5
5
|
class SpaceWebhookMethodsFactory
|
6
|
-
|
7
6
|
include Contentful::Management::SpaceAssociationMethodsFactory
|
8
7
|
|
9
|
-
def create(
|
8
|
+
def create(_attributes)
|
10
9
|
fail 'Not supported'
|
11
10
|
end
|
12
11
|
|
13
12
|
def new
|
14
13
|
fail 'Not supported'
|
15
14
|
end
|
16
|
-
|
17
15
|
end
|
18
16
|
end
|
19
|
-
end
|
17
|
+
end
|
@@ -2,13 +2,13 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.contentful.com/spaces/
|
5
|
+
uri: https://api.contentful.com/spaces/ene4qtp2sh7u/content_types/5BHZB1vi4ooq4wKcmA8e2c
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
|
-
- RubyContenfulManagementGem/0.0
|
11
|
+
- RubyContenfulManagementGem/0.2.0
|
12
12
|
Authorization:
|
13
13
|
- Bearer <ACCESS_TOKEN>
|
14
14
|
Content-Type:
|
@@ -22,82 +22,132 @@ http_interactions:
|
|
22
22
|
code: 200
|
23
23
|
message: OK
|
24
24
|
headers:
|
25
|
-
|
26
|
-
-
|
27
|
-
Date:
|
28
|
-
- Wed, 30 Jul 2014 13:07:09 GMT
|
29
|
-
Content-Type:
|
30
|
-
- application/vnd.contentful.management.v1+json
|
31
|
-
Content-Length:
|
32
|
-
- '1705'
|
33
|
-
Connection:
|
34
|
-
- keep-alive
|
35
|
-
X-Powered-By:
|
36
|
-
- Express
|
37
|
-
Cf-Space-Id:
|
38
|
-
- yr5m0jky5hsh
|
39
|
-
Etag:
|
40
|
-
- '"244c51677937f352a1bedf335709c6b7"'
|
41
|
-
Access-Control-Allow-Origin:
|
42
|
-
- "*"
|
25
|
+
"^access-Control-Expose-Headers":
|
26
|
+
- Etag
|
43
27
|
Access-Control-Allow-Headers:
|
44
28
|
- 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
29
|
Access-Control-Allow-Methods:
|
46
30
|
- DELETE,GET,HEAD,POST,PUT,OPTIONS
|
47
|
-
|
48
|
-
-
|
31
|
+
Access-Control-Allow-Origin:
|
32
|
+
- "*"
|
49
33
|
Access-Control-Max-Age:
|
50
34
|
- '1728000'
|
35
|
+
Cf-Space-Id:
|
36
|
+
- ene4qtp2sh7u
|
37
|
+
Content-Type:
|
38
|
+
- application/vnd.contentful.management.v1+json
|
39
|
+
Date:
|
40
|
+
- Mon, 15 Sep 2014 09:09:54 GMT
|
41
|
+
Etag:
|
42
|
+
- '"d49e8af3ced51676c046790da0fe89fb"'
|
43
|
+
Server:
|
44
|
+
- nginx
|
45
|
+
X-Powered-By:
|
46
|
+
- Express
|
47
|
+
Content-Length:
|
48
|
+
- '2595'
|
49
|
+
Connection:
|
50
|
+
- keep-alive
|
51
51
|
body:
|
52
52
|
encoding: UTF-8
|
53
53
|
string: |
|
54
54
|
{
|
55
|
+
"name": "Codequest",
|
56
|
+
"description": "Testing",
|
55
57
|
"fields": [
|
56
58
|
{
|
57
|
-
"name": "name",
|
58
59
|
"id": "name",
|
60
|
+
"name": "Name",
|
59
61
|
"type": "Text",
|
60
|
-
"uiid": "
|
61
|
-
|
62
|
+
"uiid": "452r72wvh1c"
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"id": "number",
|
66
|
+
"name": "Number",
|
67
|
+
"type": "Integer",
|
68
|
+
"uiid": "2zf2xnbcc8w"
|
69
|
+
},
|
70
|
+
{
|
71
|
+
"id": "float1",
|
72
|
+
"name": "Float",
|
73
|
+
"type": "Number",
|
74
|
+
"uiid": "2qmb4i5zklc"
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"id": "boolean",
|
78
|
+
"name": "Boolean",
|
79
|
+
"type": "Boolean",
|
80
|
+
"uiid": "2mqwfhfkpa8"
|
62
81
|
},
|
63
82
|
{
|
64
|
-
"
|
65
|
-
"
|
66
|
-
"
|
67
|
-
"
|
83
|
+
"id": "date",
|
84
|
+
"name": "Date",
|
85
|
+
"type": "Date",
|
86
|
+
"uiid": "39kf6vtvzsw"
|
68
87
|
},
|
69
88
|
{
|
70
|
-
"
|
71
|
-
"
|
89
|
+
"id": "time",
|
90
|
+
"name": "Time",
|
91
|
+
"type": "Date",
|
92
|
+
"uiid": "4japfn2glq8"
|
93
|
+
},
|
94
|
+
{
|
95
|
+
"id": "location",
|
96
|
+
"name": "Location",
|
72
97
|
"type": "Location",
|
73
|
-
"uiid": "
|
98
|
+
"uiid": "4r1l3b0u800"
|
99
|
+
},
|
100
|
+
{
|
101
|
+
"id": "file",
|
102
|
+
"name": "File",
|
103
|
+
"type": "Link",
|
104
|
+
"linkType": "Asset",
|
105
|
+
"uiid": "3aqw57s3n5s"
|
74
106
|
},
|
75
107
|
{
|
76
|
-
"
|
77
|
-
"
|
78
|
-
"
|
108
|
+
"id": "image",
|
109
|
+
"name": "Image",
|
110
|
+
"type": "Link",
|
111
|
+
"linkType": "Asset",
|
112
|
+
"uiid": "2zsuo6p3f28"
|
113
|
+
},
|
114
|
+
{
|
115
|
+
"id": "array",
|
116
|
+
"name": "Array",
|
79
117
|
"type": "Array",
|
80
118
|
"items": {
|
81
|
-
"type": "
|
82
|
-
|
83
|
-
|
119
|
+
"type": "Symbol"
|
120
|
+
},
|
121
|
+
"uiid": "4qm6kx5mfb4"
|
122
|
+
},
|
123
|
+
{
|
124
|
+
"id": "entry",
|
125
|
+
"name": "Entry",
|
126
|
+
"type": "Link",
|
127
|
+
"linkType": "Entry",
|
128
|
+
"uiid": "2lnx99j0nwg"
|
84
129
|
},
|
85
130
|
{
|
86
|
-
"name": "entries",
|
87
131
|
"id": "entries",
|
132
|
+
"name": "Entries",
|
88
133
|
"type": "Array",
|
89
|
-
"uiid": "3xi486kbchs",
|
90
134
|
"items": {
|
91
135
|
"type": "Link",
|
92
136
|
"linkType": "Entry"
|
93
|
-
}
|
137
|
+
},
|
138
|
+
"uiid": "3oega21yd4w"
|
139
|
+
},
|
140
|
+
{
|
141
|
+
"id": "object_json",
|
142
|
+
"name": "Object",
|
143
|
+
"type": "Object",
|
144
|
+
"uiid": "37qbc8lcvls"
|
94
145
|
}
|
95
146
|
],
|
96
|
-
"name": "Author",
|
97
147
|
"sys": {
|
98
|
-
"id": "
|
148
|
+
"id": "5BHZB1vi4ooq4wKcmA8e2c",
|
99
149
|
"type": "ContentType",
|
100
|
-
"createdAt": "2014-
|
150
|
+
"createdAt": "2014-09-15T08:29:27.844Z",
|
101
151
|
"createdBy": {
|
102
152
|
"sys": {
|
103
153
|
"type": "Link",
|
@@ -109,12 +159,12 @@ http_interactions:
|
|
109
159
|
"sys": {
|
110
160
|
"type": "Link",
|
111
161
|
"linkType": "Space",
|
112
|
-
"id": "
|
162
|
+
"id": "ene4qtp2sh7u"
|
113
163
|
}
|
114
164
|
},
|
115
|
-
"firstPublishedAt": "2014-
|
165
|
+
"firstPublishedAt": "2014-09-15T08:29:38.623Z",
|
116
166
|
"publishedCounter": 1,
|
117
|
-
"publishedAt": "2014-
|
167
|
+
"publishedAt": "2014-09-15T08:29:38.623Z",
|
118
168
|
"publishedBy": {
|
119
169
|
"sys": {
|
120
170
|
"type": "Link",
|
@@ -122,9 +172,9 @@ http_interactions:
|
|
122
172
|
"id": "1E7acJL8I5XUXAMHQt9Grs"
|
123
173
|
}
|
124
174
|
},
|
125
|
-
"publishedVersion":
|
126
|
-
"version":
|
127
|
-
"updatedAt": "2014-
|
175
|
+
"publishedVersion": 14,
|
176
|
+
"version": 16,
|
177
|
+
"updatedAt": "2014-09-15T08:29:45.241Z",
|
128
178
|
"updatedBy": {
|
129
179
|
"sys": {
|
130
180
|
"type": "Link",
|
@@ -132,83 +182,360 @@ http_interactions:
|
|
132
182
|
"id": "1E7acJL8I5XUXAMHQt9Grs"
|
133
183
|
}
|
134
184
|
}
|
135
|
-
}
|
136
|
-
"description": null,
|
137
|
-
"displayField": "name"
|
185
|
+
}
|
138
186
|
}
|
139
187
|
http_version:
|
140
|
-
recorded_at:
|
188
|
+
recorded_at: Mon, 15 Sep 2014 09:10:54 GMT
|
141
189
|
- request:
|
142
|
-
method:
|
143
|
-
uri: https://api.contentful.com/spaces/
|
190
|
+
method: get
|
191
|
+
uri: https://api.contentful.com/spaces/ene4qtp2sh7u/assets/2oNoT3vSAs82SOIQmKe0KG
|
144
192
|
body:
|
145
|
-
encoding:
|
146
|
-
string: '
|
193
|
+
encoding: US-ASCII
|
194
|
+
string: ''
|
147
195
|
headers:
|
148
196
|
User-Agent:
|
149
|
-
- RubyContenfulManagementGem/0.0
|
197
|
+
- RubyContenfulManagementGem/0.2.0
|
150
198
|
Authorization:
|
151
199
|
- Bearer <ACCESS_TOKEN>
|
152
200
|
Content-Type:
|
153
201
|
- application/vnd.contentful.management.v1+json
|
154
|
-
|
155
|
-
-
|
202
|
+
Content-Length:
|
203
|
+
- '0'
|
156
204
|
Host:
|
157
205
|
- api.contentful.com
|
158
206
|
response:
|
159
207
|
status:
|
160
|
-
code:
|
161
|
-
message:
|
208
|
+
code: 200
|
209
|
+
message: OK
|
162
210
|
headers:
|
163
|
-
|
164
|
-
-
|
165
|
-
|
166
|
-
-
|
211
|
+
"^access-Control-Expose-Headers":
|
212
|
+
- Etag
|
213
|
+
Access-Control-Allow-Headers:
|
214
|
+
- 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
|
215
|
+
Access-Control-Allow-Methods:
|
216
|
+
- DELETE,GET,HEAD,POST,PUT,OPTIONS
|
217
|
+
Access-Control-Allow-Origin:
|
218
|
+
- "*"
|
219
|
+
Access-Control-Max-Age:
|
220
|
+
- '1728000'
|
221
|
+
Cf-Space-Id:
|
222
|
+
- ene4qtp2sh7u
|
167
223
|
Content-Type:
|
168
224
|
- application/vnd.contentful.management.v1+json
|
225
|
+
Date:
|
226
|
+
- Mon, 15 Sep 2014 09:09:54 GMT
|
227
|
+
Etag:
|
228
|
+
- '"641fb0041c06d601389ca6f169ed0d9b"'
|
229
|
+
Server:
|
230
|
+
- nginx
|
231
|
+
X-Powered-By:
|
232
|
+
- Express
|
169
233
|
Content-Length:
|
170
|
-
- '
|
234
|
+
- '1038'
|
171
235
|
Connection:
|
172
236
|
- keep-alive
|
173
|
-
|
174
|
-
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
237
|
+
body:
|
238
|
+
encoding: UTF-8
|
239
|
+
string: |
|
240
|
+
{
|
241
|
+
"fields": {
|
242
|
+
"title": {
|
243
|
+
"en-US": "Testowy Asset"
|
244
|
+
},
|
245
|
+
"file": {
|
246
|
+
"en-US": {
|
247
|
+
"fileName": "the-",
|
248
|
+
"contentType": "image/jpeg",
|
249
|
+
"details": {
|
250
|
+
"image": {
|
251
|
+
"width": 400,
|
252
|
+
"height": 215
|
253
|
+
},
|
254
|
+
"size": 18395
|
255
|
+
},
|
256
|
+
"url": "//images.contentful.com/ene4qtp2sh7u/2oNoT3vSAs82SOIQmKe0KG/629ab35b8dcd905017d05215b86d81d3/universe.jpg"
|
257
|
+
}
|
258
|
+
}
|
259
|
+
},
|
260
|
+
"sys": {
|
261
|
+
"id": "2oNoT3vSAs82SOIQmKe0KG",
|
262
|
+
"type": "Asset",
|
263
|
+
"createdAt": "2014-09-15T08:42:27.406Z",
|
264
|
+
"createdBy": {
|
265
|
+
"sys": {
|
266
|
+
"type": "Link",
|
267
|
+
"linkType": "User",
|
268
|
+
"id": "1E7acJL8I5XUXAMHQt9Grs"
|
269
|
+
}
|
270
|
+
},
|
271
|
+
"space": {
|
272
|
+
"sys": {
|
273
|
+
"type": "Link",
|
274
|
+
"linkType": "Space",
|
275
|
+
"id": "ene4qtp2sh7u"
|
276
|
+
}
|
277
|
+
},
|
278
|
+
"version": 13,
|
279
|
+
"updatedAt": "2014-09-15T08:43:05.677Z",
|
280
|
+
"updatedBy": {
|
281
|
+
"sys": {
|
282
|
+
"type": "Link",
|
283
|
+
"linkType": "User",
|
284
|
+
"id": "1E7acJL8I5XUXAMHQt9Grs"
|
285
|
+
}
|
286
|
+
}
|
287
|
+
}
|
288
|
+
}
|
289
|
+
http_version:
|
290
|
+
recorded_at: Mon, 15 Sep 2014 09:10:54 GMT
|
291
|
+
- request:
|
292
|
+
method: get
|
293
|
+
uri: https://api.contentful.com/spaces/ene4qtp2sh7u/entries/60zYC7nY9GcKGiCYwAs4wm
|
294
|
+
body:
|
295
|
+
encoding: US-ASCII
|
296
|
+
string: ''
|
297
|
+
headers:
|
298
|
+
User-Agent:
|
299
|
+
- RubyContenfulManagementGem/0.2.0
|
300
|
+
Authorization:
|
301
|
+
- Bearer <ACCESS_TOKEN>
|
302
|
+
Content-Type:
|
303
|
+
- application/vnd.contentful.management.v1+json
|
304
|
+
Content-Length:
|
305
|
+
- '0'
|
306
|
+
Host:
|
307
|
+
- api.contentful.com
|
308
|
+
response:
|
309
|
+
status:
|
310
|
+
code: 200
|
311
|
+
message: OK
|
312
|
+
headers:
|
313
|
+
"^access-Control-Expose-Headers":
|
314
|
+
- Etag
|
181
315
|
Access-Control-Allow-Headers:
|
182
316
|
- 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
|
183
317
|
Access-Control-Allow-Methods:
|
184
318
|
- DELETE,GET,HEAD,POST,PUT,OPTIONS
|
319
|
+
Access-Control-Allow-Origin:
|
320
|
+
- "*"
|
321
|
+
Access-Control-Max-Age:
|
322
|
+
- '1728000'
|
323
|
+
Cf-Space-Id:
|
324
|
+
- ene4qtp2sh7u
|
325
|
+
Content-Type:
|
326
|
+
- application/vnd.contentful.management.v1+json
|
327
|
+
Date:
|
328
|
+
- Mon, 15 Sep 2014 09:09:55 GMT
|
329
|
+
Etag:
|
330
|
+
- '"f1d844a20d795f30de097741cf5b6517"'
|
331
|
+
Server:
|
332
|
+
- nginx
|
333
|
+
X-Powered-By:
|
334
|
+
- Express
|
335
|
+
Content-Length:
|
336
|
+
- '1105'
|
337
|
+
Connection:
|
338
|
+
- keep-alive
|
339
|
+
body:
|
340
|
+
encoding: UTF-8
|
341
|
+
string: |
|
342
|
+
{
|
343
|
+
"sys": {
|
344
|
+
"id": "60zYC7nY9GcKGiCYwAs4wm",
|
345
|
+
"type": "Entry",
|
346
|
+
"createdAt": "2014-09-15T08:44:51.368Z",
|
347
|
+
"createdBy": {
|
348
|
+
"sys": {
|
349
|
+
"type": "Link",
|
350
|
+
"linkType": "User",
|
351
|
+
"id": "1E7acJL8I5XUXAMHQt9Grs"
|
352
|
+
}
|
353
|
+
},
|
354
|
+
"space": {
|
355
|
+
"sys": {
|
356
|
+
"type": "Link",
|
357
|
+
"linkType": "Space",
|
358
|
+
"id": "ene4qtp2sh7u"
|
359
|
+
}
|
360
|
+
},
|
361
|
+
"contentType": {
|
362
|
+
"sys": {
|
363
|
+
"type": "Link",
|
364
|
+
"linkType": "ContentType",
|
365
|
+
"id": "5BHZB1vi4ooq4wKcmA8e2c"
|
366
|
+
}
|
367
|
+
},
|
368
|
+
"firstPublishedAt": "2014-09-15T08:44:58.438Z",
|
369
|
+
"publishedCounter": 1,
|
370
|
+
"publishedAt": "2014-09-15T08:44:58.438Z",
|
371
|
+
"publishedBy": {
|
372
|
+
"sys": {
|
373
|
+
"type": "Link",
|
374
|
+
"linkType": "User",
|
375
|
+
"id": "1E7acJL8I5XUXAMHQt9Grs"
|
376
|
+
}
|
377
|
+
},
|
378
|
+
"publishedVersion": 9,
|
379
|
+
"version": 10,
|
380
|
+
"updatedAt": "2014-09-15T08:44:58.444Z",
|
381
|
+
"updatedBy": {
|
382
|
+
"sys": {
|
383
|
+
"type": "Link",
|
384
|
+
"linkType": "User",
|
385
|
+
"id": "1E7acJL8I5XUXAMHQt9Grs"
|
386
|
+
}
|
387
|
+
}
|
388
|
+
},
|
389
|
+
"fields": {
|
390
|
+
"name": {
|
391
|
+
"en-US": "testowy entry"
|
392
|
+
}
|
393
|
+
}
|
394
|
+
}
|
395
|
+
http_version:
|
396
|
+
recorded_at: Mon, 15 Sep 2014 09:10:55 GMT
|
397
|
+
- request:
|
398
|
+
method: post
|
399
|
+
uri: https://api.contentful.com/spaces/ene4qtp2sh7u/entries/
|
400
|
+
body:
|
401
|
+
encoding: UTF-8
|
402
|
+
string: '{"fields":{"name":{"en-US":"Test name"},"number":{"en-US":30},"float1":{"en-US":1.1},"boolean":{"en-US":true},"date":{"en-US":"2000-07-12T11:11:00+02:00"},"time":{"en-US":"2000-07-12T11:11:00+02:00"},"location":{"en-US":{"lat":22.44,"lon":33.33}},"file":{"en-US":{"sys":{"type":"Link","linkType":"Asset","id":"2oNoT3vSAs82SOIQmKe0KG"}}},"image":{"en-US":{"sys":{"type":"Link","linkType":"Asset","id":"2oNoT3vSAs82SOIQmKe0KG"}}},"array":{"en-US":["PL","USD","XX"]},"entry":{"en-US":{"sys":{"type":"Link","linkType":"Entry","id":"60zYC7nY9GcKGiCYwAs4wm"}}},"entries":{"en-US":[{"sys":{"type":"Link","linkType":"Entry","id":"60zYC7nY9GcKGiCYwAs4wm"}},{"sys":{"type":"Link","linkType":"Entry","id":"60zYC7nY9GcKGiCYwAs4wm"}}]},"object_json":{"en-US":{"test":{"@type":"Codequest"}}}}}'
|
403
|
+
headers:
|
404
|
+
User-Agent:
|
405
|
+
- RubyContenfulManagementGem/0.2.0
|
406
|
+
Authorization:
|
407
|
+
- Bearer <ACCESS_TOKEN>
|
408
|
+
Content-Type:
|
409
|
+
- application/vnd.contentful.management.v1+json
|
410
|
+
X-Contentful-Content-Type:
|
411
|
+
- 5BHZB1vi4ooq4wKcmA8e2c
|
412
|
+
Host:
|
413
|
+
- api.contentful.com
|
414
|
+
response:
|
415
|
+
status:
|
416
|
+
code: 201
|
417
|
+
message: Created
|
418
|
+
headers:
|
185
419
|
"^access-Control-Expose-Headers":
|
186
420
|
- Etag
|
421
|
+
Access-Control-Allow-Headers:
|
422
|
+
- 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
|
423
|
+
Access-Control-Allow-Methods:
|
424
|
+
- DELETE,GET,HEAD,POST,PUT,OPTIONS
|
425
|
+
Access-Control-Allow-Origin:
|
426
|
+
- "*"
|
187
427
|
Access-Control-Max-Age:
|
188
428
|
- '1728000'
|
429
|
+
Cf-Space-Id:
|
430
|
+
- ene4qtp2sh7u
|
431
|
+
Content-Type:
|
432
|
+
- application/vnd.contentful.management.v1+json
|
433
|
+
Date:
|
434
|
+
- Mon, 15 Sep 2014 09:09:56 GMT
|
435
|
+
Etag:
|
436
|
+
- '"4dc5970303659a6a3f2bdd7b731e7895"'
|
437
|
+
Server:
|
438
|
+
- nginx
|
439
|
+
X-Powered-By:
|
440
|
+
- Express
|
441
|
+
Content-Length:
|
442
|
+
- '2229'
|
443
|
+
Connection:
|
444
|
+
- keep-alive
|
189
445
|
body:
|
190
446
|
encoding: UTF-8
|
191
447
|
string: |
|
192
448
|
{
|
193
449
|
"fields": {
|
194
450
|
"name": {
|
195
|
-
"en-US": "
|
451
|
+
"en-US": "Test name"
|
196
452
|
},
|
197
|
-
"
|
453
|
+
"number": {
|
198
454
|
"en-US": 30
|
199
455
|
},
|
200
|
-
"
|
456
|
+
"float1": {
|
457
|
+
"en-US": 1.1
|
458
|
+
},
|
459
|
+
"boolean": {
|
460
|
+
"en-US": true
|
461
|
+
},
|
462
|
+
"date": {
|
463
|
+
"en-US": "2000-07-12T11:11:00+02:00"
|
464
|
+
},
|
465
|
+
"time": {
|
466
|
+
"en-US": "2000-07-12T11:11:00+02:00"
|
467
|
+
},
|
468
|
+
"location": {
|
201
469
|
"en-US": {
|
202
470
|
"lat": 22.44,
|
203
471
|
"lon": 33.33
|
204
472
|
}
|
473
|
+
},
|
474
|
+
"file": {
|
475
|
+
"en-US": {
|
476
|
+
"sys": {
|
477
|
+
"type": "Link",
|
478
|
+
"linkType": "Asset",
|
479
|
+
"id": "2oNoT3vSAs82SOIQmKe0KG"
|
480
|
+
}
|
481
|
+
}
|
482
|
+
},
|
483
|
+
"image": {
|
484
|
+
"en-US": {
|
485
|
+
"sys": {
|
486
|
+
"type": "Link",
|
487
|
+
"linkType": "Asset",
|
488
|
+
"id": "2oNoT3vSAs82SOIQmKe0KG"
|
489
|
+
}
|
490
|
+
}
|
491
|
+
},
|
492
|
+
"array": {
|
493
|
+
"en-US": [
|
494
|
+
"PL",
|
495
|
+
"USD",
|
496
|
+
"XX"
|
497
|
+
]
|
498
|
+
},
|
499
|
+
"entry": {
|
500
|
+
"en-US": {
|
501
|
+
"sys": {
|
502
|
+
"type": "Link",
|
503
|
+
"linkType": "Entry",
|
504
|
+
"id": "60zYC7nY9GcKGiCYwAs4wm"
|
505
|
+
}
|
506
|
+
}
|
507
|
+
},
|
508
|
+
"entries": {
|
509
|
+
"en-US": [
|
510
|
+
{
|
511
|
+
"sys": {
|
512
|
+
"type": "Link",
|
513
|
+
"linkType": "Entry",
|
514
|
+
"id": "60zYC7nY9GcKGiCYwAs4wm"
|
515
|
+
}
|
516
|
+
},
|
517
|
+
{
|
518
|
+
"sys": {
|
519
|
+
"type": "Link",
|
520
|
+
"linkType": "Entry",
|
521
|
+
"id": "60zYC7nY9GcKGiCYwAs4wm"
|
522
|
+
}
|
523
|
+
}
|
524
|
+
]
|
525
|
+
},
|
526
|
+
"object_json": {
|
527
|
+
"en-US": {
|
528
|
+
"test": {
|
529
|
+
"@type": "Codequest"
|
530
|
+
}
|
531
|
+
}
|
205
532
|
}
|
206
533
|
},
|
207
534
|
"sys": {
|
208
|
-
"id": "
|
535
|
+
"id": "1SQuy7QCoYGYC4KwY0Cekw",
|
209
536
|
"type": "Entry",
|
210
537
|
"version": 1,
|
211
|
-
"createdAt": "2014-
|
538
|
+
"createdAt": "2014-09-15T09:09:56.243Z",
|
212
539
|
"createdBy": {
|
213
540
|
"sys": {
|
214
541
|
"type": "Link",
|
@@ -220,17 +547,17 @@ http_interactions:
|
|
220
547
|
"sys": {
|
221
548
|
"type": "Link",
|
222
549
|
"linkType": "Space",
|
223
|
-
"id": "
|
550
|
+
"id": "ene4qtp2sh7u"
|
224
551
|
}
|
225
552
|
},
|
226
553
|
"contentType": {
|
227
554
|
"sys": {
|
228
555
|
"type": "Link",
|
229
556
|
"linkType": "ContentType",
|
230
|
-
"id": "
|
557
|
+
"id": "5BHZB1vi4ooq4wKcmA8e2c"
|
231
558
|
}
|
232
559
|
},
|
233
|
-
"updatedAt": "2014-
|
560
|
+
"updatedAt": "2014-09-15T09:09:56.243Z",
|
234
561
|
"updatedBy": {
|
235
562
|
"sys": {
|
236
563
|
"type": "Link",
|
@@ -241,5 +568,5 @@ http_interactions:
|
|
241
568
|
}
|
242
569
|
}
|
243
570
|
http_version:
|
244
|
-
recorded_at:
|
571
|
+
recorded_at: Mon, 15 Sep 2014 09:10:56 GMT
|
245
572
|
recorded_with: VCR 2.9.2
|