Skip to content

Commit

Permalink
feat: Optional user id parameter for PUT files/folders/web_links (box…
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build committed Dec 9, 2024
1 parent 24c2013 commit f2ec501
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "5604447", "specHash": "d7dfe68", "version": "1.8.0" }
{ "engineHash": "5604447", "specHash": "86fde16", "version": "1.8.0" }
51 changes: 24 additions & 27 deletions package-lock.json

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

18 changes: 16 additions & 2 deletions src/managers/files.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,9 @@ export interface UpdateFileByIdRequestBodyParentField {
/**
* The ID of parent item */
readonly id?: string;
/**
* The input for `{user_id}` is optional. Moving to non-root folder is not allowed when `{user_id}` is present. Parent folder id should be zero when `{user_id}` is provided. */
readonly userId?: string;
readonly rawData?: SerializedData;
}
export type UpdateFileByIdRequestBodySharedLinkAccessField =
Expand Down Expand Up @@ -1167,7 +1170,7 @@ export interface FilesManagerInput {
export function serializeUpdateFileByIdRequestBodyParentField(
val: UpdateFileByIdRequestBodyParentField,
): SerializedData {
return { ['id']: val.id };
return { ['id']: val.id, ['user_id']: val.userId };
}
export function deserializeUpdateFileByIdRequestBodyParentField(
val: SerializedData,
Expand All @@ -1184,7 +1187,18 @@ export function deserializeUpdateFileByIdRequestBodyParentField(
});
}
const id: undefined | string = val.id == void 0 ? void 0 : val.id;
return { id: id } satisfies UpdateFileByIdRequestBodyParentField;
if (!(val.user_id == void 0) && !sdIsString(val.user_id)) {
throw new BoxSdkError({
message:
'Expecting string for "user_id" of type "UpdateFileByIdRequestBodyParentField"',
});
}
const userId: undefined | string =
val.user_id == void 0 ? void 0 : val.user_id;
return {
id: id,
userId: userId,
} satisfies UpdateFileByIdRequestBodyParentField;
}
export function serializeUpdateFileByIdRequestBodySharedLinkAccessField(
val: UpdateFileByIdRequestBodySharedLinkAccessField,
Expand Down
18 changes: 16 additions & 2 deletions src/managers/folders.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,9 @@ export interface UpdateFolderByIdRequestBodyParentField {
/**
* The ID of the new parent folder */
readonly id?: string;
/**
* The input for `{user_id}` is optional. Moving to non-root folder is not allowed when `{user_id}` is present. Parent folder id should be zero when `{user_id}` is provided. */
readonly userId?: string;
readonly rawData?: SerializedData;
}
export type UpdateFolderByIdRequestBodySharedLinkAccessField =
Expand Down Expand Up @@ -1402,7 +1405,7 @@ export function deserializeUpdateFolderByIdRequestBodySyncStateField(
export function serializeUpdateFolderByIdRequestBodyParentField(
val: UpdateFolderByIdRequestBodyParentField,
): SerializedData {
return { ['id']: val.id };
return { ['id']: val.id, ['user_id']: val.userId };
}
export function deserializeUpdateFolderByIdRequestBodyParentField(
val: SerializedData,
Expand All @@ -1419,7 +1422,18 @@ export function deserializeUpdateFolderByIdRequestBodyParentField(
});
}
const id: undefined | string = val.id == void 0 ? void 0 : val.id;
return { id: id } satisfies UpdateFolderByIdRequestBodyParentField;
if (!(val.user_id == void 0) && !sdIsString(val.user_id)) {
throw new BoxSdkError({
message:
'Expecting string for "user_id" of type "UpdateFolderByIdRequestBodyParentField"',
});
}
const userId: undefined | string =
val.user_id == void 0 ? void 0 : val.user_id;
return {
id: id,
userId: userId,
} satisfies UpdateFolderByIdRequestBodyParentField;
}
export function serializeUpdateFolderByIdRequestBodySharedLinkAccessField(
val: UpdateFolderByIdRequestBodySharedLinkAccessField,
Expand Down
18 changes: 16 additions & 2 deletions src/managers/trashedFiles.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ export interface RestoreFileFromTrashRequestBodyParentField {
/**
* The ID of parent item */
readonly id?: string;
/**
* The input for `{user_id}` is optional. Moving to non-root folder is not allowed when `{user_id}` is present. Parent folder id should be zero when `{user_id}` is provided. */
readonly userId?: string;
readonly rawData?: SerializedData;
}
export interface RestoreFileFromTrashRequestBody {
Expand Down Expand Up @@ -443,7 +446,7 @@ export interface TrashedFilesManagerInput {
export function serializeRestoreFileFromTrashRequestBodyParentField(
val: RestoreFileFromTrashRequestBodyParentField,
): SerializedData {
return { ['id']: val.id };
return { ['id']: val.id, ['user_id']: val.userId };
}
export function deserializeRestoreFileFromTrashRequestBodyParentField(
val: SerializedData,
Expand All @@ -461,7 +464,18 @@ export function deserializeRestoreFileFromTrashRequestBodyParentField(
});
}
const id: undefined | string = val.id == void 0 ? void 0 : val.id;
return { id: id } satisfies RestoreFileFromTrashRequestBodyParentField;
if (!(val.user_id == void 0) && !sdIsString(val.user_id)) {
throw new BoxSdkError({
message:
'Expecting string for "user_id" of type "RestoreFileFromTrashRequestBodyParentField"',
});
}
const userId: undefined | string =
val.user_id == void 0 ? void 0 : val.user_id;
return {
id: id,
userId: userId,
} satisfies RestoreFileFromTrashRequestBodyParentField;
}
export function serializeRestoreFileFromTrashRequestBody(
val: RestoreFileFromTrashRequestBody,
Expand Down
18 changes: 16 additions & 2 deletions src/managers/trashedFolders.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ export interface RestoreFolderFromTrashRequestBodyParentField {
/**
* The ID of parent item */
readonly id?: string;
/**
* The input for `{user_id}` is optional. Moving to non-root folder is not allowed when `{user_id}` is present. Parent folder id should be zero when `{user_id}` is provided. */
readonly userId?: string;
readonly rawData?: SerializedData;
}
export interface RestoreFolderFromTrashRequestBody {
Expand Down Expand Up @@ -458,7 +461,7 @@ export interface TrashedFoldersManagerInput {
export function serializeRestoreFolderFromTrashRequestBodyParentField(
val: RestoreFolderFromTrashRequestBodyParentField,
): SerializedData {
return { ['id']: val.id };
return { ['id']: val.id, ['user_id']: val.userId };
}
export function deserializeRestoreFolderFromTrashRequestBodyParentField(
val: SerializedData,
Expand All @@ -476,7 +479,18 @@ export function deserializeRestoreFolderFromTrashRequestBodyParentField(
});
}
const id: undefined | string = val.id == void 0 ? void 0 : val.id;
return { id: id } satisfies RestoreFolderFromTrashRequestBodyParentField;
if (!(val.user_id == void 0) && !sdIsString(val.user_id)) {
throw new BoxSdkError({
message:
'Expecting string for "user_id" of type "RestoreFolderFromTrashRequestBodyParentField"',
});
}
const userId: undefined | string =
val.user_id == void 0 ? void 0 : val.user_id;
return {
id: id,
userId: userId,
} satisfies RestoreFolderFromTrashRequestBodyParentField;
}
export function serializeRestoreFolderFromTrashRequestBody(
val: RestoreFolderFromTrashRequestBody,
Expand Down
18 changes: 16 additions & 2 deletions src/managers/trashedWebLinks.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ export interface RestoreWeblinkFromTrashRequestBodyParentField {
/**
* The ID of parent item */
readonly id?: string;
/**
* The input for `{user_id}` is optional. Moving to non-root folder is not allowed when `{user_id}` is present. Parent folder id should be zero when `{user_id}` is provided. */
readonly userId?: string;
readonly rawData?: SerializedData;
}
export interface RestoreWeblinkFromTrashRequestBody {
Expand Down Expand Up @@ -414,7 +417,7 @@ export interface TrashedWebLinksManagerInput {
export function serializeRestoreWeblinkFromTrashRequestBodyParentField(
val: RestoreWeblinkFromTrashRequestBodyParentField,
): SerializedData {
return { ['id']: val.id };
return { ['id']: val.id, ['user_id']: val.userId };
}
export function deserializeRestoreWeblinkFromTrashRequestBodyParentField(
val: SerializedData,
Expand All @@ -432,7 +435,18 @@ export function deserializeRestoreWeblinkFromTrashRequestBodyParentField(
});
}
const id: undefined | string = val.id == void 0 ? void 0 : val.id;
return { id: id } satisfies RestoreWeblinkFromTrashRequestBodyParentField;
if (!(val.user_id == void 0) && !sdIsString(val.user_id)) {
throw new BoxSdkError({
message:
'Expecting string for "user_id" of type "RestoreWeblinkFromTrashRequestBodyParentField"',
});
}
const userId: undefined | string =
val.user_id == void 0 ? void 0 : val.user_id;
return {
id: id,
userId: userId,
} satisfies RestoreWeblinkFromTrashRequestBodyParentField;
}
export function serializeRestoreWeblinkFromTrashRequestBody(
val: RestoreWeblinkFromTrashRequestBody,
Expand Down
18 changes: 16 additions & 2 deletions src/managers/uploads.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ export interface PreflightFileUploadCheckRequestBodyParentField {
/**
* The ID of parent item */
readonly id?: string;
/**
* The input for `{user_id}` is optional. Moving to non-root folder is not allowed when `{user_id}` is present. Parent folder id should be zero when `{user_id}` is provided. */
readonly userId?: string;
readonly rawData?: SerializedData;
}
export interface PreflightFileUploadCheckRequestBody {
Expand Down Expand Up @@ -635,7 +638,7 @@ export function deserializeUploadFileVersionRequestBodyAttributesField(
export function serializePreflightFileUploadCheckRequestBodyParentField(
val: PreflightFileUploadCheckRequestBodyParentField,
): SerializedData {
return { ['id']: val.id };
return { ['id']: val.id, ['user_id']: val.userId };
}
export function deserializePreflightFileUploadCheckRequestBodyParentField(
val: SerializedData,
Expand All @@ -653,7 +656,18 @@ export function deserializePreflightFileUploadCheckRequestBodyParentField(
});
}
const id: undefined | string = val.id == void 0 ? void 0 : val.id;
return { id: id } satisfies PreflightFileUploadCheckRequestBodyParentField;
if (!(val.user_id == void 0) && !sdIsString(val.user_id)) {
throw new BoxSdkError({
message:
'Expecting string for "user_id" of type "PreflightFileUploadCheckRequestBodyParentField"',
});
}
const userId: undefined | string =
val.user_id == void 0 ? void 0 : val.user_id;
return {
id: id,
userId: userId,
} satisfies PreflightFileUploadCheckRequestBodyParentField;
}
export function serializePreflightFileUploadCheckRequestBody(
val: PreflightFileUploadCheckRequestBody,
Expand Down
18 changes: 16 additions & 2 deletions src/managers/webLinks.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ export interface UpdateWebLinkByIdRequestBodyParentField {
/**
* The ID of parent item */
readonly id?: string;
/**
* The input for `{user_id}` is optional. Moving to non-root folder is not allowed when `{user_id}` is present. Parent folder id should be zero when `{user_id}` is provided. */
readonly userId?: string;
readonly rawData?: SerializedData;
}
export type UpdateWebLinkByIdRequestBodySharedLinkAccessField =
Expand Down Expand Up @@ -611,7 +614,7 @@ export function deserializeCreateWebLinkRequestBody(
export function serializeUpdateWebLinkByIdRequestBodyParentField(
val: UpdateWebLinkByIdRequestBodyParentField,
): SerializedData {
return { ['id']: val.id };
return { ['id']: val.id, ['user_id']: val.userId };
}
export function deserializeUpdateWebLinkByIdRequestBodyParentField(
val: SerializedData,
Expand All @@ -628,7 +631,18 @@ export function deserializeUpdateWebLinkByIdRequestBodyParentField(
});
}
const id: undefined | string = val.id == void 0 ? void 0 : val.id;
return { id: id } satisfies UpdateWebLinkByIdRequestBodyParentField;
if (!(val.user_id == void 0) && !sdIsString(val.user_id)) {
throw new BoxSdkError({
message:
'Expecting string for "user_id" of type "UpdateWebLinkByIdRequestBodyParentField"',
});
}
const userId: undefined | string =
val.user_id == void 0 ? void 0 : val.user_id;
return {
id: id,
userId: userId,
} satisfies UpdateWebLinkByIdRequestBodyParentField;
}
export function serializeUpdateWebLinkByIdRequestBodySharedLinkAccessField(
val: UpdateWebLinkByIdRequestBodySharedLinkAccessField,
Expand Down

0 comments on commit f2ec501

Please sign in to comment.