@guardian/content-api-models 4.0.1-SNAPSHOT

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 +14 -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/content.js ADDED
@@ -0,0 +1,516 @@
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.ContentSerde = void 0;
9
+ var thrift_1 = require("thrift");
10
+ var aliasPath_1 = require("./aliasPath");
11
+ var atoms_1 = require("./atoms");
12
+ var blocks_1 = require("./blocks");
13
+ var capiDateTime_1 = require("./capiDateTime");
14
+ var contentChannel_1 = require("./contentChannel");
15
+ var contentFields_1 = require("./contentFields");
16
+ var contentStats_1 = require("./contentStats");
17
+ var contentType_1 = require("./contentType");
18
+ var crossword_1 = require("./crossword");
19
+ var debug_1 = require("./debug");
20
+ var element_1 = require("./element");
21
+ var reference_1 = require("./reference");
22
+ var rights_1 = require("./rights");
23
+ var section_1 = require("./section");
24
+ var tag_1 = require("./tag");
25
+ var ContentSerde = /** @class */ (function () {
26
+ function ContentSerde() {
27
+ }
28
+ ContentSerde.read = function (protocol) {
29
+ var _a, _b, _c, _d, _e;
30
+ protocol.readStructBegin();
31
+ var result = {
32
+ type: contentType_1.ContentType.ARTICLE,
33
+ tags: [],
34
+ references: [],
35
+ isHosted: false,
36
+ };
37
+ while (true) {
38
+ var ret = protocol.readFieldBegin();
39
+ var ftype = ret.ftype;
40
+ var fid = ret.fid;
41
+ if (ftype === thrift_1.Thrift.Type.STOP) {
42
+ break;
43
+ }
44
+ switch (fid) {
45
+ case 1:
46
+ if (ftype === thrift_1.Thrift.Type.STRING) {
47
+ var value1 = protocol.readString();
48
+ result.id = value1;
49
+ }
50
+ else {
51
+ protocol.skip(ftype);
52
+ }
53
+ break;
54
+ case 2:
55
+ if (ftype === thrift_1.Thrift.Type.I32) {
56
+ var value1 = protocol.readI32();
57
+ result.type = value1;
58
+ }
59
+ else {
60
+ protocol.skip(ftype);
61
+ }
62
+ break;
63
+ case 3:
64
+ if (ftype === thrift_1.Thrift.Type.STRING) {
65
+ var value1 = protocol.readString();
66
+ result.sectionId = value1;
67
+ }
68
+ else {
69
+ protocol.skip(ftype);
70
+ }
71
+ break;
72
+ case 4:
73
+ if (ftype === thrift_1.Thrift.Type.STRING) {
74
+ var value1 = protocol.readString();
75
+ result.sectionName = value1;
76
+ }
77
+ else {
78
+ protocol.skip(ftype);
79
+ }
80
+ break;
81
+ case 5:
82
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
83
+ var value1 = capiDateTime_1.CapiDateTimeSerde.read(protocol);
84
+ result.webPublicationDate = value1;
85
+ }
86
+ else {
87
+ protocol.skip(ftype);
88
+ }
89
+ break;
90
+ case 6:
91
+ if (ftype === thrift_1.Thrift.Type.STRING) {
92
+ var value1 = protocol.readString();
93
+ result.webTitle = value1;
94
+ }
95
+ else {
96
+ protocol.skip(ftype);
97
+ }
98
+ break;
99
+ case 7:
100
+ if (ftype === thrift_1.Thrift.Type.STRING) {
101
+ var value1 = protocol.readString();
102
+ result.webUrl = value1;
103
+ }
104
+ else {
105
+ protocol.skip(ftype);
106
+ }
107
+ break;
108
+ case 8:
109
+ if (ftype === thrift_1.Thrift.Type.STRING) {
110
+ var value1 = protocol.readString();
111
+ result.apiUrl = value1;
112
+ }
113
+ else {
114
+ protocol.skip(ftype);
115
+ }
116
+ break;
117
+ case 9:
118
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
119
+ var value1 = contentFields_1.ContentFieldsSerde.read(protocol);
120
+ result.fields = value1;
121
+ }
122
+ else {
123
+ protocol.skip(ftype);
124
+ }
125
+ break;
126
+ case 10:
127
+ if (ftype === thrift_1.Thrift.Type.LIST) {
128
+ var listInfo1 = protocol.readListBegin();
129
+ var listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
130
+ var value1 = [];
131
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
132
+ for (var i = 0; i < listSize1; i++) {
133
+ var value2 = tag_1.TagSerde.read(protocol);
134
+ value1.push(value2);
135
+ }
136
+ }
137
+ protocol.readListEnd();
138
+ result.tags = value1;
139
+ }
140
+ else {
141
+ protocol.skip(ftype);
142
+ }
143
+ break;
144
+ case 11:
145
+ if (ftype === thrift_1.Thrift.Type.LIST) {
146
+ var listInfo1 = protocol.readListBegin();
147
+ var listSize1 = (_b = listInfo1.size) !== null && _b !== void 0 ? _b : 0;
148
+ var value1 = [];
149
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
150
+ for (var i = 0; i < listSize1; i++) {
151
+ var value2 = element_1.ElementSerde.read(protocol);
152
+ value1.push(value2);
153
+ }
154
+ }
155
+ protocol.readListEnd();
156
+ result.elements = value1;
157
+ }
158
+ else {
159
+ protocol.skip(ftype);
160
+ }
161
+ break;
162
+ case 12:
163
+ if (ftype === thrift_1.Thrift.Type.LIST) {
164
+ var listInfo1 = protocol.readListBegin();
165
+ var listSize1 = (_c = listInfo1.size) !== null && _c !== void 0 ? _c : 0;
166
+ var value1 = [];
167
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
168
+ for (var i = 0; i < listSize1; i++) {
169
+ var value2 = reference_1.ReferenceSerde.read(protocol);
170
+ value1.push(value2);
171
+ }
172
+ }
173
+ protocol.readListEnd();
174
+ result.references = value1;
175
+ }
176
+ else {
177
+ protocol.skip(ftype);
178
+ }
179
+ break;
180
+ case 13:
181
+ if (ftype === thrift_1.Thrift.Type.BOOL) {
182
+ var value1 = protocol.readBool();
183
+ result.isExpired = value1;
184
+ }
185
+ else {
186
+ protocol.skip(ftype);
187
+ }
188
+ break;
189
+ case 14:
190
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
191
+ var value1 = blocks_1.BlocksSerde.read(protocol);
192
+ result.blocks = value1;
193
+ }
194
+ else {
195
+ protocol.skip(ftype);
196
+ }
197
+ break;
198
+ case 15:
199
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
200
+ var value1 = rights_1.RightsSerde.read(protocol);
201
+ result.rights = value1;
202
+ }
203
+ else {
204
+ protocol.skip(ftype);
205
+ }
206
+ break;
207
+ case 16:
208
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
209
+ var value1 = crossword_1.CrosswordSerde.read(protocol);
210
+ result.crossword = value1;
211
+ }
212
+ else {
213
+ protocol.skip(ftype);
214
+ }
215
+ break;
216
+ case 17:
217
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
218
+ var value1 = atoms_1.AtomsSerde.read(protocol);
219
+ result.atoms = value1;
220
+ }
221
+ else {
222
+ protocol.skip(ftype);
223
+ }
224
+ break;
225
+ case 18:
226
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
227
+ var value1 = contentStats_1.ContentStatsSerde.read(protocol);
228
+ result.stats = value1;
229
+ }
230
+ else {
231
+ protocol.skip(ftype);
232
+ }
233
+ break;
234
+ case 19:
235
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
236
+ var value1 = section_1.SectionSerde.read(protocol);
237
+ result.section = value1;
238
+ }
239
+ else {
240
+ protocol.skip(ftype);
241
+ }
242
+ break;
243
+ case 20:
244
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
245
+ var value1 = debug_1.DebugSerde.read(protocol);
246
+ result.debug = value1;
247
+ }
248
+ else {
249
+ protocol.skip(ftype);
250
+ }
251
+ break;
252
+ case 21:
253
+ if (ftype === thrift_1.Thrift.Type.BOOL) {
254
+ var value1 = protocol.readBool();
255
+ result.isGone = value1;
256
+ }
257
+ else {
258
+ protocol.skip(ftype);
259
+ }
260
+ break;
261
+ case 23:
262
+ if (ftype === thrift_1.Thrift.Type.BOOL) {
263
+ var value1 = protocol.readBool();
264
+ result.isHosted = value1;
265
+ }
266
+ else {
267
+ protocol.skip(ftype);
268
+ }
269
+ break;
270
+ case 24:
271
+ if (ftype === thrift_1.Thrift.Type.STRING) {
272
+ var value1 = protocol.readString();
273
+ result.pillarId = value1;
274
+ }
275
+ else {
276
+ protocol.skip(ftype);
277
+ }
278
+ break;
279
+ case 25:
280
+ if (ftype === thrift_1.Thrift.Type.STRING) {
281
+ var value1 = protocol.readString();
282
+ result.pillarName = value1;
283
+ }
284
+ else {
285
+ protocol.skip(ftype);
286
+ }
287
+ break;
288
+ case 27:
289
+ if (ftype === thrift_1.Thrift.Type.LIST) {
290
+ var listInfo1 = protocol.readListBegin();
291
+ var listSize1 = (_d = listInfo1.size) !== null && _d !== void 0 ? _d : 0;
292
+ var value1 = [];
293
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
294
+ for (var i = 0; i < listSize1; i++) {
295
+ var value2 = aliasPath_1.AliasPathSerde.read(protocol);
296
+ value1.push(value2);
297
+ }
298
+ }
299
+ protocol.readListEnd();
300
+ result.aliasPaths = value1;
301
+ }
302
+ else {
303
+ protocol.skip(ftype);
304
+ }
305
+ break;
306
+ case 28:
307
+ if (ftype === thrift_1.Thrift.Type.LIST) {
308
+ var listInfo1 = protocol.readListBegin();
309
+ var listSize1 = (_e = listInfo1.size) !== null && _e !== void 0 ? _e : 0;
310
+ var value1 = [];
311
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
312
+ for (var i = 0; i < listSize1; i++) {
313
+ var value2 = contentChannel_1.ContentChannelSerde.read(protocol);
314
+ value1.push(value2);
315
+ }
316
+ }
317
+ protocol.readListEnd();
318
+ result.channels = value1;
319
+ }
320
+ else {
321
+ protocol.skip(ftype);
322
+ }
323
+ break;
324
+ default:
325
+ protocol.skip(ftype);
326
+ }
327
+ protocol.readFieldEnd();
328
+ }
329
+ protocol.readStructEnd();
330
+ // @ts-ignore
331
+ return result;
332
+ };
333
+ ContentSerde.write = function (protocol, value0) {
334
+ protocol.writeStructBegin('Content');
335
+ if (value0.id !== null && value0.id !== undefined) {
336
+ var value1 = value0.id;
337
+ protocol.writeFieldBegin('id', thrift_1.Thrift.Type.STRING, 1);
338
+ protocol.writeString(value1);
339
+ protocol.writeFieldEnd();
340
+ }
341
+ if (value0.type !== null && value0.type !== undefined) {
342
+ var value1 = value0.type;
343
+ protocol.writeFieldBegin('type', thrift_1.Thrift.Type.I32, 2);
344
+ protocol.writeI32(value1);
345
+ protocol.writeFieldEnd();
346
+ }
347
+ if (value0.sectionId !== null && value0.sectionId !== undefined) {
348
+ var value1 = value0.sectionId;
349
+ protocol.writeFieldBegin('sectionId', thrift_1.Thrift.Type.STRING, 3);
350
+ protocol.writeString(value1);
351
+ protocol.writeFieldEnd();
352
+ }
353
+ if (value0.sectionName !== null && value0.sectionName !== undefined) {
354
+ var value1 = value0.sectionName;
355
+ protocol.writeFieldBegin('sectionName', thrift_1.Thrift.Type.STRING, 4);
356
+ protocol.writeString(value1);
357
+ protocol.writeFieldEnd();
358
+ }
359
+ if (value0.webPublicationDate !== null && value0.webPublicationDate !== undefined) {
360
+ var value1 = value0.webPublicationDate;
361
+ protocol.writeFieldBegin('webPublicationDate', thrift_1.Thrift.Type.STRUCT, 5);
362
+ capiDateTime_1.CapiDateTimeSerde.write(protocol, value1);
363
+ protocol.writeFieldEnd();
364
+ }
365
+ if (value0.webTitle !== null && value0.webTitle !== undefined) {
366
+ var value1 = value0.webTitle;
367
+ protocol.writeFieldBegin('webTitle', thrift_1.Thrift.Type.STRING, 6);
368
+ protocol.writeString(value1);
369
+ protocol.writeFieldEnd();
370
+ }
371
+ if (value0.webUrl !== null && value0.webUrl !== undefined) {
372
+ var value1 = value0.webUrl;
373
+ protocol.writeFieldBegin('webUrl', thrift_1.Thrift.Type.STRING, 7);
374
+ protocol.writeString(value1);
375
+ protocol.writeFieldEnd();
376
+ }
377
+ if (value0.apiUrl !== null && value0.apiUrl !== undefined) {
378
+ var value1 = value0.apiUrl;
379
+ protocol.writeFieldBegin('apiUrl', thrift_1.Thrift.Type.STRING, 8);
380
+ protocol.writeString(value1);
381
+ protocol.writeFieldEnd();
382
+ }
383
+ if (value0.fields !== null && value0.fields !== undefined) {
384
+ var value1 = value0.fields;
385
+ protocol.writeFieldBegin('fields', thrift_1.Thrift.Type.STRUCT, 9);
386
+ contentFields_1.ContentFieldsSerde.write(protocol, value1);
387
+ protocol.writeFieldEnd();
388
+ }
389
+ if (value0.tags !== null && value0.tags !== undefined) {
390
+ var value1 = value0.tags;
391
+ protocol.writeFieldBegin('tags', thrift_1.Thrift.Type.LIST, 10);
392
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
393
+ value1.forEach(function (value2) {
394
+ tag_1.TagSerde.write(protocol, value2);
395
+ });
396
+ protocol.writeListEnd();
397
+ protocol.writeFieldEnd();
398
+ }
399
+ if (value0.elements !== null && value0.elements !== undefined) {
400
+ var value1 = value0.elements;
401
+ protocol.writeFieldBegin('elements', thrift_1.Thrift.Type.LIST, 11);
402
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
403
+ value1.forEach(function (value2) {
404
+ element_1.ElementSerde.write(protocol, value2);
405
+ });
406
+ protocol.writeListEnd();
407
+ protocol.writeFieldEnd();
408
+ }
409
+ if (value0.references !== null && value0.references !== undefined) {
410
+ var value1 = value0.references;
411
+ protocol.writeFieldBegin('references', thrift_1.Thrift.Type.LIST, 12);
412
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
413
+ value1.forEach(function (value2) {
414
+ reference_1.ReferenceSerde.write(protocol, value2);
415
+ });
416
+ protocol.writeListEnd();
417
+ protocol.writeFieldEnd();
418
+ }
419
+ if (value0.isExpired !== null && value0.isExpired !== undefined) {
420
+ var value1 = value0.isExpired;
421
+ protocol.writeFieldBegin('isExpired', thrift_1.Thrift.Type.BOOL, 13);
422
+ protocol.writeBool(value1);
423
+ protocol.writeFieldEnd();
424
+ }
425
+ if (value0.blocks !== null && value0.blocks !== undefined) {
426
+ var value1 = value0.blocks;
427
+ protocol.writeFieldBegin('blocks', thrift_1.Thrift.Type.STRUCT, 14);
428
+ blocks_1.BlocksSerde.write(protocol, value1);
429
+ protocol.writeFieldEnd();
430
+ }
431
+ if (value0.rights !== null && value0.rights !== undefined) {
432
+ var value1 = value0.rights;
433
+ protocol.writeFieldBegin('rights', thrift_1.Thrift.Type.STRUCT, 15);
434
+ rights_1.RightsSerde.write(protocol, value1);
435
+ protocol.writeFieldEnd();
436
+ }
437
+ if (value0.crossword !== null && value0.crossword !== undefined) {
438
+ var value1 = value0.crossword;
439
+ protocol.writeFieldBegin('crossword', thrift_1.Thrift.Type.STRUCT, 16);
440
+ crossword_1.CrosswordSerde.write(protocol, value1);
441
+ protocol.writeFieldEnd();
442
+ }
443
+ if (value0.atoms !== null && value0.atoms !== undefined) {
444
+ var value1 = value0.atoms;
445
+ protocol.writeFieldBegin('atoms', thrift_1.Thrift.Type.STRUCT, 17);
446
+ atoms_1.AtomsSerde.write(protocol, value1);
447
+ protocol.writeFieldEnd();
448
+ }
449
+ if (value0.stats !== null && value0.stats !== undefined) {
450
+ var value1 = value0.stats;
451
+ protocol.writeFieldBegin('stats', thrift_1.Thrift.Type.STRUCT, 18);
452
+ contentStats_1.ContentStatsSerde.write(protocol, value1);
453
+ protocol.writeFieldEnd();
454
+ }
455
+ if (value0.section !== null && value0.section !== undefined) {
456
+ var value1 = value0.section;
457
+ protocol.writeFieldBegin('section', thrift_1.Thrift.Type.STRUCT, 19);
458
+ section_1.SectionSerde.write(protocol, value1);
459
+ protocol.writeFieldEnd();
460
+ }
461
+ if (value0.debug !== null && value0.debug !== undefined) {
462
+ var value1 = value0.debug;
463
+ protocol.writeFieldBegin('debug', thrift_1.Thrift.Type.STRUCT, 20);
464
+ debug_1.DebugSerde.write(protocol, value1);
465
+ protocol.writeFieldEnd();
466
+ }
467
+ if (value0.isGone !== null && value0.isGone !== undefined) {
468
+ var value1 = value0.isGone;
469
+ protocol.writeFieldBegin('isGone', thrift_1.Thrift.Type.BOOL, 21);
470
+ protocol.writeBool(value1);
471
+ protocol.writeFieldEnd();
472
+ }
473
+ if (value0.isHosted !== null && value0.isHosted !== undefined) {
474
+ var value1 = value0.isHosted;
475
+ protocol.writeFieldBegin('isHosted', thrift_1.Thrift.Type.BOOL, 23);
476
+ protocol.writeBool(value1);
477
+ protocol.writeFieldEnd();
478
+ }
479
+ if (value0.pillarId !== null && value0.pillarId !== undefined) {
480
+ var value1 = value0.pillarId;
481
+ protocol.writeFieldBegin('pillarId', thrift_1.Thrift.Type.STRING, 24);
482
+ protocol.writeString(value1);
483
+ protocol.writeFieldEnd();
484
+ }
485
+ if (value0.pillarName !== null && value0.pillarName !== undefined) {
486
+ var value1 = value0.pillarName;
487
+ protocol.writeFieldBegin('pillarName', thrift_1.Thrift.Type.STRING, 25);
488
+ protocol.writeString(value1);
489
+ protocol.writeFieldEnd();
490
+ }
491
+ if (value0.aliasPaths !== null && value0.aliasPaths !== undefined) {
492
+ var value1 = value0.aliasPaths;
493
+ protocol.writeFieldBegin('aliasPaths', thrift_1.Thrift.Type.LIST, 27);
494
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
495
+ value1.forEach(function (value2) {
496
+ aliasPath_1.AliasPathSerde.write(protocol, value2);
497
+ });
498
+ protocol.writeListEnd();
499
+ protocol.writeFieldEnd();
500
+ }
501
+ if (value0.channels !== null && value0.channels !== undefined) {
502
+ var value1 = value0.channels;
503
+ protocol.writeFieldBegin('channels', thrift_1.Thrift.Type.LIST, 28);
504
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
505
+ value1.forEach(function (value2) {
506
+ contentChannel_1.ContentChannelSerde.write(protocol, value2);
507
+ });
508
+ protocol.writeListEnd();
509
+ protocol.writeFieldEnd();
510
+ }
511
+ protocol.writeFieldStop();
512
+ protocol.writeStructEnd();
513
+ };
514
+ return ContentSerde;
515
+ }());
516
+ exports.ContentSerde = ContentSerde;
@@ -0,0 +1,16 @@
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
+ export interface ContentAtomElementFields {
8
+ atomId: string;
9
+ atomType: string;
10
+ role?: string;
11
+ isMandatory?: boolean;
12
+ }
13
+ export declare class ContentAtomElementFieldsSerde {
14
+ static read(protocol: TProtocol): ContentAtomElementFields;
15
+ static write(protocol: TProtocol, value0: ContentAtomElementFields): void;
16
+ }
@@ -0,0 +1,100 @@
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.ContentAtomElementFieldsSerde = void 0;
9
+ var thrift_1 = require("thrift");
10
+ var ContentAtomElementFieldsSerde = /** @class */ (function () {
11
+ function ContentAtomElementFieldsSerde() {
12
+ }
13
+ ContentAtomElementFieldsSerde.read = function (protocol) {
14
+ protocol.readStructBegin();
15
+ var result = {};
16
+ while (true) {
17
+ var ret = protocol.readFieldBegin();
18
+ var ftype = ret.ftype;
19
+ var fid = ret.fid;
20
+ if (ftype === thrift_1.Thrift.Type.STOP) {
21
+ break;
22
+ }
23
+ switch (fid) {
24
+ case 1:
25
+ if (ftype === thrift_1.Thrift.Type.STRING) {
26
+ var value1 = protocol.readString();
27
+ result.atomId = value1;
28
+ }
29
+ else {
30
+ protocol.skip(ftype);
31
+ }
32
+ break;
33
+ case 2:
34
+ if (ftype === thrift_1.Thrift.Type.STRING) {
35
+ var value1 = protocol.readString();
36
+ result.atomType = value1;
37
+ }
38
+ else {
39
+ protocol.skip(ftype);
40
+ }
41
+ break;
42
+ case 3:
43
+ if (ftype === thrift_1.Thrift.Type.STRING) {
44
+ var value1 = protocol.readString();
45
+ result.role = value1;
46
+ }
47
+ else {
48
+ protocol.skip(ftype);
49
+ }
50
+ break;
51
+ case 4:
52
+ if (ftype === thrift_1.Thrift.Type.BOOL) {
53
+ var value1 = protocol.readBool();
54
+ result.isMandatory = value1;
55
+ }
56
+ else {
57
+ protocol.skip(ftype);
58
+ }
59
+ break;
60
+ default:
61
+ protocol.skip(ftype);
62
+ }
63
+ protocol.readFieldEnd();
64
+ }
65
+ protocol.readStructEnd();
66
+ // @ts-ignore
67
+ return result;
68
+ };
69
+ ContentAtomElementFieldsSerde.write = function (protocol, value0) {
70
+ protocol.writeStructBegin('ContentAtomElementFields');
71
+ if (value0.atomId !== null && value0.atomId !== undefined) {
72
+ var value1 = value0.atomId;
73
+ protocol.writeFieldBegin('atomId', thrift_1.Thrift.Type.STRING, 1);
74
+ protocol.writeString(value1);
75
+ protocol.writeFieldEnd();
76
+ }
77
+ if (value0.atomType !== null && value0.atomType !== undefined) {
78
+ var value1 = value0.atomType;
79
+ protocol.writeFieldBegin('atomType', thrift_1.Thrift.Type.STRING, 2);
80
+ protocol.writeString(value1);
81
+ protocol.writeFieldEnd();
82
+ }
83
+ if (value0.role !== null && value0.role !== undefined) {
84
+ var value1 = value0.role;
85
+ protocol.writeFieldBegin('role', thrift_1.Thrift.Type.STRING, 3);
86
+ protocol.writeString(value1);
87
+ protocol.writeFieldEnd();
88
+ }
89
+ if (value0.isMandatory !== null && value0.isMandatory !== undefined) {
90
+ var value1 = value0.isMandatory;
91
+ protocol.writeFieldBegin('isMandatory', thrift_1.Thrift.Type.BOOL, 4);
92
+ protocol.writeBool(value1);
93
+ protocol.writeFieldEnd();
94
+ }
95
+ protocol.writeFieldStop();
96
+ protocol.writeStructEnd();
97
+ };
98
+ return ContentAtomElementFieldsSerde;
99
+ }());
100
+ exports.ContentAtomElementFieldsSerde = ContentAtomElementFieldsSerde;
@@ -0,0 +1,15 @@
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 { ChannelFields } from './channelFields';
8
+ export interface ContentChannel {
9
+ channelId: string;
10
+ fields: ChannelFields;
11
+ }
12
+ export declare class ContentChannelSerde {
13
+ static read(protocol: TProtocol): ContentChannel;
14
+ static write(protocol: TProtocol, value0: ContentChannel): void;
15
+ }