From f342c686bc1ce5afc387db7ea5c0a4abd2cab2ea Mon Sep 17 00:00:00 2001 From: Anthony Oliveri Date: Mon, 11 Feb 2019 15:39:25 -0600 Subject: [PATCH] feat(DiscoveryV1): Add the `pending` status for Documents --- Source/DiscoveryV1/Models/DocumentAccepted.swift | 7 +++++-- Source/DiscoveryV1/Models/DocumentCounts.swift | 6 ++++++ Source/DiscoveryV1/Models/DocumentStatus.swift | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Source/DiscoveryV1/Models/DocumentAccepted.swift b/Source/DiscoveryV1/Models/DocumentAccepted.swift index 1e892a0cf..5cc3e431c 100644 --- a/Source/DiscoveryV1/Models/DocumentAccepted.swift +++ b/Source/DiscoveryV1/Models/DocumentAccepted.swift @@ -20,10 +20,12 @@ import Foundation public struct DocumentAccepted: Codable, Equatable { /** - Status of the document in the ingestion process. + Status of the document in the ingestion process. A status of `processing` is returned for documents that are + ingested with a *version* date before `2019-01-01`. The `pending` status is returned for all others. */ public enum Status: String { case processing = "processing" + case pending = "pending" } /** @@ -32,7 +34,8 @@ public struct DocumentAccepted: Codable, Equatable { public var documentID: String? /** - Status of the document in the ingestion process. + Status of the document in the ingestion process. A status of `processing` is returned for documents that are + ingested with a *version* date before `2019-01-01`. The `pending` status is returned for all others. */ public var status: String? diff --git a/Source/DiscoveryV1/Models/DocumentCounts.swift b/Source/DiscoveryV1/Models/DocumentCounts.swift index 505acd75c..03384aebd 100644 --- a/Source/DiscoveryV1/Models/DocumentCounts.swift +++ b/Source/DiscoveryV1/Models/DocumentCounts.swift @@ -34,11 +34,17 @@ public struct DocumentCounts: Codable, Equatable { */ public var failed: Int? + /** + The number of documents that have been uploaded to the collection, but have not yet started processing. + */ + public var pending: Int? + // Map each property name to the key that shall be used for encoding/decoding. private enum CodingKeys: String, CodingKey { case available = "available" case processing = "processing" case failed = "failed" + case pending = "pending" } } diff --git a/Source/DiscoveryV1/Models/DocumentStatus.swift b/Source/DiscoveryV1/Models/DocumentStatus.swift index ec8c3dd23..7bc0ae4ad 100644 --- a/Source/DiscoveryV1/Models/DocumentStatus.swift +++ b/Source/DiscoveryV1/Models/DocumentStatus.swift @@ -29,6 +29,7 @@ public struct DocumentStatus: Codable, Equatable { case availableWithNotices = "available with notices" case failed = "failed" case processing = "processing" + case pending = "pending" } /**