Skip to content

Commit

Permalink
feat: Support optional userId parameter for updating files, folders…
Browse files Browse the repository at this point in the history
… and web links (box/box-openapi#488) (#445)
  • Loading branch information
box-sdk-build authored Dec 9, 2024
1 parent 24c2013 commit 874f259
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 38 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": "c9d7bb5", "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
23 changes: 17 additions & 6 deletions src/managers/folders.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,11 @@ export type UpdateFolderByIdRequestBodySyncStateField =
| 'partially_synced';
export interface UpdateFolderByIdRequestBodyParentField {
/**
* The ID of the new parent folder */
* 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 UpdateFolderByIdRequestBodySharedLinkAccessField =
Expand Down Expand Up @@ -473,9 +476,6 @@ export interface UpdateFolderByIdRequestBody {
* Specifies if users who are not the owner
* of the folder can invite new collaborators to the folder. */
readonly canNonOwnersInvite?: boolean;
/**
* The parent folder for this folder. Use this to move
* the folder or to restore it out of the trash. */
readonly parent?: UpdateFolderByIdRequestBodyParentField;
readonly sharedLink?: UpdateFolderByIdRequestBodySharedLinkField;
readonly folderUploadEmail?: UpdateFolderByIdRequestBodyFolderUploadEmailField | null;
Expand Down Expand Up @@ -1402,7 +1402,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 +1419,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/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 874f259

Please sign in to comment.