Skip to content

Commit f20e8d8

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

6 files changed

Lines changed: 29 additions & 13 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": "6.3.0" }
1+
{ "engineHash": "f9e2519", "specHash": "f8fb08c", "version": "6.3.0" }

BoxSdkGen/Sources/Managers/LegalHoldPolicyAssignments/CreateLegalHoldPolicyAssignmentRequestBodyAssignToTypeField.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public enum CreateLegalHoldPolicyAssignmentRequestBodyAssignToTypeField: Codable
66
case folder
77
case user
88
case ownership
9-
case interaction
9+
case interactions
1010
case customValue(String)
1111

1212
public init(rawValue value: String) {
@@ -21,8 +21,8 @@ public enum CreateLegalHoldPolicyAssignmentRequestBodyAssignToTypeField: Codable
2121
self = .user
2222
case "ownership".lowercased():
2323
self = .ownership
24-
case "interaction".lowercased():
25-
self = .interaction
24+
case "interactions".lowercased():
25+
self = .interactions
2626
default:
2727
self = .customValue(value)
2828
}
@@ -40,8 +40,8 @@ public enum CreateLegalHoldPolicyAssignmentRequestBodyAssignToTypeField: Codable
4040
return "user"
4141
case .ownership:
4242
return "ownership"
43-
case .interaction:
44-
return "interaction"
43+
case .interactions:
44+
return "interactions"
4545
case .customValue(let value):
4646
return value
4747
}

BoxSdkGen/Sources/Managers/LegalHoldPolicyAssignments/LegalHoldPolicyAssignmentsManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class LegalHoldPolicyAssignmentsManager {
2424
return try LegalHoldPolicyAssignments.deserialize(from: response.data!)
2525
}
2626

27-
/// Assign a legal hold to a file, file version, folder, or user.
27+
/// Assign a legal hold to an item type of: file, file version, folder, user, ownership, or interactions.
2828
///
2929
/// - Parameters:
3030
/// - requestBody: Request body of createLegalHoldPolicyAssignment method

BoxSdkGen/Sources/Schemas/LegalHoldPolicy/LegalHoldPolicy.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class LegalHoldPolicy: LegalHoldPolicyMini {
4343
/// * 'released' - the policy is no longer active.
4444
public let status: LegalHoldPolicyStatusField?
4545

46-
/// Counts of assignments within this a legal hold policy by item type.
46+
/// Counts of assignments within a legal hold policy by item type.
4747
public let assignmentCounts: LegalHoldPolicyAssignmentCountsField?
4848

4949
public let createdBy: UserMini?
@@ -88,7 +88,7 @@ public class LegalHoldPolicy: LegalHoldPolicyMini {
8888
/// * 'releasing' - that the process is in the process
8989
/// of being released.
9090
/// * 'released' - the policy is no longer active.
91-
/// - assignmentCounts: Counts of assignments within this a legal hold policy by item type.
91+
/// - assignmentCounts: Counts of assignments within a legal hold policy by item type.
9292
/// - createdBy:
9393
/// - createdAt: When the legal hold policy object was created.
9494
/// - modifiedAt: When the legal hold policy object was modified.

BoxSdkGen/Sources/Schemas/LegalHoldPolicy/LegalHoldPolicyAssignmentCountsField.swift

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ public class LegalHoldPolicyAssignmentCountsField: Codable, RawJSONReadable {
66
case folder
77
case file
88
case fileVersion = "file_version"
9+
case ownership
10+
case interactions
911
}
1012

1113
/// Internal backing store for rawData. Used to store raw dictionary data associated with the instance.
@@ -17,7 +19,7 @@ public class LegalHoldPolicyAssignmentCountsField: Codable, RawJSONReadable {
1719
}
1820

1921

20-
/// The number of users this policy is applied to.
22+
/// The number of users this policy is applied to with the `access` type assignment.
2123
public let user: Int64?
2224

2325
/// The number of folders this policy is applied to.
@@ -29,18 +31,28 @@ public class LegalHoldPolicyAssignmentCountsField: Codable, RawJSONReadable {
2931
/// The number of file versions this policy is applied to.
3032
public let fileVersion: Int64?
3133

34+
/// The number of users this policy is applied to with the `ownership` type assignment.
35+
public let ownership: Int64?
36+
37+
/// The number of users this policy is applied to with the `interactions` type assignment.
38+
public let interactions: Int64?
39+
3240
/// Initializer for a LegalHoldPolicyAssignmentCountsField.
3341
///
3442
/// - Parameters:
35-
/// - user: The number of users this policy is applied to.
43+
/// - user: The number of users this policy is applied to with the `access` type assignment.
3644
/// - folder: The number of folders this policy is applied to.
3745
/// - file: The number of files this policy is applied to.
3846
/// - fileVersion: The number of file versions this policy is applied to.
39-
public init(user: Int64? = nil, folder: Int64? = nil, file: Int64? = nil, fileVersion: Int64? = nil) {
47+
/// - ownership: The number of users this policy is applied to with the `ownership` type assignment.
48+
/// - interactions: The number of users this policy is applied to with the `interactions` type assignment.
49+
public init(user: Int64? = nil, folder: Int64? = nil, file: Int64? = nil, fileVersion: Int64? = nil, ownership: Int64? = nil, interactions: Int64? = nil) {
4050
self.user = user
4151
self.folder = folder
4252
self.file = file
4353
self.fileVersion = fileVersion
54+
self.ownership = ownership
55+
self.interactions = interactions
4456
}
4557

4658
required public init(from decoder: Decoder) throws {
@@ -49,6 +61,8 @@ public class LegalHoldPolicyAssignmentCountsField: Codable, RawJSONReadable {
4961
folder = try container.decodeIfPresent(Int64.self, forKey: .folder)
5062
file = try container.decodeIfPresent(Int64.self, forKey: .file)
5163
fileVersion = try container.decodeIfPresent(Int64.self, forKey: .fileVersion)
64+
ownership = try container.decodeIfPresent(Int64.self, forKey: .ownership)
65+
interactions = try container.decodeIfPresent(Int64.self, forKey: .interactions)
5266
}
5367

5468
public func encode(to encoder: Encoder) throws {
@@ -57,6 +71,8 @@ public class LegalHoldPolicyAssignmentCountsField: Codable, RawJSONReadable {
5771
try container.encodeIfPresent(folder, forKey: .folder)
5872
try container.encodeIfPresent(file, forKey: .file)
5973
try container.encodeIfPresent(fileVersion, forKey: .fileVersion)
74+
try container.encodeIfPresent(ownership, forKey: .ownership)
75+
try container.encodeIfPresent(interactions, forKey: .interactions)
6076
}
6177

6278
/// Sets the raw JSON data.

docs/BoxSdkGen/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

0 commit comments

Comments
 (0)