contentful-management 0.9.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +2 -2
- data/CHANGELOG.md +27 -3
- data/README.md +34 -7
- data/lib/contentful/management/api_key.rb +4 -43
- data/lib/contentful/management/array.rb +1 -2
- data/lib/contentful/management/asset.rb +29 -191
- data/lib/contentful/management/client.rb +96 -7
- data/lib/contentful/management/client_api_key_methods_factory.rb +15 -0
- data/lib/contentful/management/client_asset_methods_factory.rb +13 -0
- data/lib/contentful/management/client_association_all_published_method_factory.rb +21 -0
- data/lib/contentful/management/client_association_methods_factory.rb +54 -0
- data/lib/contentful/management/client_content_type_methods_factory.rb +13 -0
- data/lib/contentful/management/client_entry_methods_factory.rb +21 -0
- data/lib/contentful/management/client_locale_methods_factory.rb +15 -0
- data/lib/contentful/management/client_space_methods_factory.rb +58 -0
- data/lib/contentful/management/client_webhook_methods_factory.rb +15 -0
- data/lib/contentful/management/content_type.rb +30 -151
- data/lib/contentful/management/content_type_entry_methods_factory.rb +9 -3
- data/lib/contentful/management/dynamic_entry.rb +20 -39
- data/lib/contentful/management/entry.rb +47 -182
- data/lib/contentful/management/http_client.rb +41 -8
- data/lib/contentful/management/locale.rb +7 -76
- data/lib/contentful/management/request.rb +3 -3
- data/lib/contentful/management/resource.rb +105 -7
- data/lib/contentful/management/resource/all_published.rb +24 -0
- data/lib/contentful/management/resource/archiver.rb +37 -0
- data/lib/contentful/management/resource/field_aware.rb +49 -29
- data/lib/contentful/management/resource/publisher.rb +37 -0
- data/lib/contentful/management/resource/refresher.rb +1 -1
- data/lib/contentful/management/resource_builder.rb +8 -4
- data/lib/contentful/management/resource_requester.rb +96 -0
- data/lib/contentful/management/space.rb +40 -43
- data/lib/contentful/management/space_association_all_published_method_factory.rb +1 -1
- data/lib/contentful/management/space_association_methods_factory.rb +6 -3
- data/lib/contentful/management/space_entry_methods_factory.rb +1 -1
- data/lib/contentful/management/version.rb +1 -1
- data/lib/contentful/management/webhook.rb +9 -82
- data/spec/fixtures/vcr_cassettes/asset/create.yml +1 -1
- data/spec/fixtures/vcr_cassettes/asset/create_with_locale.yml +1 -1
- data/spec/fixtures/vcr_cassettes/asset/process.yml +1 -1
- data/spec/fixtures/vcr_cassettes/asset/publish_after_create.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Array_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Boolean_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Date_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Integer_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Link_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Location_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Number_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Object_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Symbol_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/create_with_Text_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/entry/create.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/entry/create_only_with_localized_fields.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/entry/create_to_single_locale_only_with_localized_fields.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/entry/create_with_camel_case_id_to_multiple_locales.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/entry/create_with_entries.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/entry/create_with_entries_for_multiple_locales.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/entry/create_with_multiple_locales.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/fields/create_array_types.yml +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/save_new.yml +1 -1
- data/spec/fixtures/vcr_cassettes/delete_request.yml +38 -0
- data/spec/fixtures/vcr_cassettes/entry/create.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/create_with_asset.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/create_with_assets.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/create_with_entries.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/create_with_entry.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/create_with_just_id.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/create_with_location.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/create_with_specified_locale.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/create_with_symbols.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/too_many_requests.yml +1 -1
- data/spec/fixtures/vcr_cassettes/entry/update_bool_field.yml +1 -1
- data/spec/fixtures/vcr_cassettes/post_request.yml +64 -0
- data/spec/fixtures/vcr_cassettes/proxy_request.yml +562 -0
- data/spec/fixtures/vcr_cassettes/put_request.yml +40 -0
- data/spec/fixtures/vcr_cassettes/space/asset/create.yml +1 -1
- data/spec/fixtures/vcr_cassettes/space/asset/create_with_multiple_locales.yml +1 -1
- data/spec/fixtures/vcr_cassettes/space/content_type/create.yml +1 -1
- data/spec/fixtures/vcr_cassettes/space/create_with_client_default_locale.yml +197 -36
- data/spec/fixtures/vcr_cassettes/space/webhook/create.yml +1 -1
- data/spec/lib/contentful/management/api_key_spec.rb +7 -1
- data/spec/lib/contentful/management/array_spec.rb +1 -1
- data/spec/lib/contentful/management/asset_spec.rb +52 -32
- data/spec/lib/contentful/management/client_spec.rb +38 -0
- data/spec/lib/contentful/management/content_type_spec.rb +37 -22
- data/spec/lib/contentful/management/entry_spec.rb +68 -57
- data/spec/lib/contentful/management/locale_spec.rb +7 -1
- data/spec/lib/contentful/management/space_spec.rb +9 -3
- data/spec/lib/contentful/management/webhook_spec.rb +11 -5
- metadata +23 -2
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: put
|
5
|
+
uri: http://example.com/
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"foo":"bar"}'
|
9
|
+
headers:
|
10
|
+
Connection:
|
11
|
+
- close
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Host:
|
15
|
+
- example.com
|
16
|
+
User-Agent:
|
17
|
+
- http.rb/0.9.8
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 405
|
21
|
+
message: Method Not Allowed
|
22
|
+
headers:
|
23
|
+
Cache-Control:
|
24
|
+
- max-age=604800
|
25
|
+
Date:
|
26
|
+
- Fri, 11 Mar 2016 10:16:00 GMT
|
27
|
+
Expires:
|
28
|
+
- Fri, 18 Mar 2016 10:16:00 GMT
|
29
|
+
Server:
|
30
|
+
- EOS (lax004/45C0)
|
31
|
+
Content-Length:
|
32
|
+
- '0'
|
33
|
+
Connection:
|
34
|
+
- close
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: ''
|
38
|
+
http_version:
|
39
|
+
recorded_at: Fri, 11 Mar 2016 10:16:01 GMT
|
40
|
+
recorded_with: VCR 2.9.3
|
@@ -359,7 +359,7 @@ http_interactions:
|
|
359
359
|
recorded_at: Wed, 30 Jul 2014 12:20:17 GMT
|
360
360
|
- request:
|
361
361
|
method: post
|
362
|
-
uri: https://api.contentful.com/spaces/yr5m0jky5hsh/assets
|
362
|
+
uri: https://api.contentful.com/spaces/yr5m0jky5hsh/assets
|
363
363
|
body:
|
364
364
|
encoding: UTF-8
|
365
365
|
string: '{"fields":{"title":{"en-US":"CodeQuest"},"description":{"en-US":"Logo
|
@@ -855,7 +855,7 @@ http_interactions:
|
|
855
855
|
recorded_at: Fri, 01 Aug 2014 13:17:01 GMT
|
856
856
|
- request:
|
857
857
|
method: post
|
858
|
-
uri: https://api.contentful.com/spaces/yr5m0jky5hsh/assets
|
858
|
+
uri: https://api.contentful.com/spaces/yr5m0jky5hsh/assets
|
859
859
|
body:
|
860
860
|
encoding: UTF-8
|
861
861
|
string: '{"fields":{"title":{"en-US":"Logo of Codequest comapny","pl":"Firmowe
|
@@ -340,7 +340,7 @@ http_interactions:
|
|
340
340
|
recorded_at: Wed, 30 Jul 2014 11:17:14 GMT
|
341
341
|
- request:
|
342
342
|
method: post
|
343
|
-
uri: https://api.contentful.com/spaces/yr5m0jky5hsh/content_types
|
343
|
+
uri: https://api.contentful.com/spaces/yr5m0jky5hsh/content_types
|
344
344
|
body:
|
345
345
|
encoding: UTF-8
|
346
346
|
string: '{"name":"ContentTypeForSpace","description":null,"fields":[]}'
|
@@ -8,13 +8,15 @@ http_interactions:
|
|
8
8
|
string: '{"name":"new space","defaultLocale":"pl-PL"}'
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
|
-
- RubyContentfulManagementGem/0.
|
11
|
+
- RubyContentfulManagementGem/0.9.0
|
12
12
|
Authorization:
|
13
13
|
- Bearer <ACCESS_TOKEN>
|
14
14
|
Content-Type:
|
15
15
|
- application/vnd.contentful.management.v1+json
|
16
16
|
X-Contentful-Organization:
|
17
|
-
-
|
17
|
+
- 4SsuxQCaMaemfIms52Jr8s
|
18
|
+
Connection:
|
19
|
+
- close
|
18
20
|
Host:
|
19
21
|
- api.contentful.com
|
20
22
|
response:
|
@@ -25,7 +27,7 @@ http_interactions:
|
|
25
27
|
Accept-Ranges:
|
26
28
|
- bytes
|
27
29
|
Access-Control-Allow-Headers:
|
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,X-Contentful-Skip-Transformation
|
30
|
+
- 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,X-Contentful-Skip-Transformation,X-Contentful-User-Agent
|
29
31
|
Access-Control-Allow-Methods:
|
30
32
|
- DELETE,GET,HEAD,POST,PUT,OPTIONS
|
31
33
|
Access-Control-Allow-Origin:
|
@@ -39,64 +41,205 @@ http_interactions:
|
|
39
41
|
Content-Type:
|
40
42
|
- application/vnd.contentful.management.v1+json
|
41
43
|
Date:
|
42
|
-
-
|
44
|
+
- Fri, 12 Feb 2016 17:54:03 GMT
|
43
45
|
Etag:
|
44
|
-
- '"
|
46
|
+
- '"fe08ca26704b8485e46b8d3f40f73547"'
|
45
47
|
Location:
|
46
|
-
- https://api.contentful.com/spaces/
|
48
|
+
- https://api.contentful.com/spaces/gcj7kwf33v7b
|
47
49
|
Server:
|
48
50
|
- nginx
|
49
51
|
Status:
|
50
52
|
- 201 Created
|
53
|
+
Strict-Transport-Security:
|
54
|
+
- max-age=15768000
|
55
|
+
X-Content-Type-Options:
|
56
|
+
- nosniff
|
51
57
|
X-Contentful-Request-Id:
|
52
|
-
-
|
58
|
+
- 9e1-1059593025
|
53
59
|
Content-Length:
|
54
|
-
- '
|
60
|
+
- '452'
|
55
61
|
Connection:
|
56
|
-
-
|
62
|
+
- Close
|
63
|
+
Set-Cookie:
|
64
|
+
- incap_ses_297_673446=Ow6Gc1boz1zapaqbWigfBDocvlYAAAAAPBhrPAWFntKLBGJ08v4Zow==;
|
65
|
+
path=/; Domain=.contentful.com
|
66
|
+
- nlbi_673446=bYM9Iyn2+Qm7dpjtlMJDTwAAAACJS5k4Dp0XV/OHK4t0S5Xy; path=/; Domain=.contentful.com
|
67
|
+
- visid_incap_673446=6oTxqucqQcCcAWzNKsTLbTocvlYAAAAAQUIPAAAAAABfl4TrvGqkp7dxFltaQKaj;
|
68
|
+
expires=Sat, 11 Feb 2017 09:35:17 GMT; path=/; Domain=.contentful.com
|
69
|
+
X-Iinfo:
|
70
|
+
- 5-17702270-17702284 NNNN CT(137 135 0) RT(1455299635589 88) q(0 0 3 -1) r(67
|
71
|
+
67) U5
|
72
|
+
X-Cdn:
|
73
|
+
- Incapsula
|
57
74
|
body:
|
58
75
|
encoding: UTF-8
|
59
|
-
string:
|
76
|
+
string: |+
|
60
77
|
{
|
61
78
|
"sys":{
|
62
79
|
"type":"Space",
|
63
|
-
"id":"
|
80
|
+
"id":"gcj7kwf33v7b",
|
64
81
|
"version":1,
|
65
82
|
"createdBy":{
|
66
83
|
"sys":{
|
67
84
|
"type":"Link",
|
68
85
|
"linkType":"User",
|
69
|
-
"id":"
|
86
|
+
"id":"4SejVrWT96dvL9IV4Nb7sQ"
|
70
87
|
}
|
71
88
|
},
|
72
|
-
"createdAt":"
|
89
|
+
"createdAt":"2016-02-12T17:53:56Z",
|
73
90
|
"updatedBy":{
|
74
91
|
"sys":{
|
75
92
|
"type":"Link",
|
76
93
|
"linkType":"User",
|
77
|
-
"id":"
|
94
|
+
"id":"4SejVrWT96dvL9IV4Nb7sQ"
|
78
95
|
}
|
79
96
|
},
|
80
|
-
"updatedAt":"
|
97
|
+
"updatedAt":"2016-02-12T17:53:57Z"
|
98
|
+
},
|
99
|
+
"name":"new space"
|
100
|
+
}
|
101
|
+
|
102
|
+
http_version:
|
103
|
+
recorded_at: Fri, 12 Feb 2016 17:54:02 GMT
|
104
|
+
- request:
|
105
|
+
method: get
|
106
|
+
uri: https://api.contentful.com/spaces/gcj7kwf33v7b/locales
|
107
|
+
body:
|
108
|
+
encoding: US-ASCII
|
109
|
+
string: ''
|
110
|
+
headers:
|
111
|
+
User-Agent:
|
112
|
+
- RubyContentfulManagementGem/0.9.0
|
113
|
+
Authorization:
|
114
|
+
- Bearer <ACCESS_TOKEN>
|
115
|
+
Content-Type:
|
116
|
+
- application/vnd.contentful.management.v1+json
|
117
|
+
Content-Length:
|
118
|
+
- '0'
|
119
|
+
Connection:
|
120
|
+
- close
|
121
|
+
Host:
|
122
|
+
- api.contentful.com
|
123
|
+
response:
|
124
|
+
status:
|
125
|
+
code: 200
|
126
|
+
message: OK
|
127
|
+
headers:
|
128
|
+
Accept-Ranges:
|
129
|
+
- bytes
|
130
|
+
Access-Control-Allow-Headers:
|
131
|
+
- 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,X-Contentful-Skip-Transformation,X-Contentful-User-Agent
|
132
|
+
Access-Control-Allow-Methods:
|
133
|
+
- DELETE,GET,HEAD,POST,PUT,OPTIONS
|
134
|
+
Access-Control-Allow-Origin:
|
135
|
+
- "*"
|
136
|
+
Access-Control-Expose-Headers:
|
137
|
+
- Etag
|
138
|
+
Access-Control-Max-Age:
|
139
|
+
- '1728000'
|
140
|
+
Cache-Control:
|
141
|
+
- max-age=0
|
142
|
+
Content-Type:
|
143
|
+
- application/vnd.contentful.management.v1+json
|
144
|
+
Date:
|
145
|
+
- Fri, 12 Feb 2016 17:54:03 GMT
|
146
|
+
Etag:
|
147
|
+
- '"3ef22a82a8a0ac9b5ef9e40704ae1da6"'
|
148
|
+
Server:
|
149
|
+
- nginx
|
150
|
+
Status:
|
151
|
+
- 200 OK
|
152
|
+
Strict-Transport-Security:
|
153
|
+
- max-age=15768000
|
154
|
+
X-Content-Type-Options:
|
155
|
+
- nosniff
|
156
|
+
X-Contentful-Request-Id:
|
157
|
+
- b89-537671641
|
158
|
+
Content-Length:
|
159
|
+
- '970'
|
160
|
+
Connection:
|
161
|
+
- Close
|
162
|
+
Set-Cookie:
|
163
|
+
- incap_ses_297_673446=Caa/GF0GoS9op6qbWigfBDscvlYAAAAAIuGQDFgSX2L/JhQkt7Hr7A==;
|
164
|
+
path=/; Domain=.contentful.com
|
165
|
+
- nlbi_673446=Kt+MDBlMKiSNO/HXlMJDTwAAAACFUY4bH9JNSRxNVDvAiAKs; path=/; Domain=.contentful.com
|
166
|
+
- visid_incap_673446=JChsExaHRkuStDrykdtNkzscvlYAAAAAQUIPAAAAAABvQyUviBqw9ZXdR5MC3+Dh;
|
167
|
+
expires=Sat, 11 Feb 2017 09:35:17 GMT; path=/; Domain=.contentful.com
|
168
|
+
X-Iinfo:
|
169
|
+
- 5-17704125-17704144 NNNN CT(138 137 0) RT(1455299642450 90) q(0 0 3 -1) r(5
|
170
|
+
5) U5
|
171
|
+
X-Cdn:
|
172
|
+
- Incapsula
|
173
|
+
body:
|
174
|
+
encoding: UTF-8
|
175
|
+
string: |+
|
176
|
+
{
|
177
|
+
"sys":{
|
178
|
+
"type":"Array"
|
81
179
|
},
|
82
|
-
"
|
180
|
+
"items":[
|
181
|
+
{
|
182
|
+
"sys":{
|
183
|
+
"type":"Locale",
|
184
|
+
"id":"3ZoI2tgCwxLD5NQaMbLEOt",
|
185
|
+
"version":0,
|
186
|
+
"space":{
|
187
|
+
"sys":{
|
188
|
+
"type":"Link",
|
189
|
+
"linkType":"Space",
|
190
|
+
"id":"gcj7kwf33v7b"
|
191
|
+
}
|
192
|
+
},
|
193
|
+
"createdBy":{
|
194
|
+
"sys":{
|
195
|
+
"type":"Link",
|
196
|
+
"linkType":"User",
|
197
|
+
"id":"4SejVrWT96dvL9IV4Nb7sQ"
|
198
|
+
}
|
199
|
+
},
|
200
|
+
"createdAt":"2016-02-12T17:53:57Z",
|
201
|
+
"updatedBy":{
|
202
|
+
"sys":{
|
203
|
+
"type":"Link",
|
204
|
+
"linkType":"User",
|
205
|
+
"id":"4SejVrWT96dvL9IV4Nb7sQ"
|
206
|
+
}
|
207
|
+
},
|
208
|
+
"updatedAt":"2016-02-12T17:53:57Z"
|
209
|
+
},
|
210
|
+
"name":"pl-PL",
|
211
|
+
"internal_code":"pl-PL",
|
212
|
+
"code":"pl-PL",
|
213
|
+
"fallback_code":null,
|
214
|
+
"default":true,
|
215
|
+
"contentManagementApi":true,
|
216
|
+
"contentDeliveryApi":true
|
217
|
+
}
|
218
|
+
],
|
219
|
+
"total":1,
|
220
|
+
"limit":100,
|
221
|
+
"skip":0
|
222
|
+
}
|
223
|
+
|
83
224
|
http_version:
|
84
|
-
recorded_at:
|
225
|
+
recorded_at: Fri, 12 Feb 2016 17:54:03 GMT
|
85
226
|
- request:
|
86
227
|
method: get
|
87
|
-
uri: https://api.contentful.com/spaces/
|
228
|
+
uri: https://api.contentful.com/spaces/gcj7kwf33v7b/locales
|
88
229
|
body:
|
89
230
|
encoding: US-ASCII
|
90
231
|
string: ''
|
91
232
|
headers:
|
92
233
|
User-Agent:
|
93
|
-
- RubyContentfulManagementGem/0.
|
234
|
+
- RubyContentfulManagementGem/0.9.0
|
94
235
|
Authorization:
|
95
236
|
- Bearer <ACCESS_TOKEN>
|
96
237
|
Content-Type:
|
97
238
|
- application/vnd.contentful.management.v1+json
|
98
239
|
Content-Length:
|
99
240
|
- '0'
|
241
|
+
Connection:
|
242
|
+
- close
|
100
243
|
Host:
|
101
244
|
- api.contentful.com
|
102
245
|
response:
|
@@ -107,7 +250,7 @@ http_interactions:
|
|
107
250
|
Accept-Ranges:
|
108
251
|
- bytes
|
109
252
|
Access-Control-Allow-Headers:
|
110
|
-
- 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,X-Contentful-Skip-Transformation
|
253
|
+
- 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,X-Contentful-Skip-Transformation,X-Contentful-User-Agent
|
111
254
|
Access-Control-Allow-Methods:
|
112
255
|
- DELETE,GET,HEAD,POST,PUT,OPTIONS
|
113
256
|
Access-Control-Allow-Origin:
|
@@ -121,22 +264,37 @@ http_interactions:
|
|
121
264
|
Content-Type:
|
122
265
|
- application/vnd.contentful.management.v1+json
|
123
266
|
Date:
|
124
|
-
-
|
267
|
+
- Fri, 12 Feb 2016 17:54:04 GMT
|
125
268
|
Etag:
|
126
|
-
- '"
|
269
|
+
- '"3ef22a82a8a0ac9b5ef9e40704ae1da6"'
|
127
270
|
Server:
|
128
271
|
- nginx
|
129
272
|
Status:
|
130
273
|
- 200 OK
|
274
|
+
Strict-Transport-Security:
|
275
|
+
- max-age=15768000
|
276
|
+
X-Content-Type-Options:
|
277
|
+
- nosniff
|
131
278
|
X-Contentful-Request-Id:
|
132
|
-
-
|
279
|
+
- 9e1-1059593102
|
133
280
|
Content-Length:
|
134
|
-
- '
|
281
|
+
- '970'
|
135
282
|
Connection:
|
136
|
-
-
|
283
|
+
- Close
|
284
|
+
Set-Cookie:
|
285
|
+
- incap_ses_297_673446=oJv/C0ifgx6yqKqbWigfBDscvlYAAAAAOZmOm64TNsFJlylmrNpy1g==;
|
286
|
+
path=/; Domain=.contentful.com
|
287
|
+
- nlbi_673446=RXd2AbScAS0w4tO2lMJDTwAAAACTJlf3WryhcJD5vVzOXh51; path=/; Domain=.contentful.com
|
288
|
+
- visid_incap_673446=I8Y3d5q6Sea2JZhYTNUVLDscvlYAAAAAQUIPAAAAAAARZ8R8znlllCljNxkS10gl;
|
289
|
+
expires=Sat, 11 Feb 2017 09:35:16 GMT; path=/; Domain=.contentful.com
|
290
|
+
X-Iinfo:
|
291
|
+
- 6-16151273-16151297 NNNN CT(135 141 0) RT(1455299643116 106) q(0 0 2 -1) r(4
|
292
|
+
4) U5
|
293
|
+
X-Cdn:
|
294
|
+
- Incapsula
|
137
295
|
body:
|
138
296
|
encoding: UTF-8
|
139
|
-
string:
|
297
|
+
string: |+
|
140
298
|
{
|
141
299
|
"sys":{
|
142
300
|
"type":"Array"
|
@@ -145,43 +303,46 @@ http_interactions:
|
|
145
303
|
{
|
146
304
|
"sys":{
|
147
305
|
"type":"Locale",
|
148
|
-
"id":"
|
306
|
+
"id":"3ZoI2tgCwxLD5NQaMbLEOt",
|
149
307
|
"version":0,
|
150
308
|
"space":{
|
151
309
|
"sys":{
|
152
310
|
"type":"Link",
|
153
311
|
"linkType":"Space",
|
154
|
-
"id":"
|
312
|
+
"id":"gcj7kwf33v7b"
|
155
313
|
}
|
156
314
|
},
|
157
315
|
"createdBy":{
|
158
316
|
"sys":{
|
159
317
|
"type":"Link",
|
160
318
|
"linkType":"User",
|
161
|
-
"id":"
|
319
|
+
"id":"4SejVrWT96dvL9IV4Nb7sQ"
|
162
320
|
}
|
163
321
|
},
|
164
|
-
"createdAt":"
|
322
|
+
"createdAt":"2016-02-12T17:53:57Z",
|
165
323
|
"updatedBy":{
|
166
324
|
"sys":{
|
167
325
|
"type":"Link",
|
168
326
|
"linkType":"User",
|
169
|
-
"id":"
|
327
|
+
"id":"4SejVrWT96dvL9IV4Nb7sQ"
|
170
328
|
}
|
171
329
|
},
|
172
|
-
"updatedAt":"
|
330
|
+
"updatedAt":"2016-02-12T17:53:57Z"
|
173
331
|
},
|
174
332
|
"name":"pl-PL",
|
333
|
+
"internal_code":"pl-PL",
|
175
334
|
"code":"pl-PL",
|
335
|
+
"fallback_code":null,
|
176
336
|
"default":true,
|
177
337
|
"contentManagementApi":true,
|
178
|
-
"publish":true,
|
179
338
|
"contentDeliveryApi":true
|
180
339
|
}
|
181
340
|
],
|
182
341
|
"total":1,
|
183
|
-
"limit":
|
184
|
-
"skip":0
|
342
|
+
"limit":100,
|
343
|
+
"skip":0
|
344
|
+
}
|
345
|
+
|
185
346
|
http_version:
|
186
|
-
recorded_at:
|
347
|
+
recorded_at: Fri, 12 Feb 2016 17:54:03 GMT
|
187
348
|
recorded_with: VCR 2.9.3
|
@@ -350,7 +350,7 @@ http_interactions:
|
|
350
350
|
recorded_at: Tue, 30 Sep 2014 07:17:05 GMT
|
351
351
|
- request:
|
352
352
|
method: post
|
353
|
-
uri: https://api.contentful.com/spaces/v2umtz8ths9v/webhook_definitions
|
353
|
+
uri: https://api.contentful.com/spaces/v2umtz8ths9v/webhook_definitions
|
354
354
|
body:
|
355
355
|
encoding: UTF-8
|
356
356
|
string: '{"url":"https://www.example2.com","httpBasicUsername":"username","httpBasicPassword":"password"}'
|
@@ -11,9 +11,12 @@ module Contentful
|
|
11
11
|
|
12
12
|
let!(:client) { Client.new(token) }
|
13
13
|
|
14
|
-
subject {
|
14
|
+
subject { client.api_keys }
|
15
15
|
|
16
16
|
describe '.all' do
|
17
|
+
it 'class method also works' do
|
18
|
+
vcr('api_key/all_for_space') { expect(Contentful::Management::ApiKey.all(client, space_id)).to be_kind_of Contentful::Management::Array }
|
19
|
+
end
|
17
20
|
it 'returns a Contentful::Array' do
|
18
21
|
vcr('api_key/all_for_space') { expect(subject.all(space_id)).to be_kind_of Contentful::Management::Array }
|
19
22
|
end
|
@@ -23,6 +26,9 @@ module Contentful
|
|
23
26
|
end
|
24
27
|
|
25
28
|
describe '.find' do
|
29
|
+
it 'class method also works' do
|
30
|
+
vcr('api_key/find') { expect(Contentful::Management::ApiKey.find(client, space_id, api_key_id)).to be_kind_of Contentful::Management::ApiKey }
|
31
|
+
end
|
26
32
|
it 'returns a Contentful::Management::ApiKey' do
|
27
33
|
vcr('api_key/find') { expect(subject.find(space_id, api_key_id)).to be_kind_of Contentful::Management::ApiKey }
|
28
34
|
end
|