box-node-sdk 10.5.0 → 10.6.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 (205) hide show
  1. package/lib/bundle.js +655 -10
  2. package/lib/bundle.js.map +1 -1
  3. package/lib/client.d.ts +3 -1
  4. package/lib/client.d.ts.map +1 -1
  5. package/lib/client.js +5 -0
  6. package/lib/client.js.map +1 -1
  7. package/lib/managers/hubDocument.d.ts +133 -0
  8. package/lib/managers/hubDocument.d.ts.map +1 -0
  9. package/lib/managers/hubDocument.js +162 -0
  10. package/lib/managers/hubDocument.js.map +1 -0
  11. package/lib/managers/hubItems.d.ts +7 -0
  12. package/lib/managers/hubItems.d.ts.map +1 -1
  13. package/lib/managers/hubItems.js +1 -0
  14. package/lib/managers/hubItems.js.map +1 -1
  15. package/lib/managers/index.d.ts +1 -0
  16. package/lib/managers/index.d.ts.map +1 -1
  17. package/lib/managers/index.js +1 -0
  18. package/lib/managers/index.js.map +1 -1
  19. package/lib/managers/search.d.ts +1 -1
  20. package/lib/managers/search.d.ts.map +1 -1
  21. package/lib/managers/search.js +1 -1
  22. package/lib/managers/search.js.map +1 -1
  23. package/lib/managers/trashedItems.d.ts +2 -0
  24. package/lib/managers/trashedItems.d.ts.map +1 -1
  25. package/lib/managers/trashedItems.js +2 -0
  26. package/lib/managers/trashedItems.js.map +1 -1
  27. package/lib/networking/version.d.ts +1 -1
  28. package/lib/networking/version.js +1 -1
  29. package/lib/schemas/aiAgentBasicTextToolBase.d.ts +1 -1
  30. package/lib/schemas/aiAgentBasicTextToolBase.d.ts.map +1 -1
  31. package/lib/schemas/aiAgentSpreadsheetTool.d.ts +1 -1
  32. package/lib/schemas/aiAgentSpreadsheetTool.d.ts.map +1 -1
  33. package/lib/schemas/aiExtractStructured.d.ts +3 -0
  34. package/lib/schemas/aiExtractStructured.d.ts.map +1 -1
  35. package/lib/schemas/aiExtractStructured.js +9 -0
  36. package/lib/schemas/aiExtractStructured.js.map +1 -1
  37. package/lib/schemas/aiExtractStructuredResponse.d.ts +5 -0
  38. package/lib/schemas/aiExtractStructuredResponse.d.ts.map +1 -1
  39. package/lib/schemas/aiExtractStructuredResponse.js +24 -0
  40. package/lib/schemas/aiExtractStructuredResponse.js.map +1 -1
  41. package/lib/schemas/index.d.ts +5 -5
  42. package/lib/schemas/index.d.ts.map +1 -1
  43. package/lib/schemas/index.js +5 -5
  44. package/lib/schemas/index.js.map +1 -1
  45. package/lib/schemas/legalHoldPolicyAssignedItem.d.ts +13 -5
  46. package/lib/schemas/legalHoldPolicyAssignedItem.d.ts.map +1 -1
  47. package/lib/schemas/legalHoldPolicyAssignedItem.js +47 -24
  48. package/lib/schemas/legalHoldPolicyAssignedItem.js.map +1 -1
  49. package/lib/schemas/legalHoldPolicyAssignment.d.ts.map +1 -1
  50. package/lib/schemas/legalHoldPolicyAssignment.js.map +1 -1
  51. package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.d.ts +20 -0
  52. package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.d.ts.map +1 -0
  53. package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js +105 -0
  54. package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js.map +1 -0
  55. package/lib/schemas/v2025R0/hubDividerBlockV2025R0.d.ts +17 -0
  56. package/lib/schemas/v2025R0/hubDividerBlockV2025R0.d.ts.map +1 -0
  57. package/lib/schemas/v2025R0/hubDividerBlockV2025R0.js +87 -0
  58. package/lib/schemas/v2025R0/hubDividerBlockV2025R0.js.map +1 -0
  59. package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.d.ts +10 -0
  60. package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.d.ts.map +1 -0
  61. package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js +60 -0
  62. package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js.map +1 -0
  63. package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.d.ts +13 -0
  64. package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.d.ts.map +1 -0
  65. package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.js +36 -0
  66. package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.js.map +1 -0
  67. package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.d.ts +45 -0
  68. package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.d.ts.map +1 -0
  69. package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.js +162 -0
  70. package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.js.map +1 -0
  71. package/lib/schemas/v2025R0/hubDocumentPageV2025R0.d.ts +19 -0
  72. package/lib/schemas/v2025R0/hubDocumentPageV2025R0.d.ts.map +1 -0
  73. package/lib/schemas/v2025R0/hubDocumentPageV2025R0.js +68 -0
  74. package/lib/schemas/v2025R0/hubDocumentPageV2025R0.js.map +1 -0
  75. package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.d.ts +45 -0
  76. package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.d.ts.map +1 -0
  77. package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.js +162 -0
  78. package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.js.map +1 -0
  79. package/lib/schemas/v2025R0/hubItemListBlockV2025R0.d.ts +17 -0
  80. package/lib/schemas/v2025R0/hubItemListBlockV2025R0.d.ts.map +1 -0
  81. package/lib/schemas/v2025R0/hubItemListBlockV2025R0.js +87 -0
  82. package/lib/schemas/v2025R0/hubItemListBlockV2025R0.js.map +1 -0
  83. package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.d.ts +3 -0
  84. package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.d.ts.map +1 -1
  85. package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.js +8 -0
  86. package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.js.map +1 -1
  87. package/lib/schemas/v2025R0/hubItemOperationV2025R0.d.ts +3 -0
  88. package/lib/schemas/v2025R0/hubItemOperationV2025R0.d.ts.map +1 -1
  89. package/lib/schemas/v2025R0/hubItemOperationV2025R0.js +12 -1
  90. package/lib/schemas/v2025R0/hubItemOperationV2025R0.js.map +1 -1
  91. package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.d.ts +20 -0
  92. package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.d.ts.map +1 -0
  93. package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.js +105 -0
  94. package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.js.map +1 -0
  95. package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.d.ts +20 -0
  96. package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.d.ts.map +1 -0
  97. package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js +105 -0
  98. package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js.map +1 -0
  99. package/lib/schemas/v2025R0/index.d.ts +10 -0
  100. package/lib/schemas/v2025R0/index.d.ts.map +1 -1
  101. package/lib/schemas/v2025R0/index.js +10 -0
  102. package/lib/schemas/v2025R0/index.js.map +1 -1
  103. package/lib-esm/client.d.ts +3 -1
  104. package/lib-esm/client.js +6 -0
  105. package/lib-esm/client.js.map +1 -1
  106. package/lib-esm/managers/hubDocument.d.ts +132 -0
  107. package/lib-esm/managers/hubDocument.js +154 -0
  108. package/lib-esm/managers/hubDocument.js.map +1 -0
  109. package/lib-esm/managers/hubItems.d.ts +7 -0
  110. package/lib-esm/managers/hubItems.js +1 -0
  111. package/lib-esm/managers/hubItems.js.map +1 -1
  112. package/lib-esm/managers/index.d.ts +1 -0
  113. package/lib-esm/managers/index.js +1 -0
  114. package/lib-esm/managers/index.js.map +1 -1
  115. package/lib-esm/managers/search.d.ts +1 -1
  116. package/lib-esm/managers/search.js +1 -1
  117. package/lib-esm/managers/search.js.map +1 -1
  118. package/lib-esm/managers/trashedItems.d.ts +2 -0
  119. package/lib-esm/managers/trashedItems.js +2 -0
  120. package/lib-esm/managers/trashedItems.js.map +1 -1
  121. package/lib-esm/networking/version.d.ts +1 -1
  122. package/lib-esm/networking/version.js +1 -1
  123. package/lib-esm/schemas/aiAgentBasicTextToolBase.d.ts +1 -1
  124. package/lib-esm/schemas/aiAgentSpreadsheetTool.d.ts +1 -1
  125. package/lib-esm/schemas/aiExtractStructured.d.ts +3 -0
  126. package/lib-esm/schemas/aiExtractStructured.js +9 -0
  127. package/lib-esm/schemas/aiExtractStructured.js.map +1 -1
  128. package/lib-esm/schemas/aiExtractStructuredResponse.d.ts +5 -0
  129. package/lib-esm/schemas/aiExtractStructuredResponse.js +24 -0
  130. package/lib-esm/schemas/aiExtractStructuredResponse.js.map +1 -1
  131. package/lib-esm/schemas/index.d.ts +5 -5
  132. package/lib-esm/schemas/index.js +5 -5
  133. package/lib-esm/schemas/index.js.map +1 -1
  134. package/lib-esm/schemas/legalHoldPolicyAssignedItem.d.ts +13 -5
  135. package/lib-esm/schemas/legalHoldPolicyAssignedItem.js +44 -23
  136. package/lib-esm/schemas/legalHoldPolicyAssignedItem.js.map +1 -1
  137. package/lib-esm/schemas/legalHoldPolicyAssignment.js.map +1 -1
  138. package/lib-esm/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.d.ts +19 -0
  139. package/lib-esm/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js +106 -0
  140. package/lib-esm/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js.map +1 -0
  141. package/lib-esm/schemas/v2025R0/hubDividerBlockV2025R0.d.ts +16 -0
  142. package/lib-esm/schemas/v2025R0/hubDividerBlockV2025R0.js +85 -0
  143. package/lib-esm/schemas/v2025R0/hubDividerBlockV2025R0.js.map +1 -0
  144. package/lib-esm/schemas/v2025R0/hubDocumentBlockEntryV2025R0.d.ts +9 -0
  145. package/lib-esm/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js +56 -0
  146. package/lib-esm/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js.map +1 -0
  147. package/lib-esm/schemas/v2025R0/hubDocumentBlockV2025R0.d.ts +12 -0
  148. package/lib-esm/schemas/v2025R0/hubDocumentBlockV2025R0.js +32 -0
  149. package/lib-esm/schemas/v2025R0/hubDocumentBlockV2025R0.js.map +1 -0
  150. package/lib-esm/schemas/v2025R0/hubDocumentBlocksV2025R0.d.ts +44 -0
  151. package/lib-esm/schemas/v2025R0/hubDocumentBlocksV2025R0.js +164 -0
  152. package/lib-esm/schemas/v2025R0/hubDocumentBlocksV2025R0.js.map +1 -0
  153. package/lib-esm/schemas/v2025R0/hubDocumentPageV2025R0.d.ts +18 -0
  154. package/lib-esm/schemas/v2025R0/hubDocumentPageV2025R0.js +64 -0
  155. package/lib-esm/schemas/v2025R0/hubDocumentPageV2025R0.js.map +1 -0
  156. package/lib-esm/schemas/v2025R0/hubDocumentPagesV2025R0.d.ts +44 -0
  157. package/lib-esm/schemas/v2025R0/hubDocumentPagesV2025R0.js +164 -0
  158. package/lib-esm/schemas/v2025R0/hubDocumentPagesV2025R0.js.map +1 -0
  159. package/lib-esm/schemas/v2025R0/hubItemListBlockV2025R0.d.ts +16 -0
  160. package/lib-esm/schemas/v2025R0/hubItemListBlockV2025R0.js +85 -0
  161. package/lib-esm/schemas/v2025R0/hubItemListBlockV2025R0.js.map +1 -0
  162. package/lib-esm/schemas/v2025R0/hubItemOperationResultV2025R0.d.ts +3 -0
  163. package/lib-esm/schemas/v2025R0/hubItemOperationResultV2025R0.js +8 -0
  164. package/lib-esm/schemas/v2025R0/hubItemOperationResultV2025R0.js.map +1 -1
  165. package/lib-esm/schemas/v2025R0/hubItemOperationV2025R0.d.ts +3 -0
  166. package/lib-esm/schemas/v2025R0/hubItemOperationV2025R0.js +12 -1
  167. package/lib-esm/schemas/v2025R0/hubItemOperationV2025R0.js.map +1 -1
  168. package/lib-esm/schemas/v2025R0/hubParagraphTextBlockV2025R0.d.ts +19 -0
  169. package/lib-esm/schemas/v2025R0/hubParagraphTextBlockV2025R0.js +106 -0
  170. package/lib-esm/schemas/v2025R0/hubParagraphTextBlockV2025R0.js.map +1 -0
  171. package/lib-esm/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.d.ts +19 -0
  172. package/lib-esm/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js +106 -0
  173. package/lib-esm/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js.map +1 -0
  174. package/lib-esm/schemas/v2025R0/index.d.ts +10 -0
  175. package/lib-esm/schemas/v2025R0/index.js +10 -0
  176. package/lib-esm/schemas/v2025R0/index.js.map +1 -1
  177. package/package.json +1 -1
  178. package/src/client.ts +7 -0
  179. package/src/managers/hubDocument.ts +330 -0
  180. package/src/managers/hubItems.ts +8 -0
  181. package/src/managers/index.ts +1 -0
  182. package/src/managers/search.ts +2 -2
  183. package/src/managers/trashedItems.ts +2 -0
  184. package/src/networking/version.ts +1 -1
  185. package/src/schemas/aiAgentBasicTextToolBase.ts +1 -1
  186. package/src/schemas/aiAgentSpreadsheetTool.ts +1 -1
  187. package/src/schemas/aiExtractStructured.ts +16 -0
  188. package/src/schemas/aiExtractStructuredResponse.ts +44 -0
  189. package/src/schemas/index.ts +5 -5
  190. package/src/schemas/legalHoldPolicyAssignedItem.ts +69 -27
  191. package/src/schemas/legalHoldPolicyAssignment.ts +0 -9
  192. package/src/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.ts +133 -0
  193. package/src/schemas/v2025R0/hubDividerBlockV2025R0.ts +108 -0
  194. package/src/schemas/v2025R0/hubDocumentBlockEntryV2025R0.ts +76 -0
  195. package/src/schemas/v2025R0/hubDocumentBlockV2025R0.ts +51 -0
  196. package/src/schemas/v2025R0/hubDocumentBlocksV2025R0.ts +238 -0
  197. package/src/schemas/v2025R0/hubDocumentPageV2025R0.ts +92 -0
  198. package/src/schemas/v2025R0/hubDocumentPagesV2025R0.ts +218 -0
  199. package/src/schemas/v2025R0/hubItemListBlockV2025R0.ts +108 -0
  200. package/src/schemas/v2025R0/hubItemOperationResultV2025R0.ts +13 -0
  201. package/src/schemas/v2025R0/hubItemOperationV2025R0.ts +17 -1
  202. package/src/schemas/v2025R0/hubParagraphTextBlockV2025R0.ts +133 -0
  203. package/src/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.ts +133 -0
  204. package/src/schemas/v2025R0/index.ts +10 -0
  205. package/src/test/hubDocument.test.ts +91 -0
@@ -1,11 +1,5 @@
1
1
  import { serializeLegalHoldPolicyAssignmentBaseTypeField } from './legalHoldPolicyAssignmentBase';
2
2
  import { deserializeLegalHoldPolicyAssignmentBaseTypeField } from './legalHoldPolicyAssignmentBase';
3
- import { serializeFile } from './file';
4
- import { deserializeFile } from './file';
5
- import { serializeFolder } from './folder';
6
- import { deserializeFolder } from './folder';
7
- import { serializeWebLink } from './webLink';
8
- import { deserializeWebLink } from './webLink';
9
3
  import { serializeLegalHoldPolicyAssignmentBase } from './legalHoldPolicyAssignmentBase';
10
4
  import { deserializeLegalHoldPolicyAssignmentBase } from './legalHoldPolicyAssignmentBase';
11
5
  import { serializeLegalHoldPolicyMini } from './legalHoldPolicyMini';
@@ -17,9 +11,6 @@ import { deserializeUserMini } from './userMini';
17
11
  import { serializeDateTime } from '../internal/utils';
18
12
  import { deserializeDateTime } from '../internal/utils';
19
13
  import { LegalHoldPolicyAssignmentBaseTypeField } from './legalHoldPolicyAssignmentBase';
20
- import { File } from './file';
21
- import { Folder } from './folder';
22
- import { WebLink } from './webLink';
23
14
  import { LegalHoldPolicyAssignmentBase } from './legalHoldPolicyAssignmentBase';
