Skip to content

Commit 669ff7f

Browse files
committed
fix: correct enum value for legal hold policy changes (box/box-openapi#581)
1 parent 8448ecc commit 669ff7f

4 files changed

Lines changed: 32 additions & 6 deletions

File tree

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "f9e2519", "specHash": "ad08e8c", "version": "4.3.0" }
1+
{ "engineHash": "f9e2519", "specHash": "f8fb08c", "version": "4.3.0" }

docs/sdk-gen/legalHoldPolicyAssignments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Returns a list of legal hold policy assignments.
3838

3939
## Assign legal hold policy
4040

41-
Assign a legal hold to a file, file version, folder, or user.
41+
Assign a legal hold to an item type of: file, file version, folder, user, ownership, or interactions.
4242

4343
This operation is performed by calling function `createLegalHoldPolicyAssignment`.
4444

src/sdk-gen/managers/legalHoldPolicyAssignments.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export type CreateLegalHoldPolicyAssignmentRequestBodyAssignToTypeField =
243243
| 'folder'
244244
| 'user'
245245
| 'ownership'
246-
| 'interaction';
246+
| 'interactions';
247247
export interface CreateLegalHoldPolicyAssignmentRequestBodyAssignToField {
248248
/**
249249
* The type of item to assign the policy to. */
@@ -453,7 +453,7 @@ export class LegalHoldPolicyAssignmentsManager {
453453
};
454454
}
455455
/**
456-
* Assign a legal hold to a file, file version, folder, or user.
456+
* Assign a legal hold to an item type of: file, file version, folder, user, ownership, or interactions.
457457
* @param {CreateLegalHoldPolicyAssignmentRequestBody} requestBody Request body of createLegalHoldPolicyAssignment method
458458
* @param {CreateLegalHoldPolicyAssignmentOptionalsInput} optionalsInput
459459
* @returns {Promise<LegalHoldPolicyAssignment>}
@@ -715,7 +715,7 @@ export function deserializeCreateLegalHoldPolicyAssignmentRequestBodyAssignToTyp
715715
if (val == 'ownership') {
716716
return val;
717717
}
718-
if (val == 'interaction') {
718+
if (val == 'interactions') {
719719
return val;
720720
}
721721
throw new BoxSdkError({

src/sdk-gen/schemas/legalHoldPolicy.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export type LegalHoldPolicyStatusField =
2626
| string;
2727
export interface LegalHoldPolicyAssignmentCountsField {
2828
/**
29-
* The number of users this policy is applied to. */
29+
* The number of users this policy is applied to with the `access` type assignment. */
3030
readonly user?: number;
3131
/**
3232
* The number of folders this policy is applied to. */
@@ -37,6 +37,12 @@ export interface LegalHoldPolicyAssignmentCountsField {
3737
/**
3838
* The number of file versions this policy is applied to. */
3939
readonly fileVersion?: number;
40+
/**
41+
* The number of users this policy is applied to with the `ownership` type assignment. */
42+
readonly ownership?: number;
43+
/**
44+
* The number of users this policy is applied to with the `interactions` type assignment. */
45+
readonly interactions?: number;
4046
readonly rawData?: SerializedData;
4147
}
4248
export class LegalHoldPolicy extends LegalHoldPolicyMini {
@@ -123,6 +129,8 @@ export function serializeLegalHoldPolicyAssignmentCountsField(
123129
['folder']: val.folder,
124130
['file']: val.file,
125131
['file_version']: val.fileVersion,
132+
['ownership']: val.ownership,
133+
['interactions']: val.interactions,
126134
};
127135
}
128136
export function deserializeLegalHoldPolicyAssignmentCountsField(
@@ -162,11 +170,29 @@ export function deserializeLegalHoldPolicyAssignmentCountsField(
162170
}
163171
const fileVersion: undefined | number =
164172
val.file_version == void 0 ? void 0 : val.file_version;
173+
if (!(val.ownership == void 0) && !sdIsNumber(val.ownership)) {
174+
throw new BoxSdkError({
175+
message:
176+
'Expecting number for "ownership" of type "LegalHoldPolicyAssignmentCountsField"',
177+
});
178+
}
179+
const ownership: undefined | number =
180+
val.ownership == void 0 ? void 0 : val.ownership;
181+
if (!(val.interactions == void 0) && !sdIsNumber(val.interactions)) {
182+
throw new BoxSdkError({
183+
message:
184+
'Expecting number for "interactions" of type "LegalHoldPolicyAssignmentCountsField"',
185+
});
186+
}
187+
const interactions: undefined | number =
188+
val.interactions == void 0 ? void 0 : val.interactions;
165189
return {
166190
user: user,
167191
folder: folder,
168192
file: file,
169193
fileVersion: fileVersion,
194+
ownership: ownership,
195+
interactions: interactions,
170196
} satisfies LegalHoldPolicyAssignmentCountsField;
171197
}
172198
export function serializeLegalHoldPolicy(val: LegalHoldPolicy): SerializedData {

0 commit comments

Comments
 (0)