box-node-sdk
Version:
Official SDK for Box Platform APIs
52 lines • 1.86 kB
JavaScript
import { BoxSdkError } from '../../box/errors.js';
import { sdIsNumber } from '../../serialization/json.js';
import { sdIsString } from '../../serialization/json.js';
import { sdIsMap } from '../../serialization/json.js';
export function serializeExternalUserDeletionResultV2025R0(val) {
return {
['user_id']: val.userId,
['status']: val.status,
['detail']: val.detail,
};
}
export function deserializeExternalUserDeletionResultV2025R0(val) {
if (!sdIsMap(val)) {
throw new BoxSdkError({
message: 'Expecting a map for "ExternalUserDeletionResultV2025R0"',
});
}
if (val.user_id == void 0) {
throw new BoxSdkError({
message: 'Expecting "user_id" of type "ExternalUserDeletionResultV2025R0" to be defined',
});
}
if (!sdIsString(val.user_id)) {
throw new BoxSdkError({
message: 'Expecting string for "user_id" of type "ExternalUserDeletionResultV2025R0"',
});
}
const userId = val.user_id;
if (val.status == void 0) {
throw new BoxSdkError({
message: 'Expecting "status" of type "ExternalUserDeletionResultV2025R0" to be defined',
});
}
if (!sdIsNumber(val.status)) {
throw new BoxSdkError({
message: 'Expecting number for "status" of type "ExternalUserDeletionResultV2025R0"',
});
}
const status = val.status;
if (!(val.detail == void 0) && !sdIsString(val.detail)) {
throw new BoxSdkError({
message: 'Expecting string for "detail" of type "ExternalUserDeletionResultV2025R0"',
});
}
const detail = val.detail == void 0 ? void 0 : val.detail;
return {
userId: userId,
status: status,
detail: detail,
};
}
//# sourceMappingURL=externalUserDeletionResultV2025R0.js.map