kontent-delivery-sdk-ruby 2.0.18 → 2.0.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +21 -21
  3. data/README.md +575 -576
  4. data/bin/console +14 -14
  5. data/bin/setup +8 -8
  6. data/lib/delivery/builders/image_transformation_builder.rb +271 -271
  7. data/lib/delivery/builders/url_builder.rb +120 -120
  8. data/lib/delivery/client/delivery_client.rb +176 -176
  9. data/lib/delivery/client/delivery_query.rb +302 -302
  10. data/lib/delivery/client/request_manager.rb +125 -125
  11. data/lib/delivery/models/content_item.rb +153 -153
  12. data/lib/delivery/models/content_type.rb +41 -41
  13. data/lib/delivery/models/pagination.rb +22 -22
  14. data/lib/delivery/models/taxonomy_group.rb +39 -39
  15. data/lib/delivery/query_parameters/filters.rb +158 -158
  16. data/lib/delivery/query_parameters/parameter_base.rb +46 -46
  17. data/lib/delivery/query_parameters/query_string.rb +78 -78
  18. data/lib/delivery/resolvers/content_link_resolver.rb +102 -102
  19. data/lib/delivery/resolvers/inline_content_item_resolver.rb +75 -75
  20. data/lib/delivery/resolvers/linked_item_resolver.rb +37 -37
  21. data/lib/delivery/responses/delivery_element_response.rb +34 -34
  22. data/lib/delivery/responses/delivery_item_listing_response.rb +54 -54
  23. data/lib/delivery/responses/delivery_item_response.rb +40 -40
  24. data/lib/delivery/responses/delivery_items_feed_response.rb +58 -58
  25. data/lib/delivery/responses/delivery_taxonomy_listing_response.rb +47 -47
  26. data/lib/delivery/responses/delivery_taxonomy_response.rb +33 -33
  27. data/lib/delivery/responses/delivery_type_listing_response.rb +46 -46
  28. data/lib/delivery/responses/delivery_type_response.rb +32 -32
  29. data/lib/delivery/responses/response_base.rb +39 -39
  30. data/lib/delivery/tests/401.json +5 -5
  31. data/lib/delivery/tests/429.json +4 -4
  32. data/lib/delivery/tests/fake_responder.rb +110 -110
  33. data/lib/delivery/tests/filtering/items_gt.json +565 -565
  34. data/lib/delivery/tests/filtering/items_with_count.json +4985 -4985
  35. data/lib/delivery/tests/filtering/multiple.json +282 -282
  36. data/lib/delivery/tests/filtering/pagination_about_us.json +646 -646
  37. data/lib/delivery/tests/generic/items.json +4984 -4984
  38. data/lib/delivery/tests/generic/items/about_us.json +227 -227
  39. data/lib/delivery/tests/generic/items/aeropress_filters.json +138 -138
  40. data/lib/delivery/tests/generic/items/coffee_processing_techniques.json +168 -168
  41. data/lib/delivery/tests/generic/items/where_does_coffee_come_from_.json +620 -620
  42. data/lib/delivery/tests/generic/taxonomies.json +126 -126
  43. data/lib/delivery/tests/generic/types.json +780 -780
  44. data/lib/delivery/tests/generic/types/brewer/elements/product_status.json +5 -5
  45. data/lib/delivery/tests/items_feed/articles_feed_1.json +39 -39
  46. data/lib/delivery/tests/items_feed/articles_feed_2.json +78 -78
  47. data/lib/delivery/tests/items_feed/articles_feed_3.json +104 -104
  48. data/lib/delivery/version.rb +7 -7
  49. data/lib/kontent-delivery-sdk-ruby.rb +20 -20
  50. metadata +30 -11
