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

box / box-typescript-sdk-gen / 13155027420

05 Feb 2025 10:12AM UTC coverage: 42.622% (-0.006%) from 42.628%
13155027420

Pull #509

github

web-flow
Merge 697e537ab into 026c9372e
Pull Request #509: test: Fix flaky test in search module (box/box-codegen#659)

4052 of 16047 branches covered (25.25%)

Branch coverage included in aggregate %.

13 of 35 new or added lines in 3 files covered. (37.14%)

5 existing lines in 2 files now uncovered.

14323 of 27065 relevant lines covered (52.92%)

92.41 hits per line

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

23.08
/src/schemas/aiItemAsk.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 type AiItemAskTypeField = 'file' | 'hubs';
10
export interface AiItemAsk {
11
  /**
12
   * The ID of the file. */
13
  readonly id: string;
14
  /**
15
   * The type of the item. A `hubs` item must be used as a single item. */
16
  readonly type: AiItemAskTypeField;
17
  /**
18
   * The content of the item, often the text representation. */
19
  readonly content?: string;
20
  readonly rawData?: SerializedData;
21
}
22
export function serializeAiItemAskTypeField(
144✔
23
  val: AiItemAskTypeField,
24
): SerializedData {
25
  return val;
6✔
26
}
27
export function deserializeAiItemAskTypeField(
144✔
28
  val: SerializedData,
29
): AiItemAskTypeField {
NEW
30
  if (val == 'file') {
×
NEW
31
    return val;
×
32
  }
NEW
33
  if (val == 'hubs') {
×
NEW
34
    return val;
×
35
  }
NEW
36
  throw new BoxSdkError({ message: "Can't deserialize AiItemAskTypeField" });
×
37
}
38
export function serializeAiItemAsk(val: AiItemAsk): SerializedData {
144✔
39
  return {
6✔
40
    ['id']: val.id,
41
    ['type']: serializeAiItemAskTypeField(val.type),
42
    ['content']: val.content,
43
  };
44
}
45
export function deserializeAiItemAsk(val: SerializedData): AiItemAsk {
144✔
NEW
46
  if (!sdIsMap(val)) {
×
NEW
47
    throw new BoxSdkError({ message: 'Expecting a map for "AiItemAsk"' });
×
48
  }
NEW
49
  if (val.id == void 0) {
×
NEW
50
    throw new BoxSdkError({
×
51
      message: 'Expecting "id" of type "AiItemAsk" to be defined',
52
    });
53
  }
NEW
54
  if (!sdIsString(val.id)) {
×
NEW
55
    throw new BoxSdkError({
×
56
      message: 'Expecting string for "id" of type "AiItemAsk"',
57
    });
58
  }
NEW
59
  const id: string = val.id;
×
NEW
60
  if (val.type == void 0) {
×
NEW
61
    throw new BoxSdkError({
×
62
      message: 'Expecting "type" of type "AiItemAsk" to be defined',
63
    });
64
  }
NEW
65
  const type: AiItemAskTypeField = deserializeAiItemAskTypeField(val.type);
×
NEW
66
  if (!(val.content == void 0) && !sdIsString(val.content)) {
×
NEW
67
    throw new BoxSdkError({
×
68
      message: 'Expecting string for "content" of type "AiItemAsk"',
69
    });
70
  }
71
  const content: undefined | string =
NEW
72
    val.content == void 0 ? void 0 : val.content;
×
NEW
73
  return { id: id, type: type, content: content } satisfies AiItemAsk;
×
74
}
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