24
15
  import { LegalHoldPolicyMini } from './legalHoldPolicyMini';
25
16
  import { LegalHoldPolicyAssignedItem } from './legalHoldPolicyAssignedItem';
@@ -0,0 +1,133 @@
1
+ import { serializeHubDocumentBlockV2025R0 } from './hubDocumentBlockV2025R0';
2
+ import { deserializeHubDocumentBlockV2025R0 } from './hubDocumentBlockV2025R0';
3
+ import { HubDocumentBlockV2025R0 } from './hubDocumentBlockV2025R0';
4
+ import { BoxSdkError } from '../../box/errors';
5
+ import { SerializedData } from '../../serialization/json';
6
+ import { sdIsEmpty } from '../../serialization/json';
7
+ import { sdIsBoolean } from '../../serialization/json';
8
+ import { sdIsNumber } from '../../serialization/json';
9
+ import { sdIsString } from '../../serialization/json';
10
+ import { sdIsList } from '../../serialization/json';
11
+ import { sdIsMap } from '../../serialization/json';
12
+ export type HubCalloutBoxTextBlockV2025R0TypeField = 'callout_box';
13
+ export class HubCalloutBoxTextBlockV2025R0 implements HubDocumentBlockV2025R0 {
14
+ readonly id!: string;
15
+ readonly parentId?: string | null;
16
+ readonly rawData?: SerializedData;
17
+ /**
18
+ * The type of this block. The value is always `callout_box`. */
19
+ readonly type: HubCalloutBoxTextBlockV2025R0TypeField =
20
+ 'callout_box' as HubCalloutBoxTextBlockV2025R0TypeField;
21
+ /**
22
+ * Text content of the block. Includes rich text formatting. */
23
+ readonly fragment!: string;
24
+ constructor(
25
+ fields: Omit<HubCalloutBoxTextBlockV2025R0, 'type'> &
26
+ Partial<Pick<HubCalloutBoxTextBlockV2025R0, 'type'>>,
27
+ ) {
28
+ if (fields.id !== undefined) {
29
+ this.id = fields.id;
30
+ }
31
+ if (fields.parentId !== undefined) {
32
+ this.parentId = fields.parentId;
33
+ }
34
+ if (fields.rawData !== undefined) {
35
+ this.rawData = fields.rawData;
36
+ }
37
+ if (fields.type !== undefined) {
38
+ this.type = fields.type;
39
+ }
40
+ if (fields.fragment !== undefined) {
41
+ this.fragment = fields.fragment;
42
+ }
43
+ }
44
+ }
45
+ export function serializeHubCalloutBoxTextBlockV2025R0TypeField(
46
+ val: HubCalloutBoxTextBlockV2025R0TypeField,
47
+ ): SerializedData {
48
+ return val;
49
+ }
50
+ export function deserializeHubCalloutBoxTextBlockV2025R0TypeField(
51
+ val: SerializedData,
52
+ ): HubCalloutBoxTextBlockV2025R0TypeField {
53
+ if (val == 'callout_box') {
54
+ return val;
55
+ }
56
+ throw new BoxSdkError({
57
+ message: "Can't deserialize HubCalloutBoxTextBlockV2025R0TypeField",
58
+ });
59
+ }
60
+ export function serializeHubCalloutBoxTextBlockV2025R0(
61
+ val: HubCalloutBoxTextBlockV2025R0,
62
+ ): SerializedData {
63
+ const base: any = serializeHubDocumentBlockV2025R0(val);
64
+ if (!sdIsMap(base)) {
65
+ throw new BoxSdkError({
66
+ message: 'Expecting a map for "HubCalloutBoxTextBlockV2025R0"',
67
+ });
68
+ }
69
+ return {
70
+ ...base,
71
+ ...{
72
+ ['type']: serializeHubCalloutBoxTextBlockV2025R0TypeField(val.type),
73
+ ['fragment']: val.fragment,
74
+ },
75
+ };
76
+ }
77
+ export function deserializeHubCalloutBoxTextBlockV2025R0(
78
+ val: SerializedData,
79
+ ): HubCalloutBoxTextBlockV2025R0 {
80
+ if (!sdIsMap(val)) {
81
+ throw new BoxSdkError({
82
+ message: 'Expecting a map for "HubCalloutBoxTextBlockV2025R0"',
83
+ });
84
+ }
85
+ if (val.type == void 0) {
86
+ throw new BoxSdkError({
87
+ message:
88
+ 'Expecting "type" of type "HubCalloutBoxTextBlockV2025R0" to be defined',
89
+ });
90
+ }
91
+ const type: HubCalloutBoxTextBlockV2025R0TypeField =
92
+ deserializeHubCalloutBoxTextBlockV2025R0TypeField(val.type);
93
+ if (val.fragment == void 0) {
94
+ throw new BoxSdkError({
95
+ message:
96
+ 'Expecting "fragment" of type "HubCalloutBoxTextBlockV2025R0" to be defined',
97
+ });
98
+ }
99
+ if (!sdIsString(val.fragment)) {
100
+ throw new BoxSdkError({
101
+ message:
102
+ 'Expecting string for "fragment" of type "HubCalloutBoxTextBlockV2025R0"',
103
+ });
104
+ }
105
+ const fragment: string = val.fragment;
106
+ if (val.id == void 0) {
107
+ throw new BoxSdkError({
108
+ message:
109
+ 'Expecting "id" of type "HubCalloutBoxTextBlockV2025R0" to be defined',
110
+ });
111
+ }
112
+ if (!sdIsString(val.id)) {
113
+ throw new BoxSdkError({
114
+ message:
115
+ 'Expecting string for "id" of type "HubCalloutBoxTextBlockV2025R0"',
116
+ });
117
+ }
118
+ const id: string = val.id;
119
+ if (!(val.parent_id == void 0) && !sdIsString(val.parent_id)) {
120
+ throw new BoxSdkError({
121
+ message:
122
+ 'Expecting string for "parent_id" of type "HubCalloutBoxTextBlockV2025R0"',
123
+ });
124
+ }
125
+ const parentId: undefined | string =
126
+ val.parent_id == void 0 ? void 0 : val.parent_id;
127
+ return {
128
+ type: type,
129
+ fragment: fragment,
130
+ id: id,
131
+ parentId: parentId,
132
+ } satisfies HubCalloutBoxTextBlockV2025R0;
133
+ }
@@ -0,0 +1,108 @@
1
+ import { serializeHubDocumentBlockV2025R0 } from './hubDocumentBlockV2025R0';
2
+ import { deserializeHubDocumentBlockV2025R0 } from './hubDocumentBlockV2025R0';
3
+ import { HubDocumentBlockV2025R0 } from './hubDocumentBlockV2025R0';
4
+ import { BoxSdkError } from '../../box/errors';
5
+ import { SerializedData } from '../../serialization/json';
6
+ import { sdIsEmpty } from '../../serialization/json';
7
+ import { sdIsBoolean } from '../../serialization/json';
8
+ import { sdIsNumber } from '../../serialization/json';
9
+ import { sdIsString } from '../../serialization/json';
10
+ import { sdIsList } from '../../serialization/json';
11
+ import { sdIsMap } from '../../serialization/json';
12
+ export type HubDividerBlockV2025R0TypeField = 'divider';
13
+ export class HubDividerBlockV2025R0 implements HubDocumentBlockV2025R0 {
14
+ readonly id!: string;
15
+ readonly parentId?: string | null;
16
+ readonly rawData?: SerializedData;
17
+ /**
18
+ * The type of this block. The value is always `divider`. */
19
+ readonly type: HubDividerBlockV2025R0TypeField =
20
+ 'divider' as HubDividerBlockV2025R0TypeField;
21
+ constructor(
22
+ fields: Omit<HubDividerBlockV2025R0, 'type'> &
23
+ Partial<Pick<HubDividerBlockV2025R0, 'type'>>,
24
+ ) {
25
+ if (fields.id !== undefined) {
26
+ this.id = fields.id;
27
+ }
28
+ if (fields.parentId !== undefined) {
29
+ this.parentId = fields.parentId;
30
+ }
31
+ if (fields.rawData !== undefined) {
32
+ this.rawData = fields.rawData;
33
+ }
34
+ if (fields.type !== undefined) {
35
+ this.type = fields.type;
36
+ }
37
+ }
38
+ }
39
+ export function serializeHubDividerBlockV2025R0TypeField(
40
+ val: HubDividerBlockV2025R0TypeField,
41
+ ): SerializedData {
42
+ return val;
43
+ }
44
+ export function deserializeHubDividerBlockV2025R0TypeField(
45
+ val: SerializedData,
46
+ ): HubDividerBlockV2025R0TypeField {
47
+ if (val == 'divider') {
48
+ return val;
49
+ }
50
+ throw new BoxSdkError({
51
+ message: "Can't deserialize HubDividerBlockV2025R0TypeField",
52
+ });
53
+ }
54
+ export function serializeHubDividerBlockV2025R0(
55
+ val: HubDividerBlockV2025R0,
56
+ ): SerializedData {
57
+ const base: any = serializeHubDocumentBlockV2025R0(val);
58
+ if (!sdIsMap(base)) {
59
+ throw new BoxSdkError({
60
+ message: 'Expecting a map for "HubDividerBlockV2025R0"',
61
+ });
62
+ }
63
+ return {
64
+ ...base,
65
+ ...{ ['type']: serializeHubDividerBlockV2025R0TypeField(val.type) },
66
+ };
67
+ }
68
+ export function deserializeHubDividerBlockV2025R0(
69
+ val: SerializedData,
70
+ ): HubDividerBlockV2025R0 {
71
+ if (!sdIsMap(val)) {
72
+ throw new BoxSdkError({
73
+ message: 'Expecting a map for "HubDividerBlockV2025R0"',
74
+ });
75
+ }
76
+ if (val.type == void 0) {
77
+ throw new BoxSdkError({
78
+ message:
79
+ 'Expecting "type" of type "HubDividerBlockV2025R0" to be defined',
80
+ });
81
+ }
82
+ const type: HubDividerBlockV2025R0TypeField =
83
+ deserializeHubDividerBlockV2025R0TypeField(val.type);
84
+ if (val.id == void 0) {
85
+ throw new BoxSdkError({
86
+ message: 'Expecting "id" of type "HubDividerBlockV2025R0" to be defined',
87
+ });
88
+ }
89
+ if (!sdIsString(val.id)) {
90
+ throw new BoxSdkError({
91
+ message: 'Expecting string for "id" of type "HubDividerBlockV2025R0"',
92
+ });
93
+ }
94
+ const id: string = val.id;
95
+ if (!(val.parent_id == void 0) && !sdIsString(val.parent_id)) {
96
+ throw new BoxSdkError({
97
+ message:
98
+ 'Expecting string for "parent_id" of type "HubDividerBlockV2025R0"',
99
+ });
100
+ }
101
+ const parentId: undefined | string =
102
+ val.parent_id == void 0 ? void 0 : val.parent_id;
103
+ return {
104
+ type: type,
105
+ id: id,
106
+ parentId: parentId,
107
+ } satisfies HubDividerBlockV2025R0;
108
+ }
@@ -0,0 +1,76 @@
1
+ import { serializeHubParagraphTextBlockV2025R0 } from './hubParagraphTextBlockV2025R0';
2
+ import { deserializeHubParagraphTextBlockV2025R0 } from './hubParagraphTextBlockV2025R0';
3
+ import { serializeHubSectionTitleTextBlockV2025R0 } from './hubSectionTitleTextBlockV2025R0';
4
+ import { deserializeHubSectionTitleTextBlockV2025R0 } from './hubSectionTitleTextBlockV2025R0';
5
+ import { serializeHubCalloutBoxTextBlockV2025R0 } from './hubCalloutBoxTextBlockV2025R0';
6
+ import { deserializeHubCalloutBoxTextBlockV2025R0 } from './hubCalloutBoxTextBlockV2025R0';
7
+ import { serializeHubItemListBlockV2025R0 } from './hubItemListBlockV2025R0';
8
+ import { deserializeHubItemListBlockV2025R0 } from './hubItemListBlockV2025R0';
9
+ import { serializeHubDividerBlockV2025R0 } from './hubDividerBlockV2025R0';
10
+ import { deserializeHubDividerBlockV2025R0 } from './hubDividerBlockV2025R0';
11
+ import { HubParagraphTextBlockV2025R0 } from './hubParagraphTextBlockV2025R0';
12
+ import { HubSectionTitleTextBlockV2025R0 } from './hubSectionTitleTextBlockV2025R0';
13
+ import { HubCalloutBoxTextBlockV2025R0 } from './hubCalloutBoxTextBlockV2025R0';
14
+ import { HubItemListBlockV2025R0 } from './hubItemListBlockV2025R0';
15
+ import { HubDividerBlockV2025R0 } from './hubDividerBlockV2025R0';
16
+ import { BoxSdkError } from '../../box/errors';
17
+ import { SerializedData } from '../../serialization/json';
18
+ import { sdIsEmpty } from '../../serialization/json';
19
+ import { sdIsBoolean } from '../../serialization/json';
20
+ import { sdIsNumber } from '../../serialization/json';
21
+ import { sdIsString } from '../../serialization/json';
22
+ import { sdIsList } from '../../serialization/json';
23
+ import { sdIsMap } from '../../serialization/json';
24
+ export type HubDocumentBlockEntryV2025R0 =
25
+ | HubParagraphTextBlockV2025R0
26
+ | HubSectionTitleTextBlockV2025R0
27
+ | HubCalloutBoxTextBlockV2025R0
28
+ | HubItemListBlockV2025R0
29
+ | HubDividerBlockV2025R0;
30
+ export function serializeHubDocumentBlockEntryV2025R0(
31
+ val: any,
32
+ ): SerializedData {
33
+ if (val.type == 'paragraph') {
34
+ return serializeHubParagraphTextBlockV2025R0(val);
35
+ }
36
+ if (val.type == 'section_title') {
37
+ return serializeHubSectionTitleTextBlockV2025R0(val);
38
+ }
39
+ if (val.type == 'callout_box') {
40
+ return serializeHubCalloutBoxTextBlockV2025R0(val);
41
+ }
42
+ if (val.type == 'item_list') {
43
+ return serializeHubItemListBlockV2025R0(val);
44
+ }
45
+ if (val.type == 'divider') {
46
+ return serializeHubDividerBlockV2025R0(val);
47
+ }
48
+ throw new BoxSdkError({ message: 'unknown type' });
49
+ }
50
+ export function deserializeHubDocumentBlockEntryV2025R0(
51
+ val: SerializedData,
52
+ ): HubDocumentBlockEntryV2025R0 {
53
+ if (!sdIsMap(val)) {
54
+ throw new BoxSdkError({
55
+ message: 'Expecting a map for "HubDocumentBlockEntryV2025R0"',
56
+ });
57
+ }
58
+ if (val.type == 'paragraph') {
59
+ return deserializeHubParagraphTextBlockV2025R0(val);
60
+ }
61
+ if (val.type == 'section_title') {
62
+ return deserializeHubSectionTitleTextBlockV2025R0(val);
63
+ }
64
+ if (val.type == 'callout_box') {
65
+ return deserializeHubCalloutBoxTextBlockV2025R0(val);
66
+ }
67
+ if (val.type == 'item_list') {
68
+ return deserializeHubItemListBlockV2025R0(val);
69
+ }
70
+ if (val.type == 'divider') {
71
+ return deserializeHubDividerBlockV2025R0(val);
72
+ }
73
+ throw new BoxSdkError({
74
+ message: "Can't deserialize HubDocumentBlockEntryV2025R0",
75
+ });
76
+ }
@@ -0,0 +1,51 @@
1
+ import { BoxSdkError } from '../../box/errors';
2
+ import { SerializedData } from '../../serialization/json';
3
+ import { sdIsEmpty } from '../../serialization/json';
4
+ import { sdIsBoolean } from '../../serialization/json';
5
+ import { sdIsNumber } from '../../serialization/json';
6
+ import { sdIsString } from '../../serialization/json';
7
+ import { sdIsList } from '../../serialization/json';
8
+ import { sdIsMap } from '../../serialization/json';
9
+ export interface HubDocumentBlockV2025R0 {
10
+ /**
11
+ * The unique identifier for this block. */
12
+ readonly id: string;
13
+ /**
14
+ * The unique identifier of the parent block. Null for direct children of the page. */
15
+ readonly parentId?: string | null;
16
+ readonly rawData?: SerializedData;
17
+ }
18
+ export function serializeHubDocumentBlockV2025R0(
19
+ val: HubDocumentBlockV2025R0,
20
+ ): SerializedData {
21
+ return { ['id']: val.id, ['parent_id']: val.parentId };
22
+ }
23
+ export function deserializeHubDocumentBlockV2025R0(
24
+ val: SerializedData,
25
+ ): HubDocumentBlockV2025R0 {
26
+ if (!sdIsMap(val)) {
27
+ throw new BoxSdkError({
28
+ message: 'Expecting a map for "HubDocumentBlockV2025R0"',
29
+ });
30
+ }
31
+ if (val.id == void 0) {
32
+ throw new BoxSdkError({
33
+ message: 'Expecting "id" of type "HubDocumentBlockV2025R0" to be defined',
34
+ });
35
+ }
36
+ if (!sdIsString(val.id)) {
37
+ throw new BoxSdkError({
38
+ message: 'Expecting string for "id" of type "HubDocumentBlockV2025R0"',
39
+ });
40
+ }
41
+ const id: string = val.id;
42
+ if (!(val.parent_id == void 0) && !sdIsString(val.parent_id)) {
43
+ throw new BoxSdkError({
44
+ message:
45
+ 'Expecting string for "parent_id" of type "HubDocumentBlockV2025R0"',
46
+ });
47
+ }
48
+ const parentId: undefined | string =
49
+ val.parent_id == void 0 ? void 0 : val.parent_id;
50
+ return { id: id, parentId: parentId } satisfies HubDocumentBlockV2025R0;
51
+ }
@@ -0,0 +1,238 @@
1
+ import { serializeHubParagraphTextBlockV2025R0 } from './hubParagraphTextBlockV2025R0';
2
+ import { deserializeHubParagraphTextBlockV2025R0 } from './hubParagraphTextBlockV2025R0';
3
+ import { serializeHubSectionTitleTextBlockV2025R0 } from './hubSectionTitleTextBlockV2025R0';
4
+ import { deserializeHubSectionTitleTextBlockV2025R0 } from './hubSectionTitleTextBlockV2025R0';
5
+ import { serializeHubCalloutBoxTextBlockV2025R0 } from './hubCalloutBoxTextBlockV2025R0';
6
+ import { deserializeHubCalloutBoxTextBlockV2025R0 } from './hubCalloutBoxTextBlockV2025R0';
7
+ import { serializeHubItemListBlockV2025R0 } from './hubItemListBlockV2025R0';
8
+ import { deserializeHubItemListBlockV2025R0 } from './hubItemListBlockV2025R0';
9
+ import { serializeHubDividerBlockV2025R0 } from './hubDividerBlockV2025R0';
10
+ import { deserializeHubDividerBlockV2025R0 } from './hubDividerBlockV2025R0';
11
+ import { serializeHubDocumentBlockEntryV2025R0 } from './hubDocumentBlockEntryV2025R0';
12
+ import { deserializeHubDocumentBlockEntryV2025R0 } from './hubDocumentBlockEntryV2025R0';
13
+ import { HubParagraphTextBlockV2025R0 } from './hubParagraphTextBlockV2025R0';
14
+ import { HubSectionTitleTextBlockV2025R0 } from './hubSectionTitleTextBlockV2025R0';
15
+ import { HubCalloutBoxTextBlockV2025R0 } from './hubCalloutBoxTextBlockV2025R0';
16
+ import { HubItemListBlockV2025R0 } from './hubItemListBlockV2025R0';
17
+ import { HubDividerBlockV2025R0 } from './hubDividerBlockV2025R0';
18
+ import { HubDocumentBlockEntryV2025R0 } from './hubDocumentBlockEntryV2025R0';
19
+ import { BoxSdkError } from '../../box/errors';
20
+ import { SerializedData } from '../../serialization/json';
21
+ import { sdIsEmpty } from '../../serialization/json';
22
+ import { sdIsBoolean } from '../../serialization/json';
23
+ import { sdIsNumber } from '../../serialization/json';
24
+ import { sdIsString } from '../../serialization/json';
25
+ import { sdIsList } from '../../serialization/json';
26
+ import { sdIsMap } from '../../serialization/json';
27
+ export type HubDocumentBlocksV2025R0TypeField = 'document_blocks';
28
+ export class HubDocumentBlocksV2025R0 {
29
+ /**
30
+ * Ordered list of blocks. */
31
+ readonly entries!: readonly HubDocumentBlockEntryV2025R0[];
32
+ /**
33
+ * The value will always be `document_blocks`. */
34
+ readonly type: HubDocumentBlocksV2025R0TypeField =
35
+ 'document_blocks' as HubDocumentBlocksV2025R0TypeField;
36
+ /**
37
+ * The limit that was used for these entries. This will be the same as the
38
+ * `limit` query parameter unless that value exceeded the maximum value
39
+ * allowed. The maximum value varies by API. */
40
+ readonly limit?: number;
41
+ /**
42
+ * The marker for the start of the next page of results. */
43
+ readonly nextMarker?: string | null;
44
+ readonly rawData?: SerializedData;
45
+ constructor(
46
+ fields: Omit<HubDocumentBlocksV2025R0, 'type'> &
47
+ Partial<Pick<HubDocumentBlocksV2025R0, 'type'>>,
48
+ ) {
49
+ if (fields.entries !== undefined) {
50
+ this.entries = fields.entries;
51
+ }
52
+ if (fields.type !== undefined) {
53
+ this.type = fields.type;
54
+ }
55
+ if (fields.limit !== undefined) {
56
+ this.limit = fields.limit;
57
+ }
58
+ if (fields.nextMarker !== undefined) {
59
+ this.nextMarker = fields.nextMarker;
60
+ }
61
+ if (fields.rawData !== undefined) {
62
+ this.rawData = fields.rawData;
63
+ }
64
+ }
65
+ }
66
+ export interface HubDocumentBlocksV2025R0Input {
67
+ /**
68
+ * Ordered list of blocks. */
69
+ readonly entries: readonly HubDocumentBlockEntryV2025R0[];
70
+ /**
71
+ * The value will always be `document_blocks`. */
72
+ readonly type?: HubDocumentBlocksV2025R0TypeField;
73
+ /**
74
+ * The limit that was used for these entries. This will be the same as the
75
+ * `limit` query parameter unless that value exceeded the maximum value
76
+ * allowed. The maximum value varies by API. */
77
+ readonly limit?: number;
78
+ /**
79
+ * The marker for the start of the next page of results. */
80
+ readonly nextMarker?: string | null;
81
+ readonly rawData?: SerializedData;
82
+ }
83
+ export function serializeHubDocumentBlocksV2025R0TypeField(
84
+ val: HubDocumentBlocksV2025R0TypeField,
85
+ ): SerializedData {
86
+ return val;
87
+ }
88
+ export function deserializeHubDocumentBlocksV2025R0TypeField(
89
+ val: SerializedData,
90
+ ): HubDocumentBlocksV2025R0TypeField {
91
+ if (val == 'document_blocks') {
92
+ return val;
93
+ }
94
+ throw new BoxSdkError({
95
+ message: "Can't deserialize HubDocumentBlocksV2025R0TypeField",
96
+ });
97
+ }
98
+ export function serializeHubDocumentBlocksV2025R0(
99
+ val: HubDocumentBlocksV2025R0,
100
+ ): SerializedData {
101
+ return {
102
+ ['entries']: val.entries.map(function (
103
+ item: HubDocumentBlockEntryV2025R0,
104
+ ): SerializedData {
105
+ return serializeHubDocumentBlockEntryV2025R0(item);
106
+ }) as readonly any[],
107
+ ['type']: serializeHubDocumentBlocksV2025R0TypeField(val.type),
108
+ ['limit']: val.limit,
109
+ ['next_marker']: val.nextMarker,
110
+ };
111
+ }
112
+ export function deserializeHubDocumentBlocksV2025R0(
113
+ val: SerializedData,
114
+ ): HubDocumentBlocksV2025R0 {
115
+ if (!sdIsMap(val)) {
116
+ throw new BoxSdkError({
117
+ message: 'Expecting a map for "HubDocumentBlocksV2025R0"',
118
+ });
119
+ }
120
+ if (val.entries == void 0) {
121
+ throw new BoxSdkError({
122
+ message:
123
+ 'Expecting "entries" of type "HubDocumentBlocksV2025R0" to be defined',
124
+ });
125
+ }
126
+ if (!sdIsList(val.entries)) {
127
+ throw new BoxSdkError({
128
+ message:
129
+ 'Expecting array for "entries" of type "HubDocumentBlocksV2025R0"',
130
+ });
131
+ }
132
+ const entries: readonly HubDocumentBlockEntryV2025R0[] = sdIsList(val.entries)
133
+ ? (val.entries.map(function (
134
+ itm: SerializedData,
135
+ ): HubDocumentBlockEntryV2025R0 {
136
+ return deserializeHubDocumentBlockEntryV2025R0(itm);
137
+ }) as readonly any[])
138
+ : [];
139
+ if (val.type == void 0) {
140
+ throw new BoxSdkError({
141
+ message:
142
+ 'Expecting "type" of type "HubDocumentBlocksV2025R0" to be defined',
143
+ });
144
+ }
145
+ const type: HubDocumentBlocksV2025R0TypeField =
146
+ deserializeHubDocumentBlocksV2025R0TypeField(val.type);
147
+ if (!(val.limit == void 0) && !sdIsNumber(val.limit)) {
148
+ throw new BoxSdkError({
149
+ message:
150
+ 'Expecting number for "limit" of type "HubDocumentBlocksV2025R0"',
151
+ });
152
+ }
153
+ const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit;
154
+ if (!(val.next_marker == void 0) && !sdIsString(val.next_marker)) {
155
+ throw new BoxSdkError({
156
+ message:
157
+ 'Expecting string for "next_marker" of type "HubDocumentBlocksV2025R0"',
158
+ });
159
+ }
160
+ const nextMarker: undefined | string =
161
+ val.next_marker == void 0 ? void 0 : val.next_marker;
162
+ return {
163
+ entries: entries,
164
+ type: type,
165
+ limit: limit,
166
+ nextMarker: nextMarker,
167
+ } satisfies HubDocumentBlocksV2025R0;
168
+ }
169
+ export function serializeHubDocumentBlocksV2025R0Input(
170
+ val: HubDocumentBlocksV2025R0Input,
171
+ ): SerializedData {
172
+ return {
173
+ ['entries']: val.entries.map(function (
174
+ item: HubDocumentBlockEntryV2025R0,
175
+ ): SerializedData {
176
+ return serializeHubDocumentBlockEntryV2025R0(item);
177
+ }) as readonly any[],
178
+ ['type']:
179
+ val.type == void 0
180
+ ? val.type
181
+ : serializeHubDocumentBlocksV2025R0TypeField(val.type),
182
+ ['limit']: val.limit,
183
+ ['next_marker']: val.nextMarker,
184
+ };
185
+ }
186
+ export function deserializeHubDocumentBlocksV2025R0Input(
187
+ val: SerializedData,
188
+ ): HubDocumentBlocksV2025R0Input {
189
+ if (!sdIsMap(val)) {
190
+ throw new BoxSdkError({
191
+ message: 'Expecting a map for "HubDocumentBlocksV2025R0Input"',
192
+ });
193
+ }
194
+ if (val.entries == void 0) {
195
+ throw new BoxSdkError({
196
+ message:
197
+ 'Expecting "entries" of type "HubDocumentBlocksV2025R0Input" to be defined',
198
+ });
199
+ }
200
+ if (!sdIsList(val.entries)) {
201
+ throw new BoxSdkError({
202
+ message:
203
+ 'Expecting array for "entries" of type "HubDocumentBlocksV2025R0Input"',
204
+ });
205
+ }
206
+ const entries: readonly HubDocumentBlockEntryV2025R0[] = sdIsList(val.entries)
207
+ ? (val.entries.map(function (
208
+ itm: SerializedData,
209
+ ): HubDocumentBlockEntryV2025R0 {
210
+ return deserializeHubDocumentBlockEntryV2025R0(itm);
211
+ }) as readonly any[])
212
+ : [];
213
+ const type: undefined | HubDocumentBlocksV2025R0TypeField =
214
+ val.type == void 0
215
+ ? void 0
216
+ : deserializeHubDocumentBlocksV2025R0TypeField(val.type);
217
+ if (!(val.limit == void 0) && !sdIsNumber(val.limit)) {
218
+ throw new BoxSdkError({
219
+ message:
220
+ 'Expecting number for "limit" of type "HubDocumentBlocksV2025R0Input"',
221
+ });
222
+ }
223
+ const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit;
224
+ if (!(val.next_marker == void 0) && !sdIsString(val.next_marker)) {
225
+ throw new BoxSdkError({
226
+ message:
227
+ 'Expecting string for "next_marker" of type "HubDocumentBlocksV2025R0Input"',
228
+ });
229
+ }
230
+ const nextMarker: undefined | string =
231
+ val.next_marker == void 0 ? void 0 : val.next_marker;
232
+ return {
233
+ entries: entries,
234
+ type: type,
235
+ limit: limit,
236
+ nextMarker: nextMarker,
237
+ } satisfies HubDocumentBlocksV2025R0Input;
238
+ }