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": "5012b13", "specHash": "d5769a1", "version": "0.5.4" }
{ "engineHash": "3d5462a", "specHash": "d5769a1", "version": "0.5.4" }
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

100 changes: 97 additions & 3 deletions src/box/jwtAuth.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,51 @@ export function serializeJwtConfigAppSettingsAppAuth(
};
}
export function deserializeJwtConfigAppSettingsAppAuth(
val: any
val: SerializedData
): JwtConfigAppSettingsAppAuth {
if (!sdIsMap(val)) {
throw new BoxSdkError({
message: 'Expecting a map for "JwtConfigAppSettingsAppAuth"',
});
}
if (val.publicKeyID == void 0) {
throw new BoxSdkError({
message:
'Expecting "publicKeyID" of type "JwtConfigAppSettingsAppAuth" to be defined',
});
}
if (!sdIsString(val.publicKeyID)) {
throw new BoxSdkError({
message:
'Expecting string for "publicKeyID" of type "JwtConfigAppSettingsAppAuth"',
});
}
const publicKeyId: string = val.publicKeyID;
if (val.privateKey == void 0) {
throw new BoxSdkError({
message:
'Expecting "privateKey" of type "JwtConfigAppSettingsAppAuth" to be defined',
});
}
if (!sdIsString(val.privateKey)) {
throw new BoxSdkError({
message:
'Expecting string for "privateKey" of type "JwtConfigAppSettingsAppAuth"',
});
}
const privateKey: string = val.privateKey;
if (val.passphrase == void 0) {
throw new BoxSdkError({
message:
'Expecting "passphrase" of type "JwtConfigAppSettingsAppAuth" to be defined',
});
}
if (!sdIsString(val.passphrase)) {
throw new BoxSdkError({
message:
'Expecting string for "passphrase" of type "JwtConfigAppSettingsAppAuth"',
});
}
const passphrase: string = val.passphrase;
return {
publicKeyId: publicKeyId,
Expand All @@ -339,10 +380,44 @@ export function serializeJwtConfigAppSettings(
};
}
export function deserializeJwtConfigAppSettings(
val: any
val: SerializedData
): JwtConfigAppSettings {
if (!sdIsMap(val)) {
throw new BoxSdkError({
message: 'Expecting a map for "JwtConfigAppSettings"',
});
}
if (val.clientID == void 0) {
throw new BoxSdkError({
message:
'Expecting "clientID" of type "JwtConfigAppSettings" to be defined',
});
}
if (!sdIsString(val.clientID)) {
throw new BoxSdkError({
message: 'Expecting string for "clientID" of type "JwtConfigAppSettings"',
});
}
const clientId: string = val.clientID;
if (val.clientSecret == void 0) {
throw new BoxSdkError({
message:
'Expecting "clientSecret" of type "JwtConfigAppSettings" to be defined',
});
}
if (!sdIsString(val.clientSecret)) {
throw new BoxSdkError({
message:
'Expecting string for "clientSecret" of type "JwtConfigAppSettings"',
});
}
const clientSecret: string = val.clientSecret;
if (val.appAuth == void 0) {
throw new BoxSdkError({
message:
'Expecting "appAuth" of type "JwtConfigAppSettings" to be defined',
});
}
const appAuth: JwtConfigAppSettingsAppAuth =
deserializeJwtConfigAppSettingsAppAuth(val.appAuth);
return {
Expand All @@ -358,10 +433,29 @@ export function serializeJwtConfigFile(val: JwtConfigFile): SerializedData {
['boxAppSettings']: serializeJwtConfigAppSettings(val.boxAppSettings),
};
}
export function deserializeJwtConfigFile(val: any): JwtConfigFile {
export function deserializeJwtConfigFile(val: SerializedData): JwtConfigFile {
if (!sdIsMap(val)) {
throw new BoxSdkError({ message: 'Expecting a map for "JwtConfigFile"' });
}
if (!(val.enterpriseID == void 0) && !sdIsString(val.enterpriseID)) {
throw new BoxSdkError({
message: 'Expecting string for "enterpriseID" of type "JwtConfigFile"',
});
}
const enterpriseId: undefined | string =
val.enterpriseID == void 0 ? void 0 : val.enterpriseID;
if (!(val.userID == void 0) && !sdIsString(val.userID)) {
throw new BoxSdkError({
message: 'Expecting string for "userID" of type "JwtConfigFile"',
});
}
const userId: undefined | string = val.userID == void 0 ? void 0 : val.userID;
if (val.boxAppSettings == void 0) {
throw new BoxSdkError({
message:
'Expecting "boxAppSettings" of type "JwtConfigFile" to be defined',
});
}
const boxAppSettings: JwtConfigAppSettings = deserializeJwtConfigAppSettings(
val.boxAppSettings
);
Expand Down
2 changes: 1 addition & 1 deletion src/managers/authorization.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ export function serializeAuthorizeUserQueryParamsResponseTypeField(
return val;
}
export function deserializeAuthorizeUserQueryParamsResponseTypeField(
val: any
val: SerializedData
): AuthorizeUserQueryParamsResponseTypeField {
if (!sdIsString(val)) {
throw new BoxSdkError({
Expand Down
89 changes: 86 additions & 3 deletions src/managers/chunkedUploads.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { readByteStream } from '../internal/utils.js';
import { reduceIterator } from '../internal/utils.js';
import { Hash } from '../internal/utils.js';
import { bufferLength } from '../internal/utils.js';
import { BoxSdkError } from '../box/errors.js';
import { sdIsEmpty } from '../serialization/json.js';
import { sdIsBoolean } from '../serialization/json.js';
import { sdIsNumber } from '../serialization/json.js';
Expand Down Expand Up @@ -833,10 +834,51 @@ export function serializeCreateFileUploadSessionRequestBody(
};
}
export function deserializeCreateFileUploadSessionRequestBody(
val: any
val: SerializedData
): CreateFileUploadSessionRequestBody {
if (!sdIsMap(val)) {
throw new BoxSdkError({
message: 'Expecting a map for "CreateFileUploadSessionRequestBody"',
});
}
if (val.folder_id == void 0) {
throw new BoxSdkError({
message:
'Expecting "folder_id" of type "CreateFileUploadSessionRequestBody" to be defined',
});
}
if (!sdIsString(val.folder_id)) {
throw new BoxSdkError({
message:
'Expecting string for "folder_id" of type "CreateFileUploadSessionRequestBody"',
});
}
const folderId: string = val.folder_id;
if (val.file_size == void 0) {
throw new BoxSdkError({
message:
'Expecting "file_size" of type "CreateFileUploadSessionRequestBody" to be defined',
});
}
if (!sdIsNumber(val.file_size)) {
throw new BoxSdkError({
message:
'Expecting number for "file_size" of type "CreateFileUploadSessionRequestBody"',
});
}
const fileSize: number = val.file_size;
if (val.file_name == void 0) {
throw new BoxSdkError({
message:
'Expecting "file_name" of type "CreateFileUploadSessionRequestBody" to be defined',
});
}
if (!sdIsString(val.file_name)) {
throw new BoxSdkError({
message:
'Expecting string for "file_name" of type "CreateFileUploadSessionRequestBody"',
});
}
const fileName: string = val.file_name;
return {
folderId: folderId,
Expand All @@ -853,9 +895,33 @@ export function serializeCreateFileUploadSessionForExistingFileRequestBody(
};
}
export function deserializeCreateFileUploadSessionForExistingFileRequestBody(
val: any
val: SerializedData
): CreateFileUploadSessionForExistingFileRequestBody {
if (!sdIsMap(val)) {
throw new BoxSdkError({
message:
'Expecting a map for "CreateFileUploadSessionForExistingFileRequestBody"',
});
}
if (val.file_size == void 0) {
throw new BoxSdkError({
message:
'Expecting "file_size" of type "CreateFileUploadSessionForExistingFileRequestBody" to be defined',
});
}
if (!sdIsNumber(val.file_size)) {
throw new BoxSdkError({
message:
'Expecting number for "file_size" of type "CreateFileUploadSessionForExistingFileRequestBody"',
});
}
const fileSize: number = val.file_size;
if (!(val.file_name == void 0) && !sdIsString(val.file_name)) {
throw new BoxSdkError({
message:
'Expecting string for "file_name" of type "CreateFileUploadSessionForExistingFileRequestBody"',
});
}
const fileName: undefined | string =
val.file_name == void 0 ? void 0 : val.file_name;
return {
Expand All @@ -873,8 +939,25 @@ export function serializeCreateFileUploadSessionCommitRequestBody(
};
}
export function deserializeCreateFileUploadSessionCommitRequestBody(
val: any
val: SerializedData
): CreateFileUploadSessionCommitRequestBody {
if (!sdIsMap(val)) {
throw new BoxSdkError({
message: 'Expecting a map for "CreateFileUploadSessionCommitRequestBody"',
});
}
if (val.parts == void 0) {
throw new BoxSdkError({
message:
'Expecting "parts" of type "CreateFileUploadSessionCommitRequestBody" to be defined',
});
}
if (!sdIsList(val.parts)) {
throw new BoxSdkError({
message:
'Expecting array for "parts" of type "CreateFileUploadSessionCommitRequestBody"',
});
}
const parts: readonly UploadPart[] = sdIsList(val.parts)
? (val.parts.map(function (itm: SerializedData): UploadPart {
return deserializeUploadPart(itm);
Expand Down
Loading