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.
- package/lib/bundle.js +655 -10
- package/lib/bundle.js.map +1 -1
- package/lib/client.d.ts +3 -1
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +5 -0
- package/lib/client.js.map +1 -1
- package/lib/managers/hubDocument.d.ts +133 -0
- package/lib/managers/hubDocument.d.ts.map +1 -0
- package/lib/managers/hubDocument.js +162 -0
- package/lib/managers/hubDocument.js.map +1 -0
- package/lib/managers/hubItems.d.ts +7 -0
- package/lib/managers/hubItems.d.ts.map +1 -1
- package/lib/managers/hubItems.js +1 -0
- package/lib/managers/hubItems.js.map +1 -1
- package/lib/managers/index.d.ts +1 -0
- package/lib/managers/index.d.ts.map +1 -1
- package/lib/managers/index.js +1 -0
- package/lib/managers/index.js.map +1 -1
- package/lib/managers/search.d.ts +1 -1
- package/lib/managers/search.d.ts.map +1 -1
- package/lib/managers/search.js +1 -1
- package/lib/managers/search.js.map +1 -1
- package/lib/managers/trashedItems.d.ts +2 -0
- package/lib/managers/trashedItems.d.ts.map +1 -1
- package/lib/managers/trashedItems.js +2 -0
- package/lib/managers/trashedItems.js.map +1 -1
- package/lib/networking/version.d.ts +1 -1
- package/lib/networking/version.js +1 -1
- package/lib/schemas/aiAgentBasicTextToolBase.d.ts +1 -1
- package/lib/schemas/aiAgentBasicTextToolBase.d.ts.map +1 -1
- package/lib/schemas/aiAgentSpreadsheetTool.d.ts +1 -1
- package/lib/schemas/aiAgentSpreadsheetTool.d.ts.map +1 -1
- package/lib/schemas/aiExtractStructured.d.ts +3 -0
- package/lib/schemas/aiExtractStructured.d.ts.map +1 -1
- package/lib/schemas/aiExtractStructured.js +9 -0
- package/lib/schemas/aiExtractStructured.js.map +1 -1
- package/lib/schemas/aiExtractStructuredResponse.d.ts +5 -0
- package/lib/schemas/aiExtractStructuredResponse.d.ts.map +1 -1
- package/lib/schemas/aiExtractStructuredResponse.js +24 -0
- package/lib/schemas/aiExtractStructuredResponse.js.map +1 -1
- package/lib/schemas/index.d.ts +5 -5
- package/lib/schemas/index.d.ts.map +1 -1
- package/lib/schemas/index.js +5 -5
- package/lib/schemas/index.js.map +1 -1
- package/lib/schemas/legalHoldPolicyAssignedItem.d.ts +13 -5
- package/lib/schemas/legalHoldPolicyAssignedItem.d.ts.map +1 -1
- package/lib/schemas/legalHoldPolicyAssignedItem.js +47 -24
- package/lib/schemas/legalHoldPolicyAssignedItem.js.map +1 -1
- package/lib/schemas/legalHoldPolicyAssignment.d.ts.map +1 -1
- package/lib/schemas/legalHoldPolicyAssignment.js.map +1 -1
- package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.d.ts +20 -0
- package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js +105 -0
- package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/hubDividerBlockV2025R0.d.ts +17 -0
- package/lib/schemas/v2025R0/hubDividerBlockV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubDividerBlockV2025R0.js +87 -0
- package/lib/schemas/v2025R0/hubDividerBlockV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.d.ts +10 -0
- package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js +60 -0
- package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.d.ts +13 -0
- package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.js +36 -0
- package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.d.ts +45 -0
- package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.js +162 -0
- package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentPageV2025R0.d.ts +19 -0
- package/lib/schemas/v2025R0/hubDocumentPageV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentPageV2025R0.js +68 -0
- package/lib/schemas/v2025R0/hubDocumentPageV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.d.ts +45 -0
- package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.js +162 -0
- package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/hubItemListBlockV2025R0.d.ts +17 -0
- package/lib/schemas/v2025R0/hubItemListBlockV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubItemListBlockV2025R0.js +87 -0
- package/lib/schemas/v2025R0/hubItemListBlockV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.d.ts +3 -0
- package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.d.ts.map +1 -1
- package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.js +8 -0
- package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.js.map +1 -1
- package/lib/schemas/v2025R0/hubItemOperationV2025R0.d.ts +3 -0
- package/lib/schemas/v2025R0/hubItemOperationV2025R0.d.ts.map +1 -1
- package/lib/schemas/v2025R0/hubItemOperationV2025R0.js +12 -1
- package/lib/schemas/v2025R0/hubItemOperationV2025R0.js.map +1 -1
- package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.d.ts +20 -0
- package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.js +105 -0
- package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.d.ts +20 -0
- package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js +105 -0
- package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/index.d.ts +10 -0
- package/lib/schemas/v2025R0/index.d.ts.map +1 -1
- package/lib/schemas/v2025R0/index.js +10 -0
- package/lib/schemas/v2025R0/index.js.map +1 -1
- package/lib-esm/client.d.ts +3 -1
- package/lib-esm/client.js +6 -0
- package/lib-esm/client.js.map +1 -1
- package/lib-esm/managers/hubDocument.d.ts +132 -0
- package/lib-esm/managers/hubDocument.js +154 -0
- package/lib-esm/managers/hubDocument.js.map +1 -0
- package/lib-esm/managers/hubItems.d.ts +7 -0
- package/lib-esm/managers/hubItems.js +1 -0
- package/lib-esm/managers/hubItems.js.map +1 -1
- package/lib-esm/managers/index.d.ts +1 -0
- package/lib-esm/managers/index.js +1 -0
- package/lib-esm/managers/index.js.map +1 -1
- package/lib-esm/managers/search.d.ts +1 -1
- package/lib-esm/managers/search.js +1 -1
- package/lib-esm/managers/search.js.map +1 -1
- package/lib-esm/managers/trashedItems.d.ts +2 -0
- package/lib-esm/managers/trashedItems.js +2 -0
- package/lib-esm/managers/trashedItems.js.map +1 -1
- package/lib-esm/networking/version.d.ts +1 -1
- package/lib-esm/networking/version.js +1 -1
- package/lib-esm/schemas/aiAgentBasicTextToolBase.d.ts +1 -1
- package/lib-esm/schemas/aiAgentSpreadsheetTool.d.ts +1 -1
- package/lib-esm/schemas/aiExtractStructured.d.ts +3 -0
- package/lib-esm/schemas/aiExtractStructured.js +9 -0
- package/lib-esm/schemas/aiExtractStructured.js.map +1 -1
- package/lib-esm/schemas/aiExtractStructuredResponse.d.ts +5 -0
- package/lib-esm/schemas/aiExtractStructuredResponse.js +24 -0
- package/lib-esm/schemas/aiExtractStructuredResponse.js.map +1 -1
- package/lib-esm/schemas/index.d.ts +5 -5
- package/lib-esm/schemas/index.js +5 -5
- package/lib-esm/schemas/index.js.map +1 -1
- package/lib-esm/schemas/legalHoldPolicyAssignedItem.d.ts +13 -5
- package/lib-esm/schemas/legalHoldPolicyAssignedItem.js +44 -23
- package/lib-esm/schemas/legalHoldPolicyAssignedItem.js.map +1 -1
- package/lib-esm/schemas/legalHoldPolicyAssignment.js.map +1 -1
- package/lib-esm/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.d.ts +19 -0
- package/lib-esm/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js +106 -0
- package/lib-esm/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/hubDividerBlockV2025R0.d.ts +16 -0
- package/lib-esm/schemas/v2025R0/hubDividerBlockV2025R0.js +85 -0
- package/lib-esm/schemas/v2025R0/hubDividerBlockV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/hubDocumentBlockEntryV2025R0.d.ts +9 -0
- package/lib-esm/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js +56 -0
- package/lib-esm/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/hubDocumentBlockV2025R0.d.ts +12 -0
- package/lib-esm/schemas/v2025R0/hubDocumentBlockV2025R0.js +32 -0
- package/lib-esm/schemas/v2025R0/hubDocumentBlockV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/hubDocumentBlocksV2025R0.d.ts +44 -0
- package/lib-esm/schemas/v2025R0/hubDocumentBlocksV2025R0.js +164 -0
- package/lib-esm/schemas/v2025R0/hubDocumentBlocksV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/hubDocumentPageV2025R0.d.ts +18 -0
- package/lib-esm/schemas/v2025R0/hubDocumentPageV2025R0.js +64 -0
- package/lib-esm/schemas/v2025R0/hubDocumentPageV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/hubDocumentPagesV2025R0.d.ts +44 -0
- package/lib-esm/schemas/v2025R0/hubDocumentPagesV2025R0.js +164 -0
- package/lib-esm/schemas/v2025R0/hubDocumentPagesV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/hubItemListBlockV2025R0.d.ts +16 -0
- package/lib-esm/schemas/v2025R0/hubItemListBlockV2025R0.js +85 -0
- package/lib-esm/schemas/v2025R0/hubItemListBlockV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/hubItemOperationResultV2025R0.d.ts +3 -0
- package/lib-esm/schemas/v2025R0/hubItemOperationResultV2025R0.js +8 -0
- package/lib-esm/schemas/v2025R0/hubItemOperationResultV2025R0.js.map +1 -1
- package/lib-esm/schemas/v2025R0/hubItemOperationV2025R0.d.ts +3 -0
- package/lib-esm/schemas/v2025R0/hubItemOperationV2025R0.js +12 -1
- package/lib-esm/schemas/v2025R0/hubItemOperationV2025R0.js.map +1 -1
- package/lib-esm/schemas/v2025R0/hubParagraphTextBlockV2025R0.d.ts +19 -0
- package/lib-esm/schemas/v2025R0/hubParagraphTextBlockV2025R0.js +106 -0
- package/lib-esm/schemas/v2025R0/hubParagraphTextBlockV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.d.ts +19 -0
- package/lib-esm/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js +106 -0
- package/lib-esm/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/index.d.ts +10 -0
- package/lib-esm/schemas/v2025R0/index.js +10 -0
- package/lib-esm/schemas/v2025R0/index.js.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +7 -0
- package/src/managers/hubDocument.ts +330 -0
- package/src/managers/hubItems.ts +8 -0
- package/src/managers/index.ts +1 -0
- package/src/managers/search.ts +2 -2
- package/src/managers/trashedItems.ts +2 -0
- package/src/networking/version.ts +1 -1
- package/src/schemas/aiAgentBasicTextToolBase.ts +1 -1
- package/src/schemas/aiAgentSpreadsheetTool.ts +1 -1
- package/src/schemas/aiExtractStructured.ts +16 -0
- package/src/schemas/aiExtractStructuredResponse.ts +44 -0
- package/src/schemas/index.ts +5 -5
- package/src/schemas/legalHoldPolicyAssignedItem.ts +69 -27
- package/src/schemas/legalHoldPolicyAssignment.ts +0 -9
- package/src/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.ts +133 -0
- package/src/schemas/v2025R0/hubDividerBlockV2025R0.ts +108 -0
- package/src/schemas/v2025R0/hubDocumentBlockEntryV2025R0.ts +76 -0
- package/src/schemas/v2025R0/hubDocumentBlockV2025R0.ts +51 -0
- package/src/schemas/v2025R0/hubDocumentBlocksV2025R0.ts +238 -0
- package/src/schemas/v2025R0/hubDocumentPageV2025R0.ts +92 -0
- package/src/schemas/v2025R0/hubDocumentPagesV2025R0.ts +218 -0
- package/src/schemas/v2025R0/hubItemListBlockV2025R0.ts +108 -0
- package/src/schemas/v2025R0/hubItemOperationResultV2025R0.ts +13 -0
- package/src/schemas/v2025R0/hubItemOperationV2025R0.ts +17 -1
- package/src/schemas/v2025R0/hubParagraphTextBlockV2025R0.ts +133 -0
- package/src/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.ts +133 -0
- package/src/schemas/v2025R0/index.ts +10 -0
- package/src/test/hubDocument.test.ts +91 -0
|
@@ -0,0 +1,92 @@
|
|
|
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 HubDocumentPageV2025R0 {
|
|
10
|
+
/**
|
|
11
|
+
* The unique identifier for this page. */
|
|
12
|
+
readonly id: string;
|
|
13
|
+
/**
|
|
14
|
+
* The type of this resource. The value is always `page`. */
|
|
15
|
+
readonly type: string;
|
|
16
|
+
/**
|
|
17
|
+
* The unique identifier of the parent page. Null for root-level pages. */
|
|
18
|
+
readonly parentId?: string | null;
|
|
19
|
+
/**
|
|
20
|
+
* The title text of the page. Includes rich text formatting. */
|
|
21
|
+
readonly titleFragment: string;
|
|
22
|
+
readonly rawData?: SerializedData;
|
|
23
|
+
}
|
|
24
|
+
export function serializeHubDocumentPageV2025R0(
|
|
25
|
+
val: HubDocumentPageV2025R0,
|
|
26
|
+
): SerializedData {
|
|
27
|
+
return {
|
|
28
|
+
['id']: val.id,
|
|
29
|
+
['type']: val.type,
|
|
30
|
+
['parent_id']: val.parentId,
|
|
31
|
+
['title_fragment']: val.titleFragment,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function deserializeHubDocumentPageV2025R0(
|
|
35
|
+
val: SerializedData,
|
|
36
|
+
): HubDocumentPageV2025R0 {
|
|
37
|
+
if (!sdIsMap(val)) {
|
|
38
|
+
throw new BoxSdkError({
|
|
39
|
+
message: 'Expecting a map for "HubDocumentPageV2025R0"',
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
if (val.id == void 0) {
|
|
43
|
+
throw new BoxSdkError({
|
|
44
|
+
message: 'Expecting "id" of type "HubDocumentPageV2025R0" to be defined',
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (!sdIsString(val.id)) {
|
|
48
|
+
throw new BoxSdkError({
|
|
49
|
+
message: 'Expecting string for "id" of type "HubDocumentPageV2025R0"',
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
const id: string = val.id;
|
|
53
|
+
if (val.type == void 0) {
|
|
54
|
+
throw new BoxSdkError({
|
|
55
|
+
message:
|
|
56
|
+
'Expecting "type" of type "HubDocumentPageV2025R0" to be defined',
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
if (!sdIsString(val.type)) {
|
|
60
|
+
throw new BoxSdkError({
|
|
61
|
+
message: 'Expecting string for "type" of type "HubDocumentPageV2025R0"',
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
const type: string = val.type;
|
|
65
|
+
if (!(val.parent_id == void 0) && !sdIsString(val.parent_id)) {
|
|
66
|
+
throw new BoxSdkError({
|
|
67
|
+
message:
|
|
68
|
+
'Expecting string for "parent_id" of type "HubDocumentPageV2025R0"',
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
const parentId: undefined | string =
|
|
72
|
+
val.parent_id == void 0 ? void 0 : val.parent_id;
|
|
73
|
+
if (val.title_fragment == void 0) {
|
|
74
|
+
throw new BoxSdkError({
|
|
75
|
+
message:
|
|
76
|
+
'Expecting "title_fragment" of type "HubDocumentPageV2025R0" to be defined',
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
if (!sdIsString(val.title_fragment)) {
|
|
80
|
+
throw new BoxSdkError({
|
|
81
|
+
message:
|
|
82
|
+
'Expecting string for "title_fragment" of type "HubDocumentPageV2025R0"',
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
const titleFragment: string = val.title_fragment;
|
|
86
|
+
return {
|
|
87
|
+
id: id,
|
|
88
|
+
type: type,
|
|
89
|
+
parentId: parentId,
|
|
90
|
+
titleFragment: titleFragment,
|
|
91
|
+
} satisfies HubDocumentPageV2025R0;
|
|
92
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { serializeHubDocumentPageV2025R0 } from './hubDocumentPageV2025R0';
|
|
2
|
+
import { deserializeHubDocumentPageV2025R0 } from './hubDocumentPageV2025R0';
|
|
3
|
+
import { HubDocumentPageV2025R0 } from './hubDocumentPageV2025R0';
|
|
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 HubDocumentPagesV2025R0TypeField = 'document_pages';
|
|
13
|
+
export class HubDocumentPagesV2025R0 {
|
|
14
|
+
/**
|
|
15
|
+
* Ordered list of pages. */
|
|
16
|
+
readonly entries!: readonly HubDocumentPageV2025R0[];
|
|
17
|
+
/**
|
|
18
|
+
* The value will always be `document_pages`. */
|
|
19
|
+
readonly type: HubDocumentPagesV2025R0TypeField =
|
|
20
|
+
'document_pages' as HubDocumentPagesV2025R0TypeField;
|
|
21
|
+
/**
|
|
22
|
+
* The limit that was used for these entries. This will be the same as the
|
|
23
|
+
* `limit` query parameter unless that value exceeded the maximum value
|
|
24
|
+
* allowed. The maximum value varies by API. */
|
|
25
|
+
readonly limit?: number;
|
|
26
|
+
/**
|
|
27
|
+
* The marker for the start of the next page of results. */
|
|
28
|
+
readonly nextMarker?: string | null;
|
|
29
|
+
readonly rawData?: SerializedData;
|
|
30
|
+
constructor(
|
|
31
|
+
fields: Omit<HubDocumentPagesV2025R0, 'type'> &
|
|
32
|
+
Partial<Pick<HubDocumentPagesV2025R0, 'type'>>,
|
|
33
|
+
) {
|
|
34
|
+
if (fields.entries !== undefined) {
|
|
35
|
+
this.entries = fields.entries;
|
|
36
|
+
}
|
|
37
|
+
if (fields.type !== undefined) {
|
|
38
|
+
this.type = fields.type;
|
|
39
|
+
}
|
|
40
|
+
if (fields.limit !== undefined) {
|
|
41
|
+
this.limit = fields.limit;
|
|
42
|
+
}
|
|
43
|
+
if (fields.nextMarker !== undefined) {
|
|
44
|
+
this.nextMarker = fields.nextMarker;
|
|
45
|
+
}
|
|
46
|
+
if (fields.rawData !== undefined) {
|
|
47
|
+
this.rawData = fields.rawData;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export interface HubDocumentPagesV2025R0Input {
|
|
52
|
+
/**
|
|
53
|
+
* Ordered list of pages. */
|
|
54
|
+
readonly entries: readonly HubDocumentPageV2025R0[];
|
|
55
|
+
/**
|
|
56
|
+
* The value will always be `document_pages`. */
|
|
57
|
+
readonly type?: HubDocumentPagesV2025R0TypeField;
|
|
58
|
+
/**
|
|
59
|
+
* The limit that was used for these entries. This will be the same as the
|
|
60
|
+
* `limit` query parameter unless that value exceeded the maximum value
|
|
61
|
+
* allowed. The maximum value varies by API. */
|
|
62
|
+
readonly limit?: number;
|
|
63
|
+
/**
|
|
64
|
+
* The marker for the start of the next page of results. */
|
|
65
|
+
readonly nextMarker?: string | null;
|
|
66
|
+
readonly rawData?: SerializedData;
|
|
67
|
+
}
|
|
68
|
+
export function serializeHubDocumentPagesV2025R0TypeField(
|
|
69
|
+
val: HubDocumentPagesV2025R0TypeField,
|
|
70
|
+
): SerializedData {
|
|
71
|
+
return val;
|
|
72
|
+
}
|
|
73
|
+
export function deserializeHubDocumentPagesV2025R0TypeField(
|
|
74
|
+
val: SerializedData,
|
|
75
|
+
): HubDocumentPagesV2025R0TypeField {
|
|
76
|
+
if (val == 'document_pages') {
|
|
77
|
+
return val;
|
|
78
|
+
}
|
|
79
|
+
throw new BoxSdkError({
|
|
80
|
+
message: "Can't deserialize HubDocumentPagesV2025R0TypeField",
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
export function serializeHubDocumentPagesV2025R0(
|
|
84
|
+
val: HubDocumentPagesV2025R0,
|
|
85
|
+
): SerializedData {
|
|
86
|
+
return {
|
|
87
|
+
['entries']: val.entries.map(function (
|
|
88
|
+
item: HubDocumentPageV2025R0,
|
|
89
|
+
): SerializedData {
|
|
90
|
+
return serializeHubDocumentPageV2025R0(item);
|
|
91
|
+
}) as readonly any[],
|
|
92
|
+
['type']: serializeHubDocumentPagesV2025R0TypeField(val.type),
|
|
93
|
+
['limit']: val.limit,
|
|
94
|
+
['next_marker']: val.nextMarker,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export function deserializeHubDocumentPagesV2025R0(
|
|
98
|
+
val: SerializedData,
|
|
99
|
+
): HubDocumentPagesV2025R0 {
|
|
100
|
+
if (!sdIsMap(val)) {
|
|
101
|
+
throw new BoxSdkError({
|
|
102
|
+
message: 'Expecting a map for "HubDocumentPagesV2025R0"',
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
if (val.entries == void 0) {
|
|
106
|
+
throw new BoxSdkError({
|
|
107
|
+
message:
|
|
108
|
+
'Expecting "entries" of type "HubDocumentPagesV2025R0" to be defined',
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
if (!sdIsList(val.entries)) {
|
|
112
|
+
throw new BoxSdkError({
|
|
113
|
+
message:
|
|
114
|
+
'Expecting array for "entries" of type "HubDocumentPagesV2025R0"',
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
const entries: readonly HubDocumentPageV2025R0[] = sdIsList(val.entries)
|
|
118
|
+
? (val.entries.map(function (itm: SerializedData): HubDocumentPageV2025R0 {
|
|
119
|
+
return deserializeHubDocumentPageV2025R0(itm);
|
|
120
|
+
}) as readonly any[])
|
|
121
|
+
: [];
|
|
122
|
+
if (val.type == void 0) {
|
|
123
|
+
throw new BoxSdkError({
|
|
124
|
+
message:
|
|
125
|
+
'Expecting "type" of type "HubDocumentPagesV2025R0" to be defined',
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
const type: HubDocumentPagesV2025R0TypeField =
|
|
129
|
+
deserializeHubDocumentPagesV2025R0TypeField(val.type);
|
|
130
|
+
if (!(val.limit == void 0) && !sdIsNumber(val.limit)) {
|
|
131
|
+
throw new BoxSdkError({
|
|
132
|
+
message: 'Expecting number for "limit" of type "HubDocumentPagesV2025R0"',
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit;
|
|
136
|
+
if (!(val.next_marker == void 0) && !sdIsString(val.next_marker)) {
|
|
137
|
+
throw new BoxSdkError({
|
|
138
|
+
message:
|
|
139
|
+
'Expecting string for "next_marker" of type "HubDocumentPagesV2025R0"',
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
const nextMarker: undefined | string =
|
|
143
|
+
val.next_marker == void 0 ? void 0 : val.next_marker;
|
|
144
|
+
return {
|
|
145
|
+
entries: entries,
|
|
146
|
+
type: type,
|
|
147
|
+
limit: limit,
|
|
148
|
+
nextMarker: nextMarker,
|
|
149
|
+
} satisfies HubDocumentPagesV2025R0;
|
|
150
|
+
}
|
|
151
|
+
export function serializeHubDocumentPagesV2025R0Input(
|
|
152
|
+
val: HubDocumentPagesV2025R0Input,
|
|
153
|
+
): SerializedData {
|
|
154
|
+
return {
|
|
155
|
+
['entries']: val.entries.map(function (
|
|
156
|
+
item: HubDocumentPageV2025R0,
|
|
157
|
+
): SerializedData {
|
|
158
|
+
return serializeHubDocumentPageV2025R0(item);
|
|
159
|
+
}) as readonly any[],
|
|
160
|
+
['type']:
|
|
161
|
+
val.type == void 0
|
|
162
|
+
? val.type
|
|
163
|
+
: serializeHubDocumentPagesV2025R0TypeField(val.type),
|
|
164
|
+
['limit']: val.limit,
|
|
165
|
+
['next_marker']: val.nextMarker,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
export function deserializeHubDocumentPagesV2025R0Input(
|
|
169
|
+
val: SerializedData,
|
|
170
|
+
): HubDocumentPagesV2025R0Input {
|
|
171
|
+
if (!sdIsMap(val)) {
|
|
172
|
+
throw new BoxSdkError({
|
|
173
|
+
message: 'Expecting a map for "HubDocumentPagesV2025R0Input"',
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
if (val.entries == void 0) {
|
|
177
|
+
throw new BoxSdkError({
|
|
178
|
+
message:
|
|
179
|
+
'Expecting "entries" of type "HubDocumentPagesV2025R0Input" to be defined',
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
if (!sdIsList(val.entries)) {
|
|
183
|
+
throw new BoxSdkError({
|
|
184
|
+
message:
|
|
185
|
+
'Expecting array for "entries" of type "HubDocumentPagesV2025R0Input"',
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
const entries: readonly HubDocumentPageV2025R0[] = sdIsList(val.entries)
|
|
189
|
+
? (val.entries.map(function (itm: SerializedData): HubDocumentPageV2025R0 {
|
|
190
|
+
return deserializeHubDocumentPageV2025R0(itm);
|
|
191
|
+
}) as readonly any[])
|
|
192
|
+
: [];
|
|
193
|
+
const type: undefined | HubDocumentPagesV2025R0TypeField =
|
|
194
|
+
val.type == void 0
|
|
195
|
+
? void 0
|
|
196
|
+
: deserializeHubDocumentPagesV2025R0TypeField(val.type);
|
|
197
|
+
if (!(val.limit == void 0) && !sdIsNumber(val.limit)) {
|
|
198
|
+
throw new BoxSdkError({
|
|
199
|
+
message:
|
|
200
|
+
'Expecting number for "limit" of type "HubDocumentPagesV2025R0Input"',
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit;
|
|
204
|
+
if (!(val.next_marker == void 0) && !sdIsString(val.next_marker)) {
|
|
205
|
+
throw new BoxSdkError({
|
|
206
|
+
message:
|
|
207
|
+
'Expecting string for "next_marker" of type "HubDocumentPagesV2025R0Input"',
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
const nextMarker: undefined | string =
|
|
211
|
+
val.next_marker == void 0 ? void 0 : val.next_marker;
|
|
212
|
+
return {
|
|
213
|
+
entries: entries,
|
|
214
|
+
type: type,
|
|
215
|
+
limit: limit,
|
|
216
|
+
nextMarker: nextMarker,
|
|
217
|
+
} satisfies HubDocumentPagesV2025R0Input;
|
|
218
|
+
}
|
|
@@ -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 HubItemListBlockV2025R0TypeField = 'item_list';
|
|
13
|
+
export class HubItemListBlockV2025R0 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 `item_list`. */
|
|
19
|
+
readonly type: HubItemListBlockV2025R0TypeField =
|
|
20
|
+
'item_list' as HubItemListBlockV2025R0TypeField;
|
|
21
|
+
constructor(
|
|
22
|
+
fields: Omit<HubItemListBlockV2025R0, 'type'> &
|
|
23
|
+
Partial<Pick<HubItemListBlockV2025R0, '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 serializeHubItemListBlockV2025R0TypeField(
|
|
40
|
+
val: HubItemListBlockV2025R0TypeField,
|
|
41
|
+
): SerializedData {
|
|
42
|
+
return val;
|
|
43
|
+
}
|
|
44
|
+
export function deserializeHubItemListBlockV2025R0TypeField(
|
|
45
|
+
val: SerializedData,
|
|
46
|
+
): HubItemListBlockV2025R0TypeField {
|
|
47
|
+
if (val == 'item_list') {
|
|
48
|
+
return val;
|
|
49
|
+
}
|
|
50
|
+
throw new BoxSdkError({
|
|
51
|
+
message: "Can't deserialize HubItemListBlockV2025R0TypeField",
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
export function serializeHubItemListBlockV2025R0(
|
|
55
|
+
val: HubItemListBlockV2025R0,
|
|
56
|
+
): SerializedData {
|
|
57
|
+
const base: any = serializeHubDocumentBlockV2025R0(val);
|
|
58
|
+
if (!sdIsMap(base)) {
|
|
59
|
+
throw new BoxSdkError({
|
|
60
|
+
message: 'Expecting a map for "HubItemListBlockV2025R0"',
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
...base,
|
|
65
|
+
...{ ['type']: serializeHubItemListBlockV2025R0TypeField(val.type) },
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export function deserializeHubItemListBlockV2025R0(
|
|
69
|
+
val: SerializedData,
|
|
70
|
+
): HubItemListBlockV2025R0 {
|
|
71
|
+
if (!sdIsMap(val)) {
|
|
72
|
+
throw new BoxSdkError({
|
|
73
|
+
message: 'Expecting a map for "HubItemListBlockV2025R0"',
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
if (val.type == void 0) {
|
|
77
|
+
throw new BoxSdkError({
|
|
78
|
+
message:
|
|
79
|
+
'Expecting "type" of type "HubItemListBlockV2025R0" to be defined',
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
const type: HubItemListBlockV2025R0TypeField =
|
|
83
|
+
deserializeHubItemListBlockV2025R0TypeField(val.type);
|
|
84
|
+
if (val.id == void 0) {
|
|
85
|
+
throw new BoxSdkError({
|
|
86
|
+
message: 'Expecting "id" of type "HubItemListBlockV2025R0" to be defined',
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
if (!sdIsString(val.id)) {
|
|
90
|
+
throw new BoxSdkError({
|
|
91
|
+
message: 'Expecting string for "id" of type "HubItemListBlockV2025R0"',
|
|
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 "HubItemListBlockV2025R0"',
|
|
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 HubItemListBlockV2025R0;
|
|
108
|
+
}
|
|
@@ -23,6 +23,9 @@ export interface HubItemOperationResultV2025R0 {
|
|
|
23
23
|
* The action performed on the item. */
|
|
24
24
|
readonly action?: string;
|
|
25
25
|
readonly item?: HubItemReferenceV2025R0;
|
|
26
|
+
/**
|
|
27
|
+
* The ID of the parent block the item was added to. */
|
|
28
|
+
readonly parentId?: string;
|
|
26
29
|
/**
|
|
27
30
|
* The HTTP status code of the operation. */
|
|
28
31
|
readonly status?: number;
|
|
@@ -40,6 +43,7 @@ export function serializeHubItemOperationResultV2025R0(
|
|
|
40
43
|
val.item == void 0
|
|
41
44
|
? val.item
|
|
42
45
|
: serializeHubItemReferenceV2025R0(val.item),
|
|
46
|
+
['parent_id']: val.parentId,
|
|
43
47
|
['status']: val.status,
|
|
44
48
|
['error']: val.error,
|
|
45
49
|
};
|
|
@@ -61,6 +65,14 @@ export function deserializeHubItemOperationResultV2025R0(
|
|
|
61
65
|
const action: undefined | string = val.action == void 0 ? void 0 : val.action;
|
|
62
66
|
const item: undefined | HubItemReferenceV2025R0 =
|
|
63
67
|
val.item == void 0 ? void 0 : deserializeHubItemReferenceV2025R0(val.item);
|
|
68
|
+
if (!(val.parent_id == void 0) && !sdIsString(val.parent_id)) {
|
|
69
|
+
throw new BoxSdkError({
|
|
70
|
+
message:
|
|
71
|
+
'Expecting string for "parent_id" of type "HubItemOperationResultV2025R0"',
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
const parentId: undefined | string =
|
|
75
|
+
val.parent_id == void 0 ? void 0 : val.parent_id;
|
|
64
76
|
if (!(val.status == void 0) && !sdIsNumber(val.status)) {
|
|
65
77
|
throw new BoxSdkError({
|
|
66
78
|
message:
|
|
@@ -78,6 +90,7 @@ export function deserializeHubItemOperationResultV2025R0(
|
|
|
78
90
|
return {
|
|
79
91
|
action: action,
|
|
80
92
|
item: item,
|
|
93
|
+
parentId: parentId,
|
|
81
94
|
status: status,
|
|
82
95
|
error: error,
|
|
83
96
|
} satisfies HubItemOperationResultV2025R0;
|
|
@@ -24,6 +24,9 @@ export interface HubItemOperationV2025R0 {
|
|
|
24
24
|
* The action to perform on a Box Hub item. */
|
|
25
25
|
readonly action: HubItemOperationV2025R0ActionField;
|
|
26
26
|
readonly item: HubItemReferenceV2025R0;
|
|
27
|
+
/**
|
|
28
|
+
* The ID of the parent block to add the item to. Must be an Item List block. If not provided, the item will be added to the first page's first Item List block. */
|
|
29
|
+
readonly parentId?: string;
|
|
27
30
|
readonly rawData?: SerializedData;
|
|
28
31
|
}
|
|
29
32
|
export function serializeHubItemOperationV2025R0ActionField(
|
|
@@ -53,6 +56,7 @@ export function serializeHubItemOperationV2025R0(
|
|
|
53
56
|
return {
|
|
54
57
|
['action']: serializeHubItemOperationV2025R0ActionField(val.action),
|
|
55
58
|
['item']: serializeHubItemReferenceV2025R0(val.item),
|
|
59
|
+
['parent_id']: val.parentId,
|
|
56
60
|
};
|
|
57
61
|
}
|
|
58
62
|
export function deserializeHubItemOperationV2025R0(
|
|
@@ -80,5 +84,17 @@ export function deserializeHubItemOperationV2025R0(
|
|
|
80
84
|
const item: HubItemReferenceV2025R0 = deserializeHubItemReferenceV2025R0(
|
|
81
85
|
val.item,
|
|
82
86
|
);
|
|
83
|
-
|
|
87
|
+
if (!(val.parent_id == void 0) && !sdIsString(val.parent_id)) {
|
|
88
|
+
throw new BoxSdkError({
|
|
89
|
+
message:
|
|
90
|
+
'Expecting string for "parent_id" of type "HubItemOperationV2025R0"',
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
const parentId: undefined | string =
|
|
94
|
+
val.parent_id == void 0 ? void 0 : val.parent_id;
|
|
95
|
+
return {
|
|
96
|
+
action: action,
|
|
97
|
+
item: item,
|
|
98
|
+
parentId: parentId,
|
|
99
|
+
} satisfies HubItemOperationV2025R0;
|
|
84
100
|
}
|
|
@@ -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 HubParagraphTextBlockV2025R0TypeField = 'paragraph';
|
|
13
|
+
export class HubParagraphTextBlockV2025R0 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 `paragraph`. */
|
|
19
|
+
readonly type: HubParagraphTextBlockV2025R0TypeField =
|
|
20
|
+
'paragraph' as HubParagraphTextBlockV2025R0TypeField;
|
|
21
|
+
/**
|
|
22
|
+
* Text content of the block. Includes rich text formatting. */
|
|
23
|
+
readonly fragment!: string;
|
|
24
|
+
constructor(
|
|
25
|
+
fields: Omit<HubParagraphTextBlockV2025R0, 'type'> &
|
|
26
|
+
Partial<Pick<HubParagraphTextBlockV2025R0, '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 serializeHubParagraphTextBlockV2025R0TypeField(
|
|
46
|
+
val: HubParagraphTextBlockV2025R0TypeField,
|
|
47
|
+
): SerializedData {
|
|
48
|
+
return val;
|
|
49
|
+
}
|
|
50
|
+
export function deserializeHubParagraphTextBlockV2025R0TypeField(
|
|
51
|
+
val: SerializedData,
|
|
52
|
+
): HubParagraphTextBlockV2025R0TypeField {
|
|
53
|
+
if (val == 'paragraph') {
|
|
54
|
+
return val;
|
|
55
|
+
}
|
|
56
|
+
throw new BoxSdkError({
|
|
57
|
+
message: "Can't deserialize HubParagraphTextBlockV2025R0TypeField",
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
export function serializeHubParagraphTextBlockV2025R0(
|
|
61
|
+
val: HubParagraphTextBlockV2025R0,
|
|
62
|
+
): SerializedData {
|
|
63
|
+
const base: any = serializeHubDocumentBlockV2025R0(val);
|
|
64
|
+
if (!sdIsMap(base)) {
|
|
65
|
+
throw new BoxSdkError({
|
|
66
|
+
message: 'Expecting a map for "HubParagraphTextBlockV2025R0"',
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
...base,
|
|
71
|
+
...{
|
|
72
|
+
['type']: serializeHubParagraphTextBlockV2025R0TypeField(val.type),
|
|
73
|
+
['fragment']: val.fragment,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export function deserializeHubParagraphTextBlockV2025R0(
|
|
78
|
+
val: SerializedData,
|
|
79
|
+
): HubParagraphTextBlockV2025R0 {
|
|
80
|
+
if (!sdIsMap(val)) {
|
|
81
|
+
throw new BoxSdkError({
|
|
82
|
+
message: 'Expecting a map for "HubParagraphTextBlockV2025R0"',
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
if (val.type == void 0) {
|
|
86
|
+
throw new BoxSdkError({
|
|
87
|
+
message:
|
|
88
|
+
'Expecting "type" of type "HubParagraphTextBlockV2025R0" to be defined',
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
const type: HubParagraphTextBlockV2025R0TypeField =
|
|
92
|
+
deserializeHubParagraphTextBlockV2025R0TypeField(val.type);
|
|
93
|
+
if (val.fragment == void 0) {
|
|
94
|
+
throw new BoxSdkError({
|
|
95
|
+
message:
|
|
96
|
+
'Expecting "fragment" of type "HubParagraphTextBlockV2025R0" to be defined',
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (!sdIsString(val.fragment)) {
|
|
100
|
+
throw new BoxSdkError({
|
|
101
|
+
message:
|
|
102
|
+
'Expecting string for "fragment" of type "HubParagraphTextBlockV2025R0"',
|
|
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 "HubParagraphTextBlockV2025R0" to be defined',
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
if (!sdIsString(val.id)) {
|
|
113
|
+
throw new BoxSdkError({
|
|
114
|
+
message:
|
|
115
|
+
'Expecting string for "id" of type "HubParagraphTextBlockV2025R0"',
|
|
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 "HubParagraphTextBlockV2025R0"',
|
|
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 HubParagraphTextBlockV2025R0;
|
|
133
|
+
}
|