Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "c571efa", "specHash": "f899bf6", "version": "4.8.0" }
{ "engineHash": "c571efa", "specHash": "65c9c57", "version": "4.8.0" }
22 changes: 16 additions & 6 deletions src/sdk-gen/schemas/aiAgentReference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class AiAgentReference {
* The ID of an Agent. This can be a numeric ID for custom agents (for example, `14031`)
* or a unique identifier for pre-built agents (for example, `enhanced_extract_agent`
* for the [Enhanced Extract Agent](https://developer.box.com/guides/box-ai/ai-tutorials/extract-metadata-structured#enhanced-extract-agent)). */
readonly id?: string;
readonly id!: string;
readonly rawData?: SerializedData;
constructor(
fields: Omit<AiAgentReference, 'type'> &
Expand All @@ -41,7 +41,7 @@ export interface AiAgentReferenceInput {
* The ID of an Agent. This can be a numeric ID for custom agents (for example, `14031`)
* or a unique identifier for pre-built agents (for example, `enhanced_extract_agent`
* for the [Enhanced Extract Agent](https://developer.box.com/guides/box-ai/ai-tutorials/extract-metadata-structured#enhanced-extract-agent)). */
readonly id?: string;
readonly id: string;
readonly rawData?: SerializedData;
}
export function serializeAiAgentReferenceTypeField(
Expand Down Expand Up @@ -83,12 +83,17 @@ export function deserializeAiAgentReference(
const type: AiAgentReferenceTypeField = deserializeAiAgentReferenceTypeField(
val.type
);
if (!(val.id == void 0) && !sdIsString(val.id)) {
if (val.id == void 0) {
throw new BoxSdkError({
message: 'Expecting "id" of type "AiAgentReference" to be defined',
});
}
if (!sdIsString(val.id)) {
throw new BoxSdkError({
message: 'Expecting string for "id" of type "AiAgentReference"',
});
}
const id: undefined | string = val.id == void 0 ? void 0 : val.id;
const id: string = val.id;
return { type: type, id: id } satisfies AiAgentReference;
}
export function serializeAiAgentReferenceInput(
Expand All @@ -114,11 +119,16 @@ export function deserializeAiAgentReferenceInput(
val.type == void 0
? void 0
: deserializeAiAgentReferenceTypeField(val.type);
if (!(val.id == void 0) && !sdIsString(val.id)) {
if (val.id == void 0) {
throw new BoxSdkError({
message: 'Expecting "id" of type "AiAgentReferenceInput" to be defined',
});
}
if (!sdIsString(val.id)) {
throw new BoxSdkError({
message: 'Expecting string for "id" of type "AiAgentReferenceInput"',
});
}
const id: undefined | string = val.id == void 0 ? void 0 : val.id;
const id: string = val.id;
return { type: type, id: id } satisfies AiAgentReferenceInput;
}
Loading