@@ -1,228 +1,228 @@
1
- {
2
- "item": {
3
- "system": {
4
- "id": "ef23e568-6aa2-42cd-a120-7823c0ef19f7",
5
- "name": "About us",
6
- "codename": "about_us",
7
- "language": "en-US",
8
- "type": "about_us",
9
- "sitemap_locations": [
10
- "about_us"
11
- ],
12
- "last_modified": "2018-08-18T13:19:18.933Z"
13
- },
14
- "elements": {
15
- "facts": {
16
- "type": "modular_content",
17
- "name": "Facts",
18
- "value": [
19
- "our_philosophy",
20
- "how_we_source_our_coffees",
21
- "how_we_roast_our_coffees"
22
- ]
23
- },
24
- "url_pattern": {
25
- "type": "url_slug",
26
- "name": "URL pattern",
27
- "value": "about-us"
28
- },
29
- "metadata__meta_title": {
30
- "type": "text",
31
- "name": "Meta title",
32
- "value": "About Dancing Goat Coffee"
33
- },
34
- "metadata__meta_description": {
35
- "type": "text",
36
- "name": "Meta description",
37
- "value": "Since Dancing Goat's origin in 1969, we have been striving to do things right. Learn how we do things at Dancing Goat Coffee!"
38
- },
39
- "metadata__og_title": {
40
- "type": "text",
41
- "name": "og:title",
42
- "value": "About Dancing Goat Coffee"
43
- },
44
- "metadata__og_description": {
45
- "type": "text",
46
- "name": "og:description",
47
- "value": "Since Dancing Goat's origin in 1969, we have been striving to do things right. Learn how we do things at Dancing Goat Coffee!"
48
- },
49
- "metadata__og_image": {
50
- "type": "asset",
51
- "name": "og:image",
52
- "value": [
53
- {
54
- "name": "on-roasts-1080px.jpg",
55
- "type": "image/jpeg",
56
- "size": 121946,
57
- "description": "Coffee Roastery",
58
- "url": "https://assets-us-01.kc-usercontent.com:443/faf446d2-0544-0039-bb43-5d6ef816661a/f6daed1f-3f3b-4036-a9c7-9519359b9601/on-roasts-1080px.jpg"
59
- }
60
- ]
61
- },
62
- "metadata__twitter_site": {
63
- "type": "text",
64
- "name": "twitter:site",
65
- "value": "Dancing Goat"
66
- },
67
- "metadata__twitter_creator": {
68
- "type": "text",
69
- "name": "twitter:creator",
70
- "value": "@kenticokontent"
71
- },
72
- "metadata__twitter_title": {
73
- "type": "text",
74
- "name": "twitter:title",
75
- "value": "About Dancing Goat Coffee"
76
- },
77
- "metadata__twitter_description": {
78
- "type": "text",
79
- "name": "twitter:description",
80
- "value": "Since Dancing Goat's origin in 1969, we have been striving to do things right. Learn how we do things at Dancing Goat Coffee!"
81
- },
82
- "metadata__twitter_image": {
83
- "type": "asset",
84
- "name": "twitter:image",
85
- "value": [
86
- {
87
- "name": "on-roasts-1080px.jpg",
88
- "type": "image/jpeg",
89
- "size": 121946,
90
- "description": "Coffee Roastery",
91
- "url": "https://assets-us-01.kc-usercontent.com:443/faf446d2-0544-0039-bb43-5d6ef816661a/f6daed1f-3f3b-4036-a9c7-9519359b9601/on-roasts-1080px.jpg"
92
- }
93
- ]
94
- }
95
- }
96
- },
97
- "modular_content": {
98
- "how_we_roast_our_coffees": {
99
- "system": {
100
- "id": "1c303d3b-27a9-4827-b0c0-fb05da17ccbc",
101
- "name": "How we roast our coffees",
102
- "codename": "how_we_roast_our_coffees",
103
- "language": "en-US",
104
- "type": "fact_about_us",
105
- "sitemap_locations": [
106
- "about_us"
107
- ],
108
- "last_modified": "2017-04-04T11:48:26.187Z"
109
- },
110
- "elements": {
111
- "title": {
112
- "type": "text",
113
- "name": "Title",
114
- "value": "How we roast our coffees"
115
- },
116
- "description": {
117
- "type": "rich_text",
118
- "name": "Description",
119
- "images": {},
120
- "links": {
121
- "f4b3fc05-e988-4dae-9ac1-a94aba566474": {
122
- "codename": "on_roasts",
123
- "type": "article",
124
- "url_slug": "on-roasts"
125
- }
126
- },
127
- "modular_content": [],
128
- "value": "<p>We operate our own roasteries, one on every continent we cover, from where we distribute right to the shops. This allows you to experience every cup as if you were right at the very farm it originated from. To achieve this, we use a refurbished 1920s Probat coffee roasters.</p>\n<p>We know that roasting is something you must keep on constantly perfecting. Each coffee requires a different roast to get the aroma and taste just right. That’s why our experts fine tune <a data-item-id=\"f4b3fc05-e988-4dae-9ac1-a94aba566474\" href=\"\">the way we roast coffees</a> every day. It’s a constant struggle.</p>"
129
- },
130
- "image": {
131
- "type": "asset",
132
- "name": "Image",
133
- "value": [
134
- {
135
- "name": "roaster.jpg",
136
- "type": "image/jpeg",
137
- "size": 50240,
138
- "description": "Coffee Roaster",
139
- "url": "https://assets-us-01.kc-usercontent.com:443/faf446d2-0544-0039-bb43-5d6ef816661a/66d73245-10e5-4478-93e7-5609fee3cdf7/roaster.jpg"
140
- }
141
- ]
142
- }
143
- }
144
- },
145
- "how_we_source_our_coffees": {
146
- "system": {
147
- "id": "18689ab0-e5ff-4ca5-bd13-ae3b5997c2d9",
148
- "name": "How we source our coffees",
149
- "codename": "how_we_source_our_coffees",
150
- "language": "en-US",
151
- "type": "fact_about_us",
152
- "sitemap_locations": [
153
- "about_us"
154
- ],
155
- "last_modified": "2016-10-20T12:47:13.65Z"
156
- },
157
- "elements": {
158
- "title": {
159
- "type": "text",
160
- "name": "Title",
161
- "value": "How we source our coffees"
162
- },
163
- "description": {
164
- "type": "rich_text",
165
- "name": "Description",
166
- "images": {},
167
- "links": {},
168
- "modular_content": [],
169
- "value": "<p>Every coffee has a story to share. We want this story to reach you in the most unaltered manner possible.</p>\n<p>With estate coffees and micro lots from diverse varietals located all over the globe, you can taste the world with Dancing Goat.</p>\n<p>We know all our farmers personally. These are mostly family businesses that have been up and running for decades. They do what they love, and hand pick their produce with care. We make sure they get as much from our relationships as we and you do.</p>\n<p>Every bean in our stock is 100% traceable to its source. Clean both for the eye and the environment, our beans are always of the latest season — we never store more coffee than we have to.</p>"
170
- },
171
- "image": {
172
- "type": "asset",
173
- "name": "Image",
174
- "value": [
175
- {
176
- "name": "sources.jpg",
177
- "type": "image/jpeg",
178
- "size": 46469,
179
- "description": "Coffee Berries",
180
- "url": "https://assets-us-01.kc-usercontent.com:443/faf446d2-0544-0039-bb43-5d6ef816661a/3e76909f-599f-4742-b472-77fd4b510e92/sources.jpg"
181
- }
182
- ]
183
- }
184
- }
185
- },
186
- "our_philosophy": {
187
- "system": {
188
- "id": "a4aad96b-3f5d-41a9-b2c7-e0132bd533ec",
189
- "name": "Our philosophy",
190
- "codename": "our_philosophy",
191
- "language": "en-US",
192
- "type": "fact_about_us",
193
- "sitemap_locations": [
194
- "about_us"
195
- ],
196
- "last_modified": "2016-10-20T12:06:18.34Z"
197
- },
198
- "elements": {
199
- "title": {
200
- "type": "text",
201
- "name": "Title",
202
- "value": "Our philosophy"
203
- },
204
- "description": {
205
- "type": "rich_text",
206
- "name": "Description",
207
- "images": {},
208
- "links": {},
209
- "modular_content": [],
210
- "value": "<p>Since Dancing Goat's origin in 1969, we have been striving to do things right. Not only do we source the best coffees you can get your hands on, we also make sure we have a direct relationship with our farmers. Visiting the micro farms where we source our coffees is our daily bread. This way, we can guarantee the highest quality standard all year long. Our farmers get the best deal possible, so do you.</p>\n<p>Each one of us is a coffee enthusiast, but you don’t need to be an aficionado to enjoy the best. Ask us anything, we will happily take you on a tour of everything we have to offer. Stop by, relax, and put your mind at ease. There are no distractions at Dancing Goat; it’s just you and your cup of coffee.</p>\n<p>Are you a coffee seller or a cafe owner? Become our partner and spread our high-quality coffee among your customers. Or do you just want to taste good coffee? Come and join us at Dancing Goat, a place where the revival of alternative coffee preparation methods takes place. Extracting the best coffee in a vacuum coffee maker or the charming Chemex is just one of the things you can see here.</p>"
211
- },
212
- "image": {
213
- "type": "asset",
214
- "name": "Image",
215
- "value": [
216
- {
217
- "name": "about.jpg",
218
- "type": "image/jpeg",
219
- "size": 56264,
220
- "description": "Dancing Goat Café - Los Angeles",
221
- "url": "https://assets-us-01.kc-usercontent.com:443/faf446d2-0544-0039-bb43-5d6ef816661a/512047f1-2f7f-45fd-9e90-e71b8feae017/about.jpg"
222
- }
223
- ]
224
- }
225
- }
226
- }
227
- }
1
+ {
2
+ "item": {
3
+ "system": {
4
+ "id": "ef23e568-6aa2-42cd-a120-7823c0ef19f7",
5
+ "name": "About us",
6
+ "codename": "about_us",
7
+ "language": "en-US",
8
+ "type": "about_us",
9
+ "sitemap_locations": [
10
+ "about_us"
11
+ ],
12
+ "last_modified": "2018-08-18T13:19:18.933Z"
13
+ },
14
+ "elements": {
15
+ "facts": {
16
+ "type": "modular_content",
17
+ "name": "Facts",
18
+ "value": [
19
+ "our_philosophy",
20
+ "how_we_source_our_coffees",
21
+ "how_we_roast_our_coffees"
22
+ ]
23
+ },
24
+ "url_pattern": {
25
+ "type": "url_slug",
26
+ "name": "URL pattern",
27
+ "value": "about-us"
28
+ },
29
+ "metadata__meta_title": {
30
+ "type": "text",
31
+ "name": "Meta title",
32
+ "value": "About Dancing Goat Coffee"
33
+ },
34
+ "metadata__meta_description": {
35
+ "type": "text",
36
+ "name": "Meta description",
37
+ "value": "Since Dancing Goat's origin in 1969, we have been striving to do things right. Learn how we do things at Dancing Goat Coffee!"
38
+ },
39
+ "metadata__og_title": {
40
+ "type": "text",
41
+ "name": "og:title",
42
+ "value": "About Dancing Goat Coffee"
43
+ },
44
+ "metadata__og_description": {
45
+ "type": "text",
46
+ "name": "og:description",
47
+ "value": "Since Dancing Goat's origin in 1969, we have been striving to do things right. Learn how we do things at Dancing Goat Coffee!"
48
+ },
49
+ "metadata__og_image": {
50
+ "type": "asset",
51
+ "name": "og:image",
52
+ "value": [
53
+ {
54
+ "name": "on-roasts-1080px.jpg",
55
+ "type": "image/jpeg",
56
+ "size": 121946,
57
+ "description": "Coffee Roastery",
58
+ "url": "https://assets-us-01.kc-usercontent.com:443/faf446d2-0544-0039-bb43-5d6ef816661a/f6daed1f-3f3b-4036-a9c7-9519359b9601/on-roasts-1080px.jpg"
59
+ }
60
+ ]
61
+ },
62
+ "metadata__twitter_site": {
63
+ "type": "text",
64
+ "name": "twitter:site",
65
+ "value": "Dancing Goat"
66
+ },
67
+ "metadata__twitter_creator": {
68
+ "type": "text",
69
+ "name": "twitter:creator",
70
+ "value": "@kenticokontent"
71
+ },
72
+ "metadata__twitter_title": {
73
+ "type": "text",
74
+ "name": "twitter:title",
75
+ "value": "About Dancing Goat Coffee"
76
+ },
77
+ "metadata__twitter_description": {
78
+ "type": "text",
79
+ "name": "twitter:description",
80
+ "value": "Since Dancing Goat's origin in 1969, we have been striving to do things right. Learn how we do things at Dancing Goat Coffee!"
81
+ },
82
+ "metadata__twitter_image": {
83
+ "type": "asset",
84
+ "name": "twitter:image",
85
+ "value": [
86
+ {
87
+ "name": "on-roasts-1080px.jpg",
88
+ "type": "image/jpeg",
89
+ "size": 121946,
90
+ "description": "Coffee Roastery",
91
+ "url": "https://assets-us-01.kc-usercontent.com:443/faf446d2-0544-0039-bb43-5d6ef816661a/f6daed1f-3f3b-4036-a9c7-9519359b9601/on-roasts-1080px.jpg"
92
+ }
93
+ ]
94
+ }
95
+ }
96
+ },
97
+ "modular_content": {
98
+ "how_we_roast_our_coffees": {
99
+ "system": {
100
+ "id": "1c303d3b-27a9-4827-b0c0-fb05da17ccbc",
101
+ "name": "How we roast our coffees",
102
+ "codename": "how_we_roast_our_coffees",
103
+ "language": "en-US",
104
+ "type": "fact_about_us",
105
+ "sitemap_locations": [
106
+ "about_us"
107
+ ],
108
+ "last_modified": "2017-04-04T11:48:26.187Z"
109
+ },
110
+ "elements": {
111
+ "title": {
112
+ "type": "text",
113
+ "name": "Title",
114
+ "value": "How we roast our coffees"
115
+ },
116
+ "description": {
117
+ "type": "rich_text",
118
+ "name": "Description",
119
+ "images": {},
120
+ "links": {
121
+ "f4b3fc05-e988-4dae-9ac1-a94aba566474": {
122
+ "codename": "on_roasts",
123
+ "type": "article",
124
+ "url_slug": "on-roasts"
125
+ }
126
+ },
127
+ "modular_content": [],
128
+ "value": "<p>We operate our own roasteries, one on every continent we cover, from where we distribute right to the shops. This allows you to experience every cup as if you were right at the very farm it originated from. To achieve this, we use a refurbished 1920s Probat coffee roasters.</p>\n<p>We know that roasting is something you must keep on constantly perfecting. Each coffee requires a different roast to get the aroma and taste just right. That’s why our experts fine tune <a data-item-id=\"f4b3fc05-e988-4dae-9ac1-a94aba566474\" href=\"\">the way we roast coffees</a> every day. It’s a constant struggle.</p>"
129
+ },
130
+ "image": {
131
+ "type": "asset",
132
+ "name": "Image",
133
+ "value": [
134
+ {
135
+ "name": "roaster.jpg",
136
+ "type": "image/jpeg",
137
+ "size": 50240,
138
+ "description": "Coffee Roaster",
139
+ "url": "https://assets-us-01.kc-usercontent.com:443/faf446d2-0544-0039-bb43-5d6ef816661a/66d73245-10e5-4478-93e7-5609fee3cdf7/roaster.jpg"
140
+ }
141
+ ]
142
+ }
143
+ }
144
+ },
145
+ "how_we_source_our_coffees": {
146
+ "system": {
147
+ "id": "18689ab0-e5ff-4ca5-bd13-ae3b5997c2d9",
148
+ "name": "How we source our coffees",
149
+ "codename": "how_we_source_our_coffees",
150
+ "language": "en-US",
151
+ "type": "fact_about_us",
152
+ "sitemap_locations": [
153
+ "about_us"
154
+ ],
155
+ "last_modified": "2016-10-20T12:47:13.65Z"
156
+ },
157
+ "elements": {
158
+ "title": {
159
+ "type": "text",
160
+ "name": "Title",
161
+ "value": "How we source our coffees"
162
+ },
163
+ "description": {
164
+ "type": "rich_text",
165
+ "name": "Description",
166
+ "images": {},
167
+ "links": {},
168
+ "modular_content": [],
169
+ "value": "<p>Every coffee has a story to share. We want this story to reach you in the most unaltered manner possible.</p>\n<p>With estate coffees and micro lots from diverse varietals located all over the globe, you can taste the world with Dancing Goat.</p>\n<p>We know all our farmers personally. These are mostly family businesses that have been up and running for decades. They do what they love, and hand pick their produce with care. We make sure they get as much from our relationships as we and you do.</p>\n<p>Every bean in our stock is 100% traceable to its source. Clean both for the eye and the environment, our beans are always of the latest season — we never store more coffee than we have to.</p>"
170
+ },
171
+ "image": {
172
+ "type": "asset",
173
+ "name": "Image",
174
+ "value": [
175
+ {
176
+ "name": "sources.jpg",
177
+ "type": "image/jpeg",
178
+ "size": 46469,
179
+ "description": "Coffee Berries",
180
+ "url": "https://assets-us-01.kc-usercontent.com:443/faf446d2-0544-0039-bb43-5d6ef816661a/3e76909f-599f-4742-b472-77fd4b510e92/sources.jpg"
181
+ }
182
+ ]
183
+ }
184
+ }
185
+ },
186
+ "our_philosophy": {
187
+ "system": {
188
+ "id": "a4aad96b-3f5d-41a9-b2c7-e0132bd533ec",
189
+ "name": "Our philosophy",
190
+ "codename": "our_philosophy",
191
+ "language": "en-US",
192
+ "type": "fact_about_us",
193
+ "sitemap_locations": [
194
+ "about_us"
195
+ ],
196
+ "last_modified": "2016-10-20T12:06:18.34Z"
197
+ },
198
+ "elements": {
199
+ "title": {
200
+ "type": "text",
201
+ "name": "Title",
202
+ "value": "Our philosophy"
203
+ },
204
+ "description": {
205
+ "type": "rich_text",
206
+ "name": "Description",
207
+ "images": {},
208
+ "links": {},
209
+ "modular_content": [],
210
+ "value": "<p>Since Dancing Goat's origin in 1969, we have been striving to do things right. Not only do we source the best coffees you can get your hands on, we also make sure we have a direct relationship with our farmers. Visiting the micro farms where we source our coffees is our daily bread. This way, we can guarantee the highest quality standard all year long. Our farmers get the best deal possible, so do you.</p>\n<p>Each one of us is a coffee enthusiast, but you don’t need to be an aficionado to enjoy the best. Ask us anything, we will happily take you on a tour of everything we have to offer. Stop by, relax, and put your mind at ease. There are no distractions at Dancing Goat; it’s just you and your cup of coffee.</p>\n<p>Are you a coffee seller or a cafe owner? Become our partner and spread our high-quality coffee among your customers. Or do you just want to taste good coffee? Come and join us at Dancing Goat, a place where the revival of alternative coffee preparation methods takes place. Extracting the best coffee in a vacuum coffee maker or the charming Chemex is just one of the things you can see here.</p>"
211
+ },
212
+ "image": {
213
+ "type": "asset",
214
+ "name": "Image",
215
+ "value": [
216
+ {
217
+ "name": "about.jpg",
218
+ "type": "image/jpeg",
219
+ "size": 56264,
220
+ "description": "Dancing Goat Café - Los Angeles",
221
+ "url": "https://assets-us-01.kc-usercontent.com:443/faf446d2-0544-0039-bb43-5d6ef816661a/512047f1-2f7f-45fd-9e90-e71b8feae017/about.jpg"
222
+ }
223
+ ]
224
+ }
225
+ }
226
+ }
227
+ }
228
228
  }