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

box / box-typescript-sdk-gen / 15296196256

28 May 2025 09:09AM UTC coverage: 42.18%. First build
15296196256

Pull #621

github

web-flow
Merge ef3c4ff56 into 8a74db0ed
Pull Request #621: fix: Fix issues in box-openapi (box/box-openapi#527)

4205 of 17159 branches covered (24.51%)

Branch coverage included in aggregate %.

6 of 28 new or added lines in 8 files covered. (21.43%)

15190 of 28822 relevant lines covered (52.7%)

147.19 hits per line

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

15.66
/src/schemas/aiAgentExtractStructured.generated.ts
1
import { serializeAiAgentLongTextTool } from './aiAgentLongTextTool.generated.js';
225✔
2
import { deserializeAiAgentLongTextTool } from './aiAgentLongTextTool.generated.js';
225✔
3
import { serializeAiAgentBasicTextTool } from './aiAgentBasicTextTool.generated.js';
225✔
4
import { deserializeAiAgentBasicTextTool } from './aiAgentBasicTextTool.generated.js';
225✔
5
import { AiAgentLongTextTool } from './aiAgentLongTextTool.generated.js';
6
import { AiAgentBasicTextTool } from './aiAgentBasicTextTool.generated.js';
7
import { BoxSdkError } from '../box/errors.js';
225✔
8
import { SerializedData } from '../serialization/json.js';
9
import { sdIsEmpty } from '../serialization/json.js';
10
import { sdIsBoolean } from '../serialization/json.js';
11
import { sdIsNumber } from '../serialization/json.js';
12
import { sdIsString } from '../serialization/json.js';
13
import { sdIsList } from '../serialization/json.js';
14
import { sdIsMap } from '../serialization/json.js';
225✔
15
export type AiAgentExtractStructuredTypeField = 'ai_agent_extract_structured';
16
export class AiAgentExtractStructured {
225✔
17
  /**
18
   * The type of AI agent to be used for extraction. */
19
  readonly type: AiAgentExtractStructuredTypeField =
×
20
    'ai_agent_extract_structured' as AiAgentExtractStructuredTypeField;
21
  readonly longText?: AiAgentLongTextTool;
22
  readonly basicText?: AiAgentBasicTextTool;
23
  readonly basicImage?: AiAgentBasicTextTool;
24
  readonly rawData?: SerializedData;
25
  constructor(
26
    fields: Omit<AiAgentExtractStructured, 'type'> &
27
      Partial<Pick<AiAgentExtractStructured, 'type'>>,
28
  ) {
29
    if (fields.type !== undefined) {
×
30
      this.type = fields.type;
×
31
    }
32
    if (fields.longText !== undefined) {
×
33
      this.longText = fields.longText;
×
34
    }
35
    if (fields.basicText !== undefined) {
×
36
      this.basicText = fields.basicText;
×
37
    }
NEW
38
    if (fields.basicImage !== undefined) {
×
NEW
39
      this.basicImage = fields.basicImage;
×
40
    }
41
    if (fields.rawData !== undefined) {
×
42
      this.rawData = fields.rawData;
×
43
    }
44
  }
45
}
46
export interface AiAgentExtractStructuredInput {
47
  /**
48
   * The type of AI agent to be used for extraction. */
49
  readonly type?: AiAgentExtractStructuredTypeField;
50
  readonly longText?: AiAgentLongTextTool;
51
  readonly basicText?: AiAgentBasicTextTool;
52
  readonly basicImage?: AiAgentBasicTextTool;
53
  readonly rawData?: SerializedData;
54
}
55
export function serializeAiAgentExtractStructuredTypeField(
225✔
56
  val: AiAgentExtractStructuredTypeField,
57
): SerializedData {
58
  return val;
×
59
}
60
export function deserializeAiAgentExtractStructuredTypeField(
225✔
61
  val: SerializedData,
62
): AiAgentExtractStructuredTypeField {
63
  if (val == 'ai_agent_extract_structured') {
×
64
    return val;
×
65
  }
66
  throw new BoxSdkError({
×
67
    message: "Can't deserialize AiAgentExtractStructuredTypeField",
68
  });
69
}
70
export function serializeAiAgentExtractStructured(
225✔
71
  val: AiAgentExtractStructured,
72
): SerializedData {
73
  return {
×
74
    ['type']: serializeAiAgentExtractStructuredTypeField(val.type),
75
    ['long_text']:
76
      val.longText == void 0
×
77
        ? val.longText
78
        : serializeAiAgentLongTextTool(val.longText),
79
    ['basic_text']:
80
      val.basicText == void 0
×
81
        ? val.basicText
82
        : serializeAiAgentBasicTextTool(val.basicText),
83
    ['basic_image']:
84
      val.basicImage == void 0
×
85
        ? val.basicImage
86
        : serializeAiAgentBasicTextTool(val.basicImage),
87
  };
88
}
89
export function deserializeAiAgentExtractStructured(
225✔
90
  val: SerializedData,
91
): AiAgentExtractStructured {
92
  if (!sdIsMap(val)) {
×
93
    throw new BoxSdkError({
×
94
      message: 'Expecting a map for "AiAgentExtractStructured"',
95
    });
96
  }
97
  if (val.type == void 0) {
×
98
    throw new BoxSdkError({
×
99
      message:
100
        'Expecting "type" of type "AiAgentExtractStructured" to be defined',
101
    });
102
  }
103
  const type: AiAgentExtractStructuredTypeField =
104
    deserializeAiAgentExtractStructuredTypeField(val.type);
×
105
  const longText: undefined | AiAgentLongTextTool =
106
    val.long_text == void 0
×
107
      ? void 0
108
      : deserializeAiAgentLongTextTool(val.long_text);
109
  const basicText: undefined | AiAgentBasicTextTool =
110
    val.basic_text == void 0
×
111
      ? void 0
112
      : deserializeAiAgentBasicTextTool(val.basic_text);
113
  const basicImage: undefined | AiAgentBasicTextTool =
NEW
114
    val.basic_image == void 0
×
115
      ? void 0
116
      : deserializeAiAgentBasicTextTool(val.basic_image);
117
  return {
×
118
    type: type,
119
    longText: longText,
120
    basicText: basicText,
121
    basicImage: basicImage,
122
  } satisfies AiAgentExtractStructured;
123
}
124
export function serializeAiAgentExtractStructuredInput(
225✔
125
  val: AiAgentExtractStructuredInput,
126
): SerializedData {
127
  return {
×
128
    ['type']:
129
      val.type == void 0
×
130
        ? val.type
131
        : serializeAiAgentExtractStructuredTypeField(val.type),
132
    ['long_text']:
133
      val.longText == void 0
×
134
        ? val.longText
135
        : serializeAiAgentLongTextTool(val.longText),
136
    ['basic_text']:
137
      val.basicText == void 0
×
138
        ? val.basicText
139
        : serializeAiAgentBasicTextTool(val.basicText),
140
    ['basic_image']:
141
      val.basicImage == void 0
×
142
        ? val.basicImage
143
        : serializeAiAgentBasicTextTool(val.basicImage),
144
  };
145
}
146
export function deserializeAiAgentExtractStructuredInput(
225✔
147
  val: SerializedData,
148
): AiAgentExtractStructuredInput {
149
  if (!sdIsMap(val)) {
×
150
    throw new BoxSdkError({
×
151
      message: 'Expecting a map for "AiAgentExtractStructuredInput"',
152
    });
153
  }
154
  const type: undefined | AiAgentExtractStructuredTypeField =
155
    val.type == void 0
×
156
      ? void 0
157
      : deserializeAiAgentExtractStructuredTypeField(val.type);
158
  const longText: undefined | AiAgentLongTextTool =
159
    val.long_text == void 0
×
160
      ? void 0
161
      : deserializeAiAgentLongTextTool(val.long_text);
162
  const basicText: undefined | AiAgentBasicTextTool =
163
    val.basic_text == void 0
×
164
      ? void 0
165
      : deserializeAiAgentBasicTextTool(val.basic_text);
166
  const basicImage: undefined | AiAgentBasicTextTool =
NEW
167
    val.basic_image == void 0
×
168
      ? void 0
169
      : deserializeAiAgentBasicTextTool(val.basic_image);
170
  return {
×
171
    type: type,
172
    longText: longText,
173
    basicText: basicText,
174
    basicImage: basicImage,
175
  } satisfies AiAgentExtractStructuredInput;
176
}
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

© 2026 Coveralls, Inc