-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change inner structs and enums to extensions
Move protocol implementation to extension
- Loading branch information
Renato Almeida
committed
Nov 22, 2023
1 parent
ed44995
commit 7a9c33a
Showing
2 changed files
with
42 additions
and
32 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
26 changes: 16 additions & 10 deletions
26
Sources/ElasticsearchNIOClient/Models/ESMultipleDocumentResponse.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 |
---|---|---|
@@ -1,19 +1,25 @@ | ||
import Foundation | ||
|
||
public struct ESGetMultipleDocumentsResponse<Document: Decodable>: Decodable { | ||
public struct Hits: Decodable { | ||
public struct Total: Decodable { | ||
public let value: Int | ||
public let relation: Relation | ||
|
||
public enum Relation: String, Decodable { | ||
case eq, gte | ||
} | ||
} | ||
public let hits: Hits | ||
} | ||
|
||
extension ESGetMultipleDocumentsResponse { | ||
public struct Hits: Decodable { | ||
public let total: Total? | ||
public let hits: [ESGetSingleDocumentResponse<Document>] | ||
} | ||
} | ||
|
||
public let hits: Hits | ||
extension ESGetMultipleDocumentsResponse.Hits { | ||
public struct Total: Decodable { | ||
public let value: Int | ||
public let relation: Relation | ||
} | ||
} | ||
|
||
extension ESGetMultipleDocumentsResponse.Hits.Total { | ||
public enum Relation: String, Decodable { | ||
case eq, gte | ||
} | ||
} |