• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

box / box-typescript-sdk-gen / 12834345592

17 Jan 2025 06:00PM UTC coverage: 43.106%. First build
12834345592

Pull #486

github

web-flow
Merge 9f6f1b453 into 0592f7bcd
Pull Request #486: feat: Support Box Doc Gen API (box/box-codegen#644)

4019 of 15795 branches covered (25.44%)

Branch coverage included in aggregate %.

559 of 926 new or added lines in 21 files covered. (60.37%)

14245 of 26575 relevant lines covered (53.6%)

94.21 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

26.67
/src/schemas/v2025R0/docGenDocumentGenerationDataV2025R0.generated.ts
1
import { BoxSdkError } from '../../box/errors.js';
144✔
2
import { SerializedData } from '../../serialization/json.js';
3
import { sdIsEmpty } from '../../serialization/json.js';
4
import { sdIsBoolean } from '../../serialization/json.js';
5
import { sdIsNumber } from '../../serialization/json.js';
6
import { sdIsString } from '../../serialization/json.js';
144✔
7
import { sdIsList } from '../../serialization/json.js';
8
import { sdIsMap } from '../../serialization/json.js';
144✔
9
export interface DocGenDocumentGenerationDataV2025R0 {
10
  /**
11
   * File name of the output file. */
12
  readonly generatedFileName: string;
13
  readonly userInput: {
14
    readonly [key: string]: any;
15
  };
16
  readonly rawData?: SerializedData;
17
}
18
export function serializeDocGenDocumentGenerationDataV2025R0(
144✔
19
  val: DocGenDocumentGenerationDataV2025R0,
20
): SerializedData {
21
  return {
2✔
22
    ['generated_file_name']: val.generatedFileName,
23
    ['user_input']: Object.fromEntries(
24
      Object.entries(val.userInput).map(([k, v]: [string, any]) => [
2✔
25
        k,
26
        (function (v: any): any {
27
          return v;
2✔
28
        })(v),
29
      ]),
30
    ) as {
31
      readonly [key: string]: any;
32
    },
33
  };
34
}
35
export function deserializeDocGenDocumentGenerationDataV2025R0(
144✔
36
  val: SerializedData,
37
): DocGenDocumentGenerationDataV2025R0 {
NEW
38
  if (!sdIsMap(val)) {
×
NEW
39
    throw new BoxSdkError({
×
40
      message: 'Expecting a map for "DocGenDocumentGenerationDataV2025R0"',
41
    });
42
  }
NEW
43
  if (val.generated_file_name == void 0) {
×
NEW
44
    throw new BoxSdkError({
×
45
      message:
46
        'Expecting "generated_file_name" of type "DocGenDocumentGenerationDataV2025R0" to be defined',
47
    });
48
  }
NEW
49
  if (!sdIsString(val.generated_file_name)) {
×
NEW
50
    throw new BoxSdkError({
×
51
      message:
52
        'Expecting string for "generated_file_name" of type "DocGenDocumentGenerationDataV2025R0"',
53
    });
54
  }
NEW
55
  const generatedFileName: string = val.generated_file_name;
×
NEW
56
  if (val.user_input == void 0) {
×
NEW
57
    throw new BoxSdkError({
×
58
      message:
59
        'Expecting "user_input" of type "DocGenDocumentGenerationDataV2025R0" to be defined',
60
    });
61
  }
NEW
62
  if (!sdIsMap(val.user_input)) {
×
NEW
63
    throw new BoxSdkError({
×
64
      message:
65
        'Expecting object for "user_input" of type "DocGenDocumentGenerationDataV2025R0"',
66
    });
67
  }
68
  const userInput: {
69
    readonly [key: string]: any;
NEW
70
  } = sdIsMap(val.user_input)
×
71
    ? (Object.fromEntries(
NEW
72
        Object.entries(val.user_input).map(([k, v]: [string, any]) => [
×
73
          k,
74
          (function (v: any): any {
NEW
75
            return v;
×
76
          })(v),
77
        ]),
78
      ) as {
79
        readonly [key: string]: any;
80
      })
81
    : {};
NEW
82
  return {
×
83
    generatedFileName: generatedFileName,
84
    userInput: userInput,
85
  } satisfies DocGenDocumentGenerationDataV2025R0;
86
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc