-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix schemas for updating classification on a file and folder (bo…
- Loading branch information
1 parent
7e1ea1a
commit caa9d2b
Showing
14 changed files
with
223 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "engineHash": "c8ba3d9", "specHash": "d5769a1", "version": "0.1.0" } | ||
{ "engineHash": "c8ba3d9", "specHash": "98bca8f", "version": "0.1.0" } |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
Sources/Schemas/Events/EventsNextStreamPositionField.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import Foundation | ||
|
||
public enum EventsNextStreamPositionField: Codable { | ||
case double(Double) | ||
case string(String) | ||
|
||
public init(from decoder: Decoder) throws { | ||
if let content = try? Double(from: decoder) { | ||
self = .double(content) | ||
return | ||
} | ||
|
||
if let content = try? String(from: decoder) { | ||
self = .string(content) | ||
return | ||
} | ||
|
||
throw DecodingError.typeMismatch(EventsNextStreamPositionField.self, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "The type of the decoded object cannot be determined.")) | ||
|
||
} | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
switch self { | ||
case .double(let double): | ||
try double.encode(to: encoder) | ||
case .string(let string): | ||
try string.encode(to: encoder) | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Sources/Schemas/FileVersionLegalHold/FileVersionLegalHold.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Sources/Schemas/FileVersionLegalHolds/FileVersionLegalHolds.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
Sources/Schemas/FileVersionsOnHold/FileVersionsOnHold.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import Foundation | ||
|
||
/// A list of files on hold for legal policy assignment | ||
public class FileVersionsOnHold: Codable { | ||
private enum CodingKeys: String, CodingKey { | ||
case limit | ||
case nextMarker = "next_marker" | ||
case prevMarker = "prev_marker" | ||
case entries | ||
} | ||
|
||
/// The limit that was used for these entries. This will be the same as the | ||
/// `limit` query parameter unless that value exceeded the maximum value | ||
/// allowed. The maximum value varies by API. | ||
public let limit: Int64? | ||
|
||
/// The marker for the start of the next page of results. | ||
public let nextMarker: String? | ||
|
||
/// The marker for the start of the previous page of results. | ||
public let prevMarker: String? | ||
|
||
/// A list of file versions on hold. | ||
public let entries: [FileVersion]? | ||
|
||
/// Initializer for a FileVersionsOnHold. | ||
/// | ||
/// - Parameters: | ||
/// - limit: The limit that was used for these entries. This will be the same as the | ||
/// `limit` query parameter unless that value exceeded the maximum value | ||
/// allowed. The maximum value varies by API. | ||
/// - nextMarker: The marker for the start of the next page of results. | ||
/// - prevMarker: The marker for the start of the previous page of results. | ||
/// - entries: A list of file versions on hold. | ||
public init(limit: Int64? = nil, nextMarker: String? = nil, prevMarker: String? = nil, entries: [FileVersion]? = nil) { | ||
self.limit = limit | ||
self.nextMarker = nextMarker | ||
self.prevMarker = prevMarker | ||
self.entries = entries | ||
} | ||
|
||
required public init(from decoder: Decoder) throws { | ||
let container = try decoder.container(keyedBy: CodingKeys.self) | ||
limit = try container.decodeIfPresent(Int64.self, forKey: .limit) | ||
nextMarker = try container.decodeIfPresent(String.self, forKey: .nextMarker) | ||
prevMarker = try container.decodeIfPresent(String.self, forKey: .prevMarker) | ||
entries = try container.decodeIfPresent([FileVersion].self, forKey: .entries) | ||
} | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
try container.encodeIfPresent(limit, forKey: .limit) | ||
try container.encodeIfPresent(nextMarker, forKey: .nextMarker) | ||
try container.encodeIfPresent(prevMarker, forKey: .prevMarker) | ||
try container.encodeIfPresent(entries, forKey: .entries) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import Foundation | ||
|
||
/// A list of files on hold for legal policy assignment | ||
public class FilesOnHold: Codable { | ||
private enum CodingKeys: String, CodingKey { | ||
case limit | ||
case nextMarker = "next_marker" | ||
case prevMarker = "prev_marker" | ||
case entries | ||
} | ||
|
||
/// The limit that was used for these entries. This will be the same as the | ||
/// `limit` query parameter unless that value exceeded the maximum value | ||
/// allowed. The maximum value varies by API. | ||
public let limit: Int64? | ||
|
||
/// The marker for the start of the next page of results. | ||
public let nextMarker: String? | ||
|
||
/// The marker for the start of the previous page of results. | ||
public let prevMarker: String? | ||
|
||
/// A list of files | ||
public let entries: [FileMini]? | ||
|
||
/// Initializer for a FilesOnHold. | ||
/// | ||
/// - Parameters: | ||
/// - limit: The limit that was used for these entries. This will be the same as the | ||
/// `limit` query parameter unless that value exceeded the maximum value | ||
/// allowed. The maximum value varies by API. | ||
/// - nextMarker: The marker for the start of the next page of results. | ||
/// - prevMarker: The marker for the start of the previous page of results. | ||
/// - entries: A list of files | ||
public init(limit: Int64? = nil, nextMarker: String? = nil, prevMarker: String? = nil, entries: [FileMini]? = nil) { | ||
self.limit = limit | ||
self.nextMarker = nextMarker | ||
self.prevMarker = prevMarker | ||
self.entries = entries | ||
} | ||
|
||
required public init(from decoder: Decoder) throws { | ||
let container = try decoder.container(keyedBy: CodingKeys.self) | ||
limit = try container.decodeIfPresent(Int64.self, forKey: .limit) | ||
nextMarker = try container.decodeIfPresent(String.self, forKey: .nextMarker) | ||
prevMarker = try container.decodeIfPresent(String.self, forKey: .prevMarker) | ||
entries = try container.decodeIfPresent([FileMini].self, forKey: .entries) | ||
} | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
try container.encodeIfPresent(limit, forKey: .limit) | ||
try container.encodeIfPresent(nextMarker, forKey: .nextMarker) | ||
try container.encodeIfPresent(prevMarker, forKey: .prevMarker) | ||
try container.encodeIfPresent(entries, forKey: .entries) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters