@guardian/content-api-models 4.0.0

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.
Files changed (192) hide show
  1. package/auxiliaryatomevent/v1/auxiliaryAtom.d.ts +14 -0
  2. package/auxiliaryatomevent/v1/auxiliaryAtom.js +70 -0
  3. package/auxiliaryatomevent/v1/auxiliaryAtomEvent.d.ts +17 -0
  4. package/auxiliaryatomevent/v1/auxiliaryAtomEvent.js +100 -0
  5. package/auxiliaryatomevent/v1/eventType.d.ts +9 -0
  6. package/auxiliaryatomevent/v1/eventType.js +13 -0
  7. package/crier/event/v1/deletedContent.d.ts +14 -0
  8. package/crier/event/v1/deletedContent.js +70 -0
  9. package/crier/event/v1/event.d.ts +21 -0
  10. package/crier/event/v1/event.js +116 -0
  11. package/crier/event/v1/eventPayload.d.ts +27 -0
  12. package/crier/event/v1/eventPayload.js +118 -0
  13. package/crier/event/v1/eventType.d.ts +10 -0
  14. package/crier/event/v1/eventType.js +14 -0
  15. package/crier/event/v1/itemType.d.ts +12 -0
  16. package/crier/event/v1/itemType.js +16 -0
  17. package/crier/event/v1/retrievableContent.d.ts +21 -0
  18. package/crier/event/v1/retrievableContent.js +145 -0
  19. package/fastly/event/v1/contentDecachedEvent.d.ts +19 -0
  20. package/fastly/event/v1/contentDecachedEvent.js +100 -0
  21. package/fastly/event/v1/eventType.d.ts +9 -0
  22. package/fastly/event/v1/eventType.js +13 -0
  23. package/package.json +24 -0
  24. package/tsconfig.json +15 -0
  25. package/v1/aliasPath.d.ts +15 -0
  26. package/v1/aliasPath.js +71 -0
  27. package/v1/asset.d.ts +18 -0
  28. package/v1/asset.js +101 -0
  29. package/v1/assetFields.d.ts +85 -0
  30. package/v1/assetFields.js +1106 -0
  31. package/v1/assetType.d.ts +13 -0
  32. package/v1/assetType.js +17 -0
  33. package/v1/atomUsageResponse.d.ts +20 -0
  34. package/v1/atomUsageResponse.js +174 -0
  35. package/v1/atoms.d.ts +29 -0
  36. package/v1/atoms.js +490 -0
  37. package/v1/atomsResponse.d.ts +21 -0
  38. package/v1/atomsResponse.js +175 -0
  39. package/v1/audioElementFields.d.ts +25 -0
  40. package/v1/audioElementFields.js +235 -0
  41. package/v1/block.d.ts +30 -0
  42. package/v1/block.js +283 -0
  43. package/v1/blockAttributes.d.ts +18 -0
  44. package/v1/blockAttributes.js +116 -0
  45. package/v1/blockElement.d.ts +60 -0
  46. package/v1/blockElement.js +451 -0
  47. package/v1/blocks.d.ts +19 -0
  48. package/v1/blocks.js +144 -0
  49. package/v1/calloutElementFields.d.ts +17 -0
  50. package/v1/calloutElementFields.js +115 -0
  51. package/v1/capiDateTime.d.ts +15 -0
  52. package/v1/capiDateTime.js +70 -0
  53. package/v1/cartoonElementFields.d.ts +22 -0
  54. package/v1/cartoonElementFields.js +190 -0
  55. package/v1/cartoonImage.d.ts +17 -0
  56. package/v1/cartoonImage.js +115 -0
  57. package/v1/cartoonVariant.d.ts +15 -0
  58. package/v1/cartoonVariant.js +85 -0
  59. package/v1/channelFields.d.ts +15 -0
  60. package/v1/channelFields.js +71 -0
  61. package/v1/codeElementFields.d.ts +14 -0
  62. package/v1/codeElementFields.js +70 -0
  63. package/v1/commentElementFields.d.ts +24 -0
  64. package/v1/commentElementFields.js +220 -0
  65. package/v1/content.d.ts +53 -0
  66. package/v1/content.js +516 -0
  67. package/v1/contentAtomElementFields.d.ts +16 -0
  68. package/v1/contentAtomElementFields.js +100 -0
  69. package/v1/contentChannel.d.ts +15 -0
  70. package/v1/contentChannel.js +71 -0
  71. package/v1/contentFields.d.ts +67 -0
  72. package/v1/contentFields.js +821 -0
  73. package/v1/contentStats.d.ts +27 -0
  74. package/v1/contentStats.js +265 -0
  75. package/v1/contentType.d.ts +15 -0
  76. package/v1/contentType.js +19 -0
  77. package/v1/crossword.d.ts +31 -0
  78. package/v1/crossword.js +268 -0
  79. package/v1/crosswordCreator.d.ts +14 -0
  80. package/v1/crosswordCreator.js +70 -0
  81. package/v1/crosswordDimensions.d.ts +14 -0
  82. package/v1/crosswordDimensions.js +70 -0
  83. package/v1/crosswordEntry.d.ts +26 -0
  84. package/v1/crosswordEntry.js +249 -0
  85. package/v1/crosswordPosition.d.ts +14 -0
  86. package/v1/crosswordPosition.js +70 -0
  87. package/v1/crosswordType.d.ts +15 -0
  88. package/v1/crosswordType.js +19 -0
  89. package/v1/debug.d.ts +18 -0
  90. package/v1/debug.js +101 -0
  91. package/v1/edition.d.ts +17 -0
  92. package/v1/edition.js +115 -0
  93. package/v1/editionsResponse.d.ts +17 -0
  94. package/v1/editionsResponse.js +115 -0
  95. package/v1/element.d.ts +19 -0
  96. package/v1/element.js +130 -0
  97. package/v1/elementType.d.ts +30 -0
  98. package/v1/elementType.js +34 -0
  99. package/v1/embedElementFields.d.ts +20 -0
  100. package/v1/embedElementFields.js +160 -0
  101. package/v1/embedReach.d.ts +14 -0
  102. package/v1/embedReach.js +69 -0
  103. package/v1/embedTracking.d.ts +14 -0
  104. package/v1/embedTracking.js +58 -0
  105. package/v1/embedTracksType.d.ts +10 -0
  106. package/v1/embedTracksType.js +14 -0
  107. package/v1/entitiesResponse.d.ts +16 -0
  108. package/v1/entitiesResponse.js +100 -0
  109. package/v1/errorResponse.d.ts +14 -0
  110. package/v1/errorResponse.js +70 -0
  111. package/v1/imageElementFields.d.ts +26 -0
  112. package/v1/imageElementFields.js +250 -0
  113. package/v1/instagramElementFields.d.ts +23 -0
  114. package/v1/instagramElementFields.js +205 -0
  115. package/v1/interactiveElementFields.d.ts +24 -0
  116. package/v1/interactiveElementFields.js +220 -0
  117. package/v1/itemResponse.d.ts +53 -0
  118. package/v1/itemResponse.js +676 -0
  119. package/v1/membershipElementFields.d.ts +25 -0
  120. package/v1/membershipElementFields.js +221 -0
  121. package/v1/membershipPlaceholder.d.ts +13 -0
  122. package/v1/membershipPlaceholder.js +55 -0
  123. package/v1/membershipTier.d.ts +9 -0
  124. package/v1/membershipTier.js +13 -0
  125. package/v1/mostViewedVideo.d.ts +14 -0
  126. package/v1/mostViewedVideo.js +70 -0
  127. package/v1/networkFront.d.ts +18 -0
  128. package/v1/networkFront.js +130 -0
  129. package/v1/office.d.ts +10 -0
  130. package/v1/office.js +14 -0
  131. package/v1/package.d.ts +18 -0
  132. package/v1/package.js +116 -0
  133. package/v1/packageArticle.d.ts +16 -0
  134. package/v1/packageArticle.js +72 -0
  135. package/v1/packagesResponse.d.ts +22 -0
  136. package/v1/packagesResponse.js +190 -0
  137. package/v1/pillar.d.ts +15 -0
  138. package/v1/pillar.js +99 -0
  139. package/v1/pillarsResponse.d.ts +16 -0
  140. package/v1/pillarsResponse.js +100 -0
  141. package/v1/platformType.d.ts +10 -0
  142. package/v1/platformType.js +14 -0
  143. package/v1/podcast.d.ts +25 -0
  144. package/v1/podcast.js +235 -0
  145. package/v1/podcastCategory.d.ts +14 -0
  146. package/v1/podcastCategory.js +70 -0
  147. package/v1/pullquoteElementFields.d.ts +17 -0
  148. package/v1/pullquoteElementFields.js +115 -0
  149. package/v1/recipeElementFields.d.ts +13 -0
  150. package/v1/recipeElementFields.js +55 -0
  151. package/v1/reference.d.ts +14 -0
  152. package/v1/reference.js +70 -0
  153. package/v1/richLinkElementFields.d.ts +19 -0
  154. package/v1/richLinkElementFields.js +131 -0
  155. package/v1/rights.d.ts +15 -0
  156. package/v1/rights.js +89 -0
  157. package/v1/searchResponse.d.ts +22 -0
  158. package/v1/searchResponse.js +190 -0
  159. package/v1/section.d.ts +20 -0
  160. package/v1/section.js +159 -0
  161. package/v1/sectionsResponse.d.ts +17 -0
  162. package/v1/sectionsResponse.js +115 -0
  163. package/v1/sponsorship.d.ts +27 -0
  164. package/v1/sponsorship.js +208 -0
  165. package/v1/sponsorshipLogoDimensions.d.ts +14 -0
  166. package/v1/sponsorshipLogoDimensions.js +70 -0
  167. package/v1/sponsorshipTargeting.d.ts +15 -0
  168. package/v1/sponsorshipTargeting.js +85 -0
  169. package/v1/sponsorshipType.d.ts +10 -0
  170. package/v1/sponsorshipType.js +14 -0
  171. package/v1/standardElementFields.d.ts +25 -0
  172. package/v1/standardElementFields.js +235 -0
  173. package/v1/tag.d.ts +42 -0
  174. package/v1/tag.js +486 -0
  175. package/v1/tagType.d.ts +19 -0
  176. package/v1/tagType.js +23 -0
  177. package/v1/tagsResponse.d.ts +21 -0
  178. package/v1/tagsResponse.js +175 -0
  179. package/v1/textElementFields.d.ts +14 -0
  180. package/v1/textElementFields.js +70 -0
  181. package/v1/tweetElementFields.d.ts +20 -0
  182. package/v1/tweetElementFields.js +160 -0
  183. package/v1/user.d.ts +15 -0
  184. package/v1/user.js +85 -0
  185. package/v1/videoElementFields.d.ts +33 -0
  186. package/v1/videoElementFields.js +355 -0
  187. package/v1/videoStatsResponse.d.ts +15 -0
  188. package/v1/videoStatsResponse.js +85 -0
  189. package/v1/vineElementFields.d.ts +24 -0
  190. package/v1/vineElementFields.js +220 -0
  191. package/v1/witnessElementFields.d.ts +40 -0
  192. package/v1/witnessElementFields.js +446 -0
package/v1/atoms.js ADDED
@@ -0,0 +1,490 @@
1
+ "use strict";
2
+ /**
3
+ * Autogenerated by scrooge-generator-extras
4
+ *
5
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.AtomsSerde = void 0;
9
+ var thrift_1 = require("thrift");
10
+ var atom_1 = require("@guardian/content-atom-model/atom");
11
+ var AtomsSerde = /** @class */ (function () {
12
+ function AtomsSerde() {
13
+ }
14
+ AtomsSerde.read = function (protocol) {
15
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
16
+ protocol.readStructBegin();
17
+ var result = {};
18
+ while (true) {
19
+ var ret = protocol.readFieldBegin();
20
+ var ftype = ret.ftype;
21
+ var fid = ret.fid;
22
+ if (ftype === thrift_1.Thrift.Type.STOP) {
23
+ break;
24
+ }
25
+ switch (fid) {
26
+ case 1:
27
+ if (ftype === thrift_1.Thrift.Type.LIST) {
28
+ var listInfo1 = protocol.readListBegin();
29
+ var listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
30
+ var value1 = [];
31
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
32
+ for (var i = 0; i < listSize1; i++) {
33
+ var value2 = atom_1.AtomSerde.read(protocol);
34
+ value1.push(value2);
35
+ }
36
+ }
37
+ protocol.readListEnd();
38
+ result.quizzes = value1;
39
+ }
40
+ else {
41
+ protocol.skip(ftype);
42
+ }
43
+ break;
44
+ case 2:
45
+ if (ftype === thrift_1.Thrift.Type.LIST) {
46
+ var listInfo1 = protocol.readListBegin();
47
+ var listSize1 = (_b = listInfo1.size) !== null && _b !== void 0 ? _b : 0;
48
+ var value1 = [];
49
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
50
+ for (var i = 0; i < listSize1; i++) {
51
+ var value2 = atom_1.AtomSerde.read(protocol);
52
+ value1.push(value2);
53
+ }
54
+ }
55
+ protocol.readListEnd();
56
+ result.viewpoints = value1;
57
+ }
58
+ else {
59
+ protocol.skip(ftype);
60
+ }
61
+ break;
62
+ case 3:
63
+ if (ftype === thrift_1.Thrift.Type.LIST) {
64
+ var listInfo1 = protocol.readListBegin();
65
+ var listSize1 = (_c = listInfo1.size) !== null && _c !== void 0 ? _c : 0;
66
+ var value1 = [];
67
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
68
+ for (var i = 0; i < listSize1; i++) {
69
+ var value2 = atom_1.AtomSerde.read(protocol);
70
+ value1.push(value2);
71
+ }
72
+ }
73
+ protocol.readListEnd();
74
+ result.media = value1;
75
+ }
76
+ else {
77
+ protocol.skip(ftype);
78
+ }
79
+ break;
80
+ case 4:
81
+ if (ftype === thrift_1.Thrift.Type.LIST) {
82
+ var listInfo1 = protocol.readListBegin();
83
+ var listSize1 = (_d = listInfo1.size) !== null && _d !== void 0 ? _d : 0;
84
+ var value1 = [];
85
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
86
+ for (var i = 0; i < listSize1; i++) {
87
+ var value2 = atom_1.AtomSerde.read(protocol);
88
+ value1.push(value2);
89
+ }
90
+ }
91
+ protocol.readListEnd();
92
+ result.explainers = value1;
93
+ }
94
+ else {
95
+ protocol.skip(ftype);
96
+ }
97
+ break;
98
+ case 5:
99
+ if (ftype === thrift_1.Thrift.Type.LIST) {
100
+ var listInfo1 = protocol.readListBegin();
101
+ var listSize1 = (_e = listInfo1.size) !== null && _e !== void 0 ? _e : 0;
102
+ var value1 = [];
103
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
104
+ for (var i = 0; i < listSize1; i++) {
105
+ var value2 = atom_1.AtomSerde.read(protocol);
106
+ value1.push(value2);
107
+ }
108
+ }
109
+ protocol.readListEnd();
110
+ result.cta = value1;
111
+ }
112
+ else {
113
+ protocol.skip(ftype);
114
+ }
115
+ break;
116
+ case 6:
117
+ if (ftype === thrift_1.Thrift.Type.LIST) {
118
+ var listInfo1 = protocol.readListBegin();
119
+ var listSize1 = (_f = listInfo1.size) !== null && _f !== void 0 ? _f : 0;
120
+ var value1 = [];
121
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
122
+ for (var i = 0; i < listSize1; i++) {
123
+ var value2 = atom_1.AtomSerde.read(protocol);
124
+ value1.push(value2);
125
+ }
126
+ }
127
+ protocol.readListEnd();
128
+ result.interactives = value1;
129
+ }
130
+ else {
131
+ protocol.skip(ftype);
132
+ }
133
+ break;
134
+ case 7:
135
+ if (ftype === thrift_1.Thrift.Type.LIST) {
136
+ var listInfo1 = protocol.readListBegin();
137
+ var listSize1 = (_g = listInfo1.size) !== null && _g !== void 0 ? _g : 0;
138
+ var value1 = [];
139
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
140
+ for (var i = 0; i < listSize1; i++) {
141
+ var value2 = atom_1.AtomSerde.read(protocol);
142
+ value1.push(value2);
143
+ }
144
+ }
145
+ protocol.readListEnd();
146
+ result.reviews = value1;
147
+ }
148
+ else {
149
+ protocol.skip(ftype);
150
+ }
151
+ break;
152
+ case 8:
153
+ if (ftype === thrift_1.Thrift.Type.LIST) {
154
+ var listInfo1 = protocol.readListBegin();
155
+ var listSize1 = (_h = listInfo1.size) !== null && _h !== void 0 ? _h : 0;
156
+ var value1 = [];
157
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
158
+ for (var i = 0; i < listSize1; i++) {
159
+ var value2 = atom_1.AtomSerde.read(protocol);
160
+ value1.push(value2);
161
+ }
162
+ }
163
+ protocol.readListEnd();
164
+ result.recipes = value1;
165
+ }
166
+ else {
167
+ protocol.skip(ftype);
168
+ }
169
+ break;
170
+ case 10:
171
+ if (ftype === thrift_1.Thrift.Type.LIST) {
172
+ var listInfo1 = protocol.readListBegin();
173
+ var listSize1 = (_j = listInfo1.size) !== null && _j !== void 0 ? _j : 0;
174
+ var value1 = [];
175
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
176
+ for (var i = 0; i < listSize1; i++) {
177
+ var value2 = atom_1.AtomSerde.read(protocol);
178
+ value1.push(value2);
179
+ }
180
+ }
181
+ protocol.readListEnd();
182
+ result.qandas = value1;
183
+ }
184
+ else {
185
+ protocol.skip(ftype);
186
+ }
187
+ break;
188
+ case 11:
189
+ if (ftype === thrift_1.Thrift.Type.LIST) {
190
+ var listInfo1 = protocol.readListBegin();
191
+ var listSize1 = (_k = listInfo1.size) !== null && _k !== void 0 ? _k : 0;
192
+ var value1 = [];
193
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
194
+ for (var i = 0; i < listSize1; i++) {
195
+ var value2 = atom_1.AtomSerde.read(protocol);
196
+ value1.push(value2);
197
+ }
198
+ }
199
+ protocol.readListEnd();
200
+ result.guides = value1;
201
+ }
202
+ else {
203
+ protocol.skip(ftype);
204
+ }
205
+ break;
206
+ case 12:
207
+ if (ftype === thrift_1.Thrift.Type.LIST) {
208
+ var listInfo1 = protocol.readListBegin();
209
+ var listSize1 = (_l = listInfo1.size) !== null && _l !== void 0 ? _l : 0;
210
+ var value1 = [];
211
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
212
+ for (var i = 0; i < listSize1; i++) {
213
+ var value2 = atom_1.AtomSerde.read(protocol);
214
+ value1.push(value2);
215
+ }
216
+ }
217
+ protocol.readListEnd();
218
+ result.profiles = value1;
219
+ }
220
+ else {
221
+ protocol.skip(ftype);
222
+ }
223
+ break;
224
+ case 13:
225
+ if (ftype === thrift_1.Thrift.Type.LIST) {
226
+ var listInfo1 = protocol.readListBegin();
227
+ var listSize1 = (_m = listInfo1.size) !== null && _m !== void 0 ? _m : 0;
228
+ var value1 = [];
229
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
230
+ for (var i = 0; i < listSize1; i++) {
231
+ var value2 = atom_1.AtomSerde.read(protocol);
232
+ value1.push(value2);
233
+ }
234
+ }
235
+ protocol.readListEnd();
236
+ result.timelines = value1;
237
+ }
238
+ else {
239
+ protocol.skip(ftype);
240
+ }
241
+ break;
242
+ case 14:
243
+ if (ftype === thrift_1.Thrift.Type.LIST) {
244
+ var listInfo1 = protocol.readListBegin();
245
+ var listSize1 = (_o = listInfo1.size) !== null && _o !== void 0 ? _o : 0;
246
+ var value1 = [];
247
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
248
+ for (var i = 0; i < listSize1; i++) {
249
+ var value2 = atom_1.AtomSerde.read(protocol);
250
+ value1.push(value2);
251
+ }
252
+ }
253
+ protocol.readListEnd();
254
+ result.commonsdivisions = value1;
255
+ }
256
+ else {
257
+ protocol.skip(ftype);
258
+ }
259
+ break;
260
+ case 15:
261
+ if (ftype === thrift_1.Thrift.Type.LIST) {
262
+ var listInfo1 = protocol.readListBegin();
263
+ var listSize1 = (_p = listInfo1.size) !== null && _p !== void 0 ? _p : 0;
264
+ var value1 = [];
265
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
266
+ for (var i = 0; i < listSize1; i++) {
267
+ var value2 = atom_1.AtomSerde.read(protocol);
268
+ value1.push(value2);
269
+ }
270
+ }
271
+ protocol.readListEnd();
272
+ result.charts = value1;
273
+ }
274
+ else {
275
+ protocol.skip(ftype);
276
+ }
277
+ break;
278
+ case 16:
279
+ if (ftype === thrift_1.Thrift.Type.LIST) {
280
+ var listInfo1 = protocol.readListBegin();
281
+ var listSize1 = (_q = listInfo1.size) !== null && _q !== void 0 ? _q : 0;
282
+ var value1 = [];
283
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
284
+ for (var i = 0; i < listSize1; i++) {
285
+ var value2 = atom_1.AtomSerde.read(protocol);
286
+ value1.push(value2);
287
+ }
288
+ }
289
+ protocol.readListEnd();
290
+ result.audios = value1;
291
+ }
292
+ else {
293
+ protocol.skip(ftype);
294
+ }
295
+ break;
296
+ case 17:
297
+ if (ftype === thrift_1.Thrift.Type.LIST) {
298
+ var listInfo1 = protocol.readListBegin();
299
+ var listSize1 = (_r = listInfo1.size) !== null && _r !== void 0 ? _r : 0;
300
+ var value1 = [];
301
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
302
+ for (var i = 0; i < listSize1; i++) {
303
+ var value2 = atom_1.AtomSerde.read(protocol);
304
+ value1.push(value2);
305
+ }
306
+ }
307
+ protocol.readListEnd();
308
+ result.emailsignups = value1;
309
+ }
310
+ else {
311
+ protocol.skip(ftype);
312
+ }
313
+ break;
314
+ default:
315
+ protocol.skip(ftype);
316
+ }
317
+ protocol.readFieldEnd();
318
+ }
319
+ protocol.readStructEnd();
320
+ // @ts-ignore
321
+ return result;
322
+ };
323
+ AtomsSerde.write = function (protocol, value0) {
324
+ protocol.writeStructBegin('Atoms');
325
+ if (value0.quizzes !== null && value0.quizzes !== undefined) {
326
+ var value1 = value0.quizzes;
327
+ protocol.writeFieldBegin('quizzes', thrift_1.Thrift.Type.LIST, 1);
328
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
329
+ value1.forEach(function (value2) {
330
+ atom_1.AtomSerde.write(protocol, value2);
331
+ });
332
+ protocol.writeListEnd();
333
+ protocol.writeFieldEnd();
334
+ }
335
+ if (value0.viewpoints !== null && value0.viewpoints !== undefined) {
336
+ var value1 = value0.viewpoints;
337
+ protocol.writeFieldBegin('viewpoints', thrift_1.Thrift.Type.LIST, 2);
338
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
339
+ value1.forEach(function (value2) {
340
+ atom_1.AtomSerde.write(protocol, value2);
341
+ });
342
+ protocol.writeListEnd();
343
+ protocol.writeFieldEnd();
344
+ }
345
+ if (value0.media !== null && value0.media !== undefined) {
346
+ var value1 = value0.media;
347
+ protocol.writeFieldBegin('media', thrift_1.Thrift.Type.LIST, 3);
348
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
349
+ value1.forEach(function (value2) {
350
+ atom_1.AtomSerde.write(protocol, value2);
351
+ });
352
+ protocol.writeListEnd();
353
+ protocol.writeFieldEnd();
354
+ }
355
+ if (value0.explainers !== null && value0.explainers !== undefined) {
356
+ var value1 = value0.explainers;
357
+ protocol.writeFieldBegin('explainers', thrift_1.Thrift.Type.LIST, 4);
358
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
359
+ value1.forEach(function (value2) {
360
+ atom_1.AtomSerde.write(protocol, value2);
361
+ });
362
+ protocol.writeListEnd();
363
+ protocol.writeFieldEnd();
364
+ }
365
+ if (value0.cta !== null && value0.cta !== undefined) {
366
+ var value1 = value0.cta;
367
+ protocol.writeFieldBegin('cta', thrift_1.Thrift.Type.LIST, 5);
368
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
369
+ value1.forEach(function (value2) {
370
+ atom_1.AtomSerde.write(protocol, value2);
371
+ });
372
+ protocol.writeListEnd();
373
+ protocol.writeFieldEnd();
374
+ }
375
+ if (value0.interactives !== null && value0.interactives !== undefined) {
376
+ var value1 = value0.interactives;
377
+ protocol.writeFieldBegin('interactives', thrift_1.Thrift.Type.LIST, 6);
378
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
379
+ value1.forEach(function (value2) {
380
+ atom_1.AtomSerde.write(protocol, value2);
381
+ });
382
+ protocol.writeListEnd();
383
+ protocol.writeFieldEnd();
384
+ }
385
+ if (value0.reviews !== null && value0.reviews !== undefined) {
386
+ var value1 = value0.reviews;
387
+ protocol.writeFieldBegin('reviews', thrift_1.Thrift.Type.LIST, 7);
388
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
389
+ value1.forEach(function (value2) {
390
+ atom_1.AtomSerde.write(protocol, value2);
391
+ });
392
+ protocol.writeListEnd();
393
+ protocol.writeFieldEnd();
394
+ }
395
+ if (value0.recipes !== null && value0.recipes !== undefined) {
396
+ var value1 = value0.recipes;
397
+ protocol.writeFieldBegin('recipes', thrift_1.Thrift.Type.LIST, 8);
398
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
399
+ value1.forEach(function (value2) {
400
+ atom_1.AtomSerde.write(protocol, value2);
401
+ });
402
+ protocol.writeListEnd();
403
+ protocol.writeFieldEnd();
404
+ }
405
+ if (value0.qandas !== null && value0.qandas !== undefined) {
406
+ var value1 = value0.qandas;
407
+ protocol.writeFieldBegin('qandas', thrift_1.Thrift.Type.LIST, 10);
408
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
409
+ value1.forEach(function (value2) {
410
+ atom_1.AtomSerde.write(protocol, value2);
411
+ });
412
+ protocol.writeListEnd();
413
+ protocol.writeFieldEnd();
414
+ }
415
+ if (value0.guides !== null && value0.guides !== undefined) {
416
+ var value1 = value0.guides;
417
+ protocol.writeFieldBegin('guides', thrift_1.Thrift.Type.LIST, 11);
418
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
419
+ value1.forEach(function (value2) {
420
+ atom_1.AtomSerde.write(protocol, value2);
421
+ });
422
+ protocol.writeListEnd();
423
+ protocol.writeFieldEnd();
424
+ }
425
+ if (value0.profiles !== null && value0.profiles !== undefined) {
426
+ var value1 = value0.profiles;
427
+ protocol.writeFieldBegin('profiles', thrift_1.Thrift.Type.LIST, 12);
428
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
429
+ value1.forEach(function (value2) {
430
+ atom_1.AtomSerde.write(protocol, value2);
431
+ });
432
+ protocol.writeListEnd();
433
+ protocol.writeFieldEnd();
434
+ }
435
+ if (value0.timelines !== null && value0.timelines !== undefined) {
436
+ var value1 = value0.timelines;
437
+ protocol.writeFieldBegin('timelines', thrift_1.Thrift.Type.LIST, 13);
438
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
439
+ value1.forEach(function (value2) {
440
+ atom_1.AtomSerde.write(protocol, value2);
441
+ });
442
+ protocol.writeListEnd();
443
+ protocol.writeFieldEnd();
444
+ }
445
+ if (value0.commonsdivisions !== null && value0.commonsdivisions !== undefined) {
446
+ var value1 = value0.commonsdivisions;
447
+ protocol.writeFieldBegin('commonsdivisions', thrift_1.Thrift.Type.LIST, 14);
448
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
449
+ value1.forEach(function (value2) {
450
+ atom_1.AtomSerde.write(protocol, value2);
451
+ });
452
+ protocol.writeListEnd();
453
+ protocol.writeFieldEnd();
454
+ }
455
+ if (value0.charts !== null && value0.charts !== undefined) {
456
+ var value1 = value0.charts;
457
+ protocol.writeFieldBegin('charts', thrift_1.Thrift.Type.LIST, 15);
458
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
459
+ value1.forEach(function (value2) {
460
+ atom_1.AtomSerde.write(protocol, value2);
461
+ });
462
+ protocol.writeListEnd();
463
+ protocol.writeFieldEnd();
464
+ }
465
+ if (value0.audios !== null && value0.audios !== undefined) {
466
+ var value1 = value0.audios;
467
+ protocol.writeFieldBegin('audios', thrift_1.Thrift.Type.LIST, 16);
468
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
469
+ value1.forEach(function (value2) {
470
+ atom_1.AtomSerde.write(protocol, value2);
471
+ });
472
+ protocol.writeListEnd();
473
+ protocol.writeFieldEnd();
474
+ }
475
+ if (value0.emailsignups !== null && value0.emailsignups !== undefined) {
476
+ var value1 = value0.emailsignups;
477
+ protocol.writeFieldBegin('emailsignups', thrift_1.Thrift.Type.LIST, 17);
478
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
479
+ value1.forEach(function (value2) {
480
+ atom_1.AtomSerde.write(protocol, value2);
481
+ });
482
+ protocol.writeListEnd();
483
+ protocol.writeFieldEnd();
484
+ }
485
+ protocol.writeFieldStop();
486
+ protocol.writeStructEnd();
487
+ };
488
+ return AtomsSerde;
489
+ }());
490
+ exports.AtomsSerde = AtomsSerde;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Autogenerated by scrooge-generator-extras
3
+ *
4
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ */
6
+ import { TProtocol } from 'thrift';
7
+ import { Atom } from '@guardian/content-atom-model/atom';
8
+ export interface AtomsResponse {
9
+ status: string;
10
+ userTier: string;
11
+ total: number;
12
+ startIndex: number;
13
+ pageSize: number;
14
+ currentPage: number;
15
+ pages: number;
16
+ results: Atom[];
17
+ }
18
+ export declare class AtomsResponseSerde {
19
+ static read(protocol: TProtocol): AtomsResponse;
20
+ static write(protocol: TProtocol, value0: AtomsResponse): void;
21
+ }
@@ -0,0 +1,175 @@
1
+ "use strict";
2
+ /**
3
+ * Autogenerated by scrooge-generator-extras
4
+ *
5
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.AtomsResponseSerde = void 0;
9
+ var thrift_1 = require("thrift");
10
+ var atom_1 = require("@guardian/content-atom-model/atom");
11
+ var AtomsResponseSerde = /** @class */ (function () {
12
+ function AtomsResponseSerde() {
13
+ }
14
+ AtomsResponseSerde.read = function (protocol) {
15
+ var _a;
16
+ protocol.readStructBegin();
17
+ var result = {};
18
+ while (true) {
19
+ var ret = protocol.readFieldBegin();
20
+ var ftype = ret.ftype;
21
+ var fid = ret.fid;
22
+ if (ftype === thrift_1.Thrift.Type.STOP) {
23
+ break;
24
+ }
25
+ switch (fid) {
26
+ case 1:
27
+ if (ftype === thrift_1.Thrift.Type.STRING) {
28
+ var value1 = protocol.readString();
29
+ result.status = value1;
30
+ }
31
+ else {
32
+ protocol.skip(ftype);
33
+ }
34
+ break;
35
+ case 2:
36
+ if (ftype === thrift_1.Thrift.Type.STRING) {
37
+ var value1 = protocol.readString();
38
+ result.userTier = value1;
39
+ }
40
+ else {
41
+ protocol.skip(ftype);
42
+ }
43
+ break;
44
+ case 3:
45
+ if (ftype === thrift_1.Thrift.Type.I32) {
46
+ var value1 = protocol.readI32();
47
+ result.total = value1;
48
+ }
49
+ else {
50
+ protocol.skip(ftype);
51
+ }
52
+ break;
53
+ case 4:
54
+ if (ftype === thrift_1.Thrift.Type.I32) {
55
+ var value1 = protocol.readI32();
56
+ result.startIndex = value1;
57
+ }
58
+ else {
59
+ protocol.skip(ftype);
60
+ }
61
+ break;
62
+ case 5:
63
+ if (ftype === thrift_1.Thrift.Type.I32) {
64
+ var value1 = protocol.readI32();
65
+ result.pageSize = value1;
66
+ }
67
+ else {
68
+ protocol.skip(ftype);
69
+ }
70
+ break;
71
+ case 6:
72
+ if (ftype === thrift_1.Thrift.Type.I32) {
73
+ var value1 = protocol.readI32();
74
+ result.currentPage = value1;
75
+ }
76
+ else {
77
+ protocol.skip(ftype);
78
+ }
79
+ break;
80
+ case 7:
81
+ if (ftype === thrift_1.Thrift.Type.I32) {
82
+ var value1 = protocol.readI32();
83
+ result.pages = value1;
84
+ }
85
+ else {
86
+ protocol.skip(ftype);
87
+ }
88
+ break;
89
+ case 8:
90
+ if (ftype === thrift_1.Thrift.Type.LIST) {
91
+ var listInfo1 = protocol.readListBegin();
92
+ var listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
93
+ var value1 = [];
94
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
95
+ for (var i = 0; i < listSize1; i++) {
96
+ var value2 = atom_1.AtomSerde.read(protocol);
97
+ value1.push(value2);
98
+ }
99
+ }
100
+ protocol.readListEnd();
101
+ result.results = value1;
102
+ }
103
+ else {
104
+ protocol.skip(ftype);
105
+ }
106
+ break;
107
+ default:
108
+ protocol.skip(ftype);
109
+ }
110
+ protocol.readFieldEnd();
111
+ }
112
+ protocol.readStructEnd();
113
+ // @ts-ignore
114
+ return result;
115
+ };
116
+ AtomsResponseSerde.write = function (protocol, value0) {
117
+ protocol.writeStructBegin('AtomsResponse');
118
+ if (value0.status !== null && value0.status !== undefined) {
119
+ var value1 = value0.status;
120
+ protocol.writeFieldBegin('status', thrift_1.Thrift.Type.STRING, 1);
121
+ protocol.writeString(value1);
122
+ protocol.writeFieldEnd();
123
+ }
124
+ if (value0.userTier !== null && value0.userTier !== undefined) {
125
+ var value1 = value0.userTier;
126
+ protocol.writeFieldBegin('userTier', thrift_1.Thrift.Type.STRING, 2);
127
+ protocol.writeString(value1);
128
+ protocol.writeFieldEnd();
129
+ }
130
+ if (value0.total !== null && value0.total !== undefined) {
131
+ var value1 = value0.total;
132
+ protocol.writeFieldBegin('total', thrift_1.Thrift.Type.I32, 3);
133
+ protocol.writeI32(value1);
134
+ protocol.writeFieldEnd();
135
+ }
136
+ if (value0.startIndex !== null && value0.startIndex !== undefined) {
137
+ var value1 = value0.startIndex;
138
+ protocol.writeFieldBegin('startIndex', thrift_1.Thrift.Type.I32, 4);
139
+ protocol.writeI32(value1);
140
+ protocol.writeFieldEnd();
141
+ }
142
+ if (value0.pageSize !== null && value0.pageSize !== undefined) {
143
+ var value1 = value0.pageSize;
144
+ protocol.writeFieldBegin('pageSize', thrift_1.Thrift.Type.I32, 5);
145
+ protocol.writeI32(value1);
146
+ protocol.writeFieldEnd();
147
+ }
148
+ if (value0.currentPage !== null && value0.currentPage !== undefined) {
149
+ var value1 = value0.currentPage;
150
+ protocol.writeFieldBegin('currentPage', thrift_1.Thrift.Type.I32, 6);
151
+ protocol.writeI32(value1);
152
+ protocol.writeFieldEnd();
153
+ }
154
+ if (value0.pages !== null && value0.pages !== undefined) {
155
+ var value1 = value0.pages;
156
+ protocol.writeFieldBegin('pages', thrift_1.Thrift.Type.I32, 7);
157
+ protocol.writeI32(value1);
158
+ protocol.writeFieldEnd();
159
+ }
160
+ if (value0.results !== null && value0.results !== undefined) {
161
+ var value1 = value0.results;
162
+ protocol.writeFieldBegin('results', thrift_1.Thrift.Type.LIST, 8);
163
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
164
+ value1.forEach(function (value2) {
165
+ atom_1.AtomSerde.write(protocol, value2);
166
+ });
167
+ protocol.writeListEnd();
168
+ protocol.writeFieldEnd();
169
+ }
170
+ protocol.writeFieldStop();
171
+ protocol.writeStructEnd();
172
+ };
173
+ return AtomsResponseSerde;
174
+ }());
175
+ exports.AtomsResponseSerde = AtomsResponseSerde;