@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
@@ -0,0 +1,25 @@
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 AudioElementFields {
8
+ html?: string;
9
+ source?: string;
10
+ description?: string;
11
+ title?: string;
12
+ credit?: string;
13
+ caption?: string;
14
+ durationMinutes?: number;
15
+ durationSeconds?: number;
16
+ clean?: boolean;
17
+ explicit?: boolean;
18
+ role?: string;
19
+ sourceDomain?: string;
20
+ isMandatory?: boolean;
21
+ }
22
+ export declare class AudioElementFieldsSerde {
23
+ static read(protocol: TProtocol): AudioElementFields;
24
+ static write(protocol: TProtocol, value0: AudioElementFields): void;
25
+ }
@@ -0,0 +1,235 @@
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.AudioElementFieldsSerde = void 0;
9
+ var thrift_1 = require("thrift");
10
+ var AudioElementFieldsSerde = /** @class */ (function () {
11
+ function AudioElementFieldsSerde() {
12
+ }
13
+ AudioElementFieldsSerde.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.html = 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.source = 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.description = value1;
46
+ }
47
+ else {
48
+ protocol.skip(ftype);
49
+ }
50
+ break;
51
+ case 4:
52
+ if (ftype === thrift_1.Thrift.Type.STRING) {
53
+ var value1 = protocol.readString();
54
+ result.title = value1;
55
+ }
56
+ else {
57
+ protocol.skip(ftype);
58
+ }
59
+ break;
60
+ case 5:
61
+ if (ftype === thrift_1.Thrift.Type.STRING) {
62
+ var value1 = protocol.readString();
63
+ result.credit = value1;
64
+ }
65
+ else {
66
+ protocol.skip(ftype);
67
+ }
68
+ break;
69
+ case 6:
70
+ if (ftype === thrift_1.Thrift.Type.STRING) {
71
+ var value1 = protocol.readString();
72
+ result.caption = value1;
73
+ }
74
+ else {
75
+ protocol.skip(ftype);
76
+ }
77
+ break;
78
+ case 7:
79
+ if (ftype === thrift_1.Thrift.Type.I32) {
80
+ var value1 = protocol.readI32();
81
+ result.durationMinutes = value1;
82
+ }
83
+ else {
84
+ protocol.skip(ftype);
85
+ }
86
+ break;
87
+ case 8:
88
+ if (ftype === thrift_1.Thrift.Type.I32) {
89
+ var value1 = protocol.readI32();
90
+ result.durationSeconds = value1;
91
+ }
92
+ else {
93
+ protocol.skip(ftype);
94
+ }
95
+ break;
96
+ case 9:
97
+ if (ftype === thrift_1.Thrift.Type.BOOL) {
98
+ var value1 = protocol.readBool();
99
+ result.clean = value1;
100
+ }
101
+ else {
102
+ protocol.skip(ftype);
103
+ }
104
+ break;
105
+ case 10:
106
+ if (ftype === thrift_1.Thrift.Type.BOOL) {
107
+ var value1 = protocol.readBool();
108
+ result.explicit = value1;
109
+ }
110
+ else {
111
+ protocol.skip(ftype);
112
+ }
113
+ break;
114
+ case 11:
115
+ if (ftype === thrift_1.Thrift.Type.STRING) {
116
+ var value1 = protocol.readString();
117
+ result.role = value1;
118
+ }
119
+ else {
120
+ protocol.skip(ftype);
121
+ }
122
+ break;
123
+ case 14:
124
+ if (ftype === thrift_1.Thrift.Type.STRING) {
125
+ var value1 = protocol.readString();
126
+ result.sourceDomain = value1;
127
+ }
128
+ else {
129
+ protocol.skip(ftype);
130
+ }
131
+ break;
132
+ case 15:
133
+ if (ftype === thrift_1.Thrift.Type.BOOL) {
134
+ var value1 = protocol.readBool();
135
+ result.isMandatory = value1;
136
+ }
137
+ else {
138
+ protocol.skip(ftype);
139
+ }
140
+ break;
141
+ default:
142
+ protocol.skip(ftype);
143
+ }
144
+ protocol.readFieldEnd();
145
+ }
146
+ protocol.readStructEnd();
147
+ // @ts-ignore
148
+ return result;
149
+ };
150
+ AudioElementFieldsSerde.write = function (protocol, value0) {
151
+ protocol.writeStructBegin('AudioElementFields');
152
+ if (value0.html !== null && value0.html !== undefined) {
153
+ var value1 = value0.html;
154
+ protocol.writeFieldBegin('html', thrift_1.Thrift.Type.STRING, 1);
155
+ protocol.writeString(value1);
156
+ protocol.writeFieldEnd();
157
+ }
158
+ if (value0.source !== null && value0.source !== undefined) {
159
+ var value1 = value0.source;
160
+ protocol.writeFieldBegin('source', thrift_1.Thrift.Type.STRING, 2);
161
+ protocol.writeString(value1);
162
+ protocol.writeFieldEnd();
163
+ }
164
+ if (value0.description !== null && value0.description !== undefined) {
165
+ var value1 = value0.description;
166
+ protocol.writeFieldBegin('description', thrift_1.Thrift.Type.STRING, 3);
167
+ protocol.writeString(value1);
168
+ protocol.writeFieldEnd();
169
+ }
170
+ if (value0.title !== null && value0.title !== undefined) {
171
+ var value1 = value0.title;
172
+ protocol.writeFieldBegin('title', thrift_1.Thrift.Type.STRING, 4);
173
+ protocol.writeString(value1);
174
+ protocol.writeFieldEnd();
175
+ }
176
+ if (value0.credit !== null && value0.credit !== undefined) {
177
+ var value1 = value0.credit;
178
+ protocol.writeFieldBegin('credit', thrift_1.Thrift.Type.STRING, 5);
179
+ protocol.writeString(value1);
180
+ protocol.writeFieldEnd();
181
+ }
182
+ if (value0.caption !== null && value0.caption !== undefined) {
183
+ var value1 = value0.caption;
184
+ protocol.writeFieldBegin('caption', thrift_1.Thrift.Type.STRING, 6);
185
+ protocol.writeString(value1);
186
+ protocol.writeFieldEnd();
187
+ }
188
+ if (value0.durationMinutes !== null && value0.durationMinutes !== undefined) {
189
+ var value1 = value0.durationMinutes;
190
+ protocol.writeFieldBegin('durationMinutes', thrift_1.Thrift.Type.I32, 7);
191
+ protocol.writeI32(value1);
192
+ protocol.writeFieldEnd();
193
+ }
194
+ if (value0.durationSeconds !== null && value0.durationSeconds !== undefined) {
195
+ var value1 = value0.durationSeconds;
196
+ protocol.writeFieldBegin('durationSeconds', thrift_1.Thrift.Type.I32, 8);
197
+ protocol.writeI32(value1);
198
+ protocol.writeFieldEnd();
199
+ }
200
+ if (value0.clean !== null && value0.clean !== undefined) {
201
+ var value1 = value0.clean;
202
+ protocol.writeFieldBegin('clean', thrift_1.Thrift.Type.BOOL, 9);
203
+ protocol.writeBool(value1);
204
+ protocol.writeFieldEnd();
205
+ }
206
+ if (value0.explicit !== null && value0.explicit !== undefined) {
207
+ var value1 = value0.explicit;
208
+ protocol.writeFieldBegin('explicit', thrift_1.Thrift.Type.BOOL, 10);
209
+ protocol.writeBool(value1);
210
+ protocol.writeFieldEnd();
211
+ }
212
+ if (value0.role !== null && value0.role !== undefined) {
213
+ var value1 = value0.role;
214
+ protocol.writeFieldBegin('role', thrift_1.Thrift.Type.STRING, 11);
215
+ protocol.writeString(value1);
216
+ protocol.writeFieldEnd();
217
+ }
218
+ if (value0.sourceDomain !== null && value0.sourceDomain !== undefined) {
219
+ var value1 = value0.sourceDomain;
220
+ protocol.writeFieldBegin('sourceDomain', thrift_1.Thrift.Type.STRING, 14);
221
+ protocol.writeString(value1);
222
+ protocol.writeFieldEnd();
223
+ }
224
+ if (value0.isMandatory !== null && value0.isMandatory !== undefined) {
225
+ var value1 = value0.isMandatory;
226
+ protocol.writeFieldBegin('isMandatory', thrift_1.Thrift.Type.BOOL, 15);
227
+ protocol.writeBool(value1);
228
+ protocol.writeFieldEnd();
229
+ }
230
+ protocol.writeFieldStop();
231
+ protocol.writeStructEnd();
232
+ };
233
+ return AudioElementFieldsSerde;
234
+ }());
235
+ exports.AudioElementFieldsSerde = AudioElementFieldsSerde;
package/v1/block.d.ts ADDED
@@ -0,0 +1,30 @@
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 { BlockAttributes } from './blockAttributes';
8
+ import { BlockElement } from './blockElement';
9
+ import { CapiDateTime } from './capiDateTime';
10
+ import { User } from './user';
11
+ export interface Block {
12
+ id: string;
13
+ bodyHtml: string;
14
+ bodyTextSummary: string;
15
+ title?: string;
16
+ attributes: BlockAttributes;
17
+ published: boolean;
18
+ createdDate?: CapiDateTime;
19
+ firstPublishedDate?: CapiDateTime;
20
+ publishedDate?: CapiDateTime;
21
+ lastModifiedDate?: CapiDateTime;
22
+ contributors: string[];
23
+ createdBy?: User;
24
+ lastModifiedBy?: User;
25
+ elements: BlockElement[];
26
+ }
27
+ export declare class BlockSerde {
28
+ static read(protocol: TProtocol): Block;
29
+ static write(protocol: TProtocol, value0: Block): void;
30
+ }
package/v1/block.js ADDED
@@ -0,0 +1,283 @@
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.BlockSerde = void 0;
9
+ var thrift_1 = require("thrift");
10
+ var blockAttributes_1 = require("./blockAttributes");
11
+ var blockElement_1 = require("./blockElement");
12
+ var capiDateTime_1 = require("./capiDateTime");
13
+ var user_1 = require("./user");
14
+ var BlockSerde = /** @class */ (function () {
15
+ function BlockSerde() {
16
+ }
17
+ BlockSerde.read = function (protocol) {
18
+ var _a, _b;
19
+ protocol.readStructBegin();
20
+ var result = {
21
+ elements: [],
22
+ };
23
+ while (true) {
24
+ var ret = protocol.readFieldBegin();
25
+ var ftype = ret.ftype;
26
+ var fid = ret.fid;
27
+ if (ftype === thrift_1.Thrift.Type.STOP) {
28
+ break;
29
+ }
30
+ switch (fid) {
31
+ case 1:
32
+ if (ftype === thrift_1.Thrift.Type.STRING) {
33
+ var value1 = protocol.readString();
34
+ result.id = value1;
35
+ }
36
+ else {
37
+ protocol.skip(ftype);
38
+ }
39
+ break;
40
+ case 2:
41
+ if (ftype === thrift_1.Thrift.Type.STRING) {
42
+ var value1 = protocol.readString();
43
+ result.bodyHtml = value1;
44
+ }
45
+ else {
46
+ protocol.skip(ftype);
47
+ }
48
+ break;
49
+ case 3:
50
+ if (ftype === thrift_1.Thrift.Type.STRING) {
51
+ var value1 = protocol.readString();
52
+ result.bodyTextSummary = value1;
53
+ }
54
+ else {
55
+ protocol.skip(ftype);
56
+ }
57
+ break;
58
+ case 4:
59
+ if (ftype === thrift_1.Thrift.Type.STRING) {
60
+ var value1 = protocol.readString();
61
+ result.title = value1;
62
+ }
63
+ else {
64
+ protocol.skip(ftype);
65
+ }
66
+ break;
67
+ case 5:
68
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
69
+ var value1 = blockAttributes_1.BlockAttributesSerde.read(protocol);
70
+ result.attributes = value1;
71
+ }
72
+ else {
73
+ protocol.skip(ftype);
74
+ }
75
+ break;
76
+ case 6:
77
+ if (ftype === thrift_1.Thrift.Type.BOOL) {
78
+ var value1 = protocol.readBool();
79
+ result.published = value1;
80
+ }
81
+ else {
82
+ protocol.skip(ftype);
83
+ }
84
+ break;
85
+ case 7:
86
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
87
+ var value1 = capiDateTime_1.CapiDateTimeSerde.read(protocol);
88
+ result.createdDate = value1;
89
+ }
90
+ else {
91
+ protocol.skip(ftype);
92
+ }
93
+ break;
94
+ case 8:
95
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
96
+ var value1 = capiDateTime_1.CapiDateTimeSerde.read(protocol);
97
+ result.firstPublishedDate = value1;
98
+ }
99
+ else {
100
+ protocol.skip(ftype);
101
+ }
102
+ break;
103
+ case 9:
104
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
105
+ var value1 = capiDateTime_1.CapiDateTimeSerde.read(protocol);
106
+ result.publishedDate = value1;
107
+ }
108
+ else {
109
+ protocol.skip(ftype);
110
+ }
111
+ break;
112
+ case 10:
113
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
114
+ var value1 = capiDateTime_1.CapiDateTimeSerde.read(protocol);
115
+ result.lastModifiedDate = value1;
116
+ }
117
+ else {
118
+ protocol.skip(ftype);
119
+ }
120
+ break;
121
+ case 11:
122
+ if (ftype === thrift_1.Thrift.Type.LIST) {
123
+ var listInfo1 = protocol.readListBegin();
124
+ var listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
125
+ var value1 = [];
126
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRING) {
127
+ for (var i = 0; i < listSize1; i++) {
128
+ var value2 = protocol.readString();
129
+ value1.push(value2);
130
+ }
131
+ }
132
+ protocol.readListEnd();
133
+ result.contributors = value1;
134
+ }
135
+ else {
136
+ protocol.skip(ftype);
137
+ }
138
+ break;
139
+ case 12:
140
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
141
+ var value1 = user_1.UserSerde.read(protocol);
142
+ result.createdBy = value1;
143
+ }
144
+ else {
145
+ protocol.skip(ftype);
146
+ }
147
+ break;
148
+ case 13:
149
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
150
+ var value1 = user_1.UserSerde.read(protocol);
151
+ result.lastModifiedBy = value1;
152
+ }
153
+ else {
154
+ protocol.skip(ftype);
155
+ }
156
+ break;
157
+ case 14:
158
+ if (ftype === thrift_1.Thrift.Type.LIST) {
159
+ var listInfo1 = protocol.readListBegin();
160
+ var listSize1 = (_b = listInfo1.size) !== null && _b !== void 0 ? _b : 0;
161
+ var value1 = [];
162
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
163
+ for (var i = 0; i < listSize1; i++) {
164
+ var value2 = blockElement_1.BlockElementSerde.read(protocol);
165
+ value1.push(value2);
166
+ }
167
+ }
168
+ protocol.readListEnd();
169
+ result.elements = value1;
170
+ }
171
+ else {
172
+ protocol.skip(ftype);
173
+ }
174
+ break;
175
+ default:
176
+ protocol.skip(ftype);
177
+ }
178
+ protocol.readFieldEnd();
179
+ }
180
+ protocol.readStructEnd();
181
+ // @ts-ignore
182
+ return result;
183
+ };
184
+ BlockSerde.write = function (protocol, value0) {
185
+ protocol.writeStructBegin('Block');
186
+ if (value0.id !== null && value0.id !== undefined) {
187
+ var value1 = value0.id;
188
+ protocol.writeFieldBegin('id', thrift_1.Thrift.Type.STRING, 1);
189
+ protocol.writeString(value1);
190
+ protocol.writeFieldEnd();
191
+ }
192
+ if (value0.bodyHtml !== null && value0.bodyHtml !== undefined) {
193
+ var value1 = value0.bodyHtml;
194
+ protocol.writeFieldBegin('bodyHtml', thrift_1.Thrift.Type.STRING, 2);
195
+ protocol.writeString(value1);
196
+ protocol.writeFieldEnd();
197
+ }
198
+ if (value0.bodyTextSummary !== null && value0.bodyTextSummary !== undefined) {
199
+ var value1 = value0.bodyTextSummary;
200
+ protocol.writeFieldBegin('bodyTextSummary', thrift_1.Thrift.Type.STRING, 3);
201
+ protocol.writeString(value1);
202
+ protocol.writeFieldEnd();
203
+ }
204
+ if (value0.title !== null && value0.title !== undefined) {
205
+ var value1 = value0.title;
206
+ protocol.writeFieldBegin('title', thrift_1.Thrift.Type.STRING, 4);
207
+ protocol.writeString(value1);
208
+ protocol.writeFieldEnd();
209
+ }
210
+ if (value0.attributes !== null && value0.attributes !== undefined) {
211
+ var value1 = value0.attributes;
212
+ protocol.writeFieldBegin('attributes', thrift_1.Thrift.Type.STRUCT, 5);
213
+ blockAttributes_1.BlockAttributesSerde.write(protocol, value1);
214
+ protocol.writeFieldEnd();
215
+ }
216
+ if (value0.published !== null && value0.published !== undefined) {
217
+ var value1 = value0.published;
218
+ protocol.writeFieldBegin('published', thrift_1.Thrift.Type.BOOL, 6);
219
+ protocol.writeBool(value1);
220
+ protocol.writeFieldEnd();
221
+ }
222
+ if (value0.createdDate !== null && value0.createdDate !== undefined) {
223
+ var value1 = value0.createdDate;
224
+ protocol.writeFieldBegin('createdDate', thrift_1.Thrift.Type.STRUCT, 7);
225
+ capiDateTime_1.CapiDateTimeSerde.write(protocol, value1);
226
+ protocol.writeFieldEnd();
227
+ }
228
+ if (value0.firstPublishedDate !== null && value0.firstPublishedDate !== undefined) {
229
+ var value1 = value0.firstPublishedDate;
230
+ protocol.writeFieldBegin('firstPublishedDate', thrift_1.Thrift.Type.STRUCT, 8);
231
+ capiDateTime_1.CapiDateTimeSerde.write(protocol, value1);
232
+ protocol.writeFieldEnd();
233
+ }
234
+ if (value0.publishedDate !== null && value0.publishedDate !== undefined) {
235
+ var value1 = value0.publishedDate;
236
+ protocol.writeFieldBegin('publishedDate', thrift_1.Thrift.Type.STRUCT, 9);
237
+ capiDateTime_1.CapiDateTimeSerde.write(protocol, value1);
238
+ protocol.writeFieldEnd();
239
+ }
240
+ if (value0.lastModifiedDate !== null && value0.lastModifiedDate !== undefined) {
241
+ var value1 = value0.lastModifiedDate;
242
+ protocol.writeFieldBegin('lastModifiedDate', thrift_1.Thrift.Type.STRUCT, 10);
243
+ capiDateTime_1.CapiDateTimeSerde.write(protocol, value1);
244
+ protocol.writeFieldEnd();
245
+ }
246
+ if (value0.contributors !== null && value0.contributors !== undefined) {
247
+ var value1 = value0.contributors;
248
+ protocol.writeFieldBegin('contributors', thrift_1.Thrift.Type.LIST, 11);
249
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRING, value1.length);
250
+ value1.forEach(function (value2) {
251
+ protocol.writeString(value2);
252
+ });
253
+ protocol.writeListEnd();
254
+ protocol.writeFieldEnd();
255
+ }
256
+ if (value0.createdBy !== null && value0.createdBy !== undefined) {
257
+ var value1 = value0.createdBy;
258
+ protocol.writeFieldBegin('createdBy', thrift_1.Thrift.Type.STRUCT, 12);
259
+ user_1.UserSerde.write(protocol, value1);
260
+ protocol.writeFieldEnd();
261
+ }
262
+ if (value0.lastModifiedBy !== null && value0.lastModifiedBy !== undefined) {
263
+ var value1 = value0.lastModifiedBy;
264
+ protocol.writeFieldBegin('lastModifiedBy', thrift_1.Thrift.Type.STRUCT, 13);
265
+ user_1.UserSerde.write(protocol, value1);
266
+ protocol.writeFieldEnd();
267
+ }
268
+ if (value0.elements !== null && value0.elements !== undefined) {
269
+ var value1 = value0.elements;
270
+ protocol.writeFieldBegin('elements', thrift_1.Thrift.Type.LIST, 14);
271
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
272
+ value1.forEach(function (value2) {
273
+ blockElement_1.BlockElementSerde.write(protocol, value2);
274
+ });
275
+ protocol.writeListEnd();
276
+ protocol.writeFieldEnd();
277
+ }
278
+ protocol.writeFieldStop();
279
+ protocol.writeStructEnd();
280
+ };
281
+ return BlockSerde;
282
+ }());
283
+ exports.BlockSerde = BlockSerde;
@@ -0,0 +1,18 @@
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 { MembershipPlaceholder } from './membershipPlaceholder';
8
+ export interface BlockAttributes {
9
+ keyEvent?: boolean;
10
+ summary?: boolean;
11
+ title?: string;
12
+ pinned?: boolean;
13
+ membershipPlaceholder?: MembershipPlaceholder;
14
+ }
15
+ export declare class BlockAttributesSerde {
16
+ static read(protocol: TProtocol): BlockAttributes;
17
+ static write(protocol: TProtocol, value0: BlockAttributes): void;
18
+ }