Skip to content

Commit

Permalink
feat(DiscoveryV1): Add the pending status for Documents
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Oliveri committed Feb 12, 2019
1 parent eecf18b commit f342c68
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Source/DiscoveryV1/Models/DocumentAccepted.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

/**
Expand All @@ -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?

Expand Down
6 changes: 6 additions & 0 deletions Source/DiscoveryV1/Models/DocumentCounts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

}
1 change: 1 addition & 0 deletions Source/DiscoveryV1/Models/DocumentStatus.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public struct DocumentStatus: Codable, Equatable {
case availableWithNotices = "available with notices"
case failed = "failed"
case processing = "processing"
case pending = "pending"
}

/**
Expand Down

0 comments on commit f342c68

Please sign in to comment.