-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #788 from watson-developer-cloud/discovery-aggrega…
…tion-models Discovery aggregation models
- Loading branch information
Showing
12 changed files
with
278 additions
and
61 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
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,45 @@ | ||
/** | ||
* Copyright IBM Corporation 2018 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
**/ | ||
|
||
import Foundation | ||
|
||
/** Filter. */ | ||
public struct Filter: Decodable { | ||
|
||
/// The type of aggregation command used. For example: term, filter, max, min, etc. | ||
public var type: String? | ||
|
||
public var results: [AggregationResult]? | ||
|
||
/// Number of matching results. | ||
public var matchingResults: Int? | ||
|
||
/// Aggregations returned by the Discovery service. | ||
public var aggregations: [QueryAggregation]? | ||
|
||
/// The match the aggregated results queried for. | ||
public var match: String? | ||
|
||
// Map each property name to the key that shall be used for encoding/decoding. | ||
private enum CodingKeys: String, CodingKey { | ||
case type = "type" | ||
case results = "results" | ||
case matchingResults = "matching_results" | ||
case aggregations = "aggregations" | ||
case match = "match" | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* Copyright IBM Corporation 2018 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
**/ | ||
|
||
import Foundation | ||
|
||
/** Nested. */ | ||
public struct Nested: Decodable { | ||
|
||
/// The type of aggregation command used. For example: term, filter, max, min, etc. | ||
public var type: String? | ||
|
||
public var results: [AggregationResult]? | ||
|
||
/// Number of matching results. | ||
public var matchingResults: Int? | ||
|
||
/// Aggregations returned by the Discovery service. | ||
public var aggregations: [QueryAggregation]? | ||
|
||
/// The area of the results the aggregation was restricted to. | ||
public var path: String? | ||
|
||
// Map each property name to the key that shall be used for encoding/decoding. | ||
private enum CodingKeys: String, CodingKey { | ||
case type = "type" | ||
case results = "results" | ||
case matchingResults = "matching_results" | ||
case aggregations = "aggregations" | ||
case path = "path" | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* Copyright IBM Corporation 2018 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
**/ | ||
|
||
import Foundation | ||
|
||
/** Timeslice. */ | ||
public struct Timeslice: Decodable { | ||
|
||
/// The type of aggregation command used. For example: term, filter, max, min, etc. | ||
public var type: String? | ||
|
||
public var results: [AggregationResult]? | ||
|
||
/// Number of matching results. | ||
public var matchingResults: Int? | ||
|
||
/// Aggregations returned by the Discovery service. | ||
public var aggregations: [QueryAggregation]? | ||
|
||
/// The field where the aggregation is located in the document. | ||
public var field: String? | ||
|
||
/// Interval of the aggregation. Valid date interval values are second/seconds minute/minutes, hour/hours, day/days, week/weeks, month/months, and year/years. | ||
public var interval: String? | ||
|
||
/// Used to inducate that anomaly detection should be performed. Anomaly detection is used to locate unusual datapoints within a time series. | ||
public var anomaly: Bool? | ||
|
||
// Map each property name to the key that shall be used for encoding/decoding. | ||
private enum CodingKeys: String, CodingKey { | ||
case type = "type" | ||
case results = "results" | ||
case matchingResults = "matching_results" | ||
case aggregations = "aggregations" | ||
case field = "field" | ||
case interval = "interval" | ||
case anomaly = "anomaly" | ||
} | ||
|
||
} |
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,48 @@ | ||
/** | ||
* Copyright IBM Corporation 2018 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
**/ | ||
|
||
import Foundation | ||
|
||
/** TopHits. */ | ||
public struct TopHits: Decodable { | ||
|
||
/// The type of aggregation command used. For example: term, filter, max, min, etc. | ||
public var type: String? | ||
|
||
public var results: [AggregationResult]? | ||
|
||
/// Number of matching results. | ||
public var matchingResults: Int? | ||
|
||
/// Aggregations returned by the Discovery service. | ||
public var aggregations: [QueryAggregation]? | ||
|
||
/// Number of top hits returned by the aggregation. | ||
public var size: Int? | ||
|
||
public var hits: TopHitsResults? | ||
|
||
// Map each property name to the key that shall be used for encoding/decoding. | ||
private enum CodingKeys: String, CodingKey { | ||
case type = "type" | ||
case results = "results" | ||
case matchingResults = "matching_results" | ||
case aggregations = "aggregations" | ||
case size = "size" | ||
case hits = "hits" | ||
} | ||
|
||
} |
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,34 @@ | ||
/** | ||
* Copyright IBM Corporation 2018 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
**/ | ||
|
||
import Foundation | ||
|
||
/** TopHitsResults. */ | ||
public struct TopHitsResults: Decodable { | ||
|
||
/// Number of matching results. | ||
public var matchingResults: Int? | ||
|
||
/// Top results returned by the aggregation. | ||
public var hits: [QueryResult]? | ||
|
||
// Map each property name to the key that shall be used for encoding/decoding. | ||
private enum CodingKeys: String, CodingKey { | ||
case matchingResults = "matching_results" | ||
case hits = "hits" | ||
} | ||
|
||
} |
Oops, something went wrong.