Skip to content

Commit

Permalink
feat(discoveryv1): regen with more recent defs
Browse files Browse the repository at this point in the history
QueryAggregation subclasses changed

BREAKING CHANGE: QueryAggregation subclasses changed, be sure to regen models
  • Loading branch information
Hsaylor committed Mar 18, 2022
1 parent ba4a3eb commit 46752a1
Showing 1 changed file with 110 additions and 66 deletions.
176 changes: 110 additions & 66 deletions discovery/v1.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2017, 2022.
* (C) Copyright IBM Corp. 2022.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -5518,16 +5518,6 @@ namespace DiscoveryV1 {
* model interfaces
************************/

/** Aggregation results for the specified query. */
export interface AggregationResult {
/** Key that matched the aggregation type. */
key?: string;
/** Number of matching results. */
matching_results?: number;
/** Aggregations returned in the case of chained aggregations. */
aggregations?: QueryAggregation[];
}

/** A collection for storing documents. */
export interface Collection {
/** The unique identifier of the collection. */
Expand Down Expand Up @@ -6436,12 +6426,16 @@ namespace DiscoveryV1 {
/** An aggregation produced by Discovery to analyze the input provided. */
export interface QueryAggregation {
/** The type of aggregation command used. For example: term, filter, max, min, etc. */
type?: string;
/** Array of aggregation results. */
results?: AggregationResult[];
/** Number of matching results. */
matching_results?: number;
/** Aggregations returned by Discovery. */
type: string;
}

/** Histogram numeric interval result. */
export interface QueryHistogramAggregationResult {
/** The value of the upper bound for the numeric segment. */
key: number;
/** Number of documents with the specified key as the upper bound. */
matching_results: number;
/** An array of sub-aggregations. */
aggregations?: QueryAggregation[];
}

Expand Down Expand Up @@ -6553,6 +6547,46 @@ namespace DiscoveryV1 {
confidence?: number;
}

/** Top value result for the term aggregation. */
export interface QueryTermAggregationResult {
/** Value of the field with a non-zero frequency in the document set. */
key: string;
/** Number of documents that contain the 'key'. */
matching_results: number;
/** The relevancy for this term. */
relevancy?: number;
/** The number of documents which have the term as the value of specified field in the whole set of documents in
* this collection. Returned only when the `relevancy` parameter is set to `true`.
*/
total_matching_documents?: number;
/** The estimated number of documents which would match the query and also meet the condition. Returned only
* when the `relevancy` parameter is set to `true`.
*/
estimated_matching_documents?: number;
/** An array of sub-aggregations. */
aggregations?: QueryAggregation[];
}

/** A timeslice interval segment. */
export interface QueryTimesliceAggregationResult {
/** String date value of the upper bound for the timeslice interval in ISO-8601 format. */
key_as_string: string;
/** Numeric date value of the upper bound for the timeslice interval in UNIX milliseconds since epoch. */
key: number;
/** Number of documents with the specified key as the upper bound. */
matching_results: number;
/** An array of sub-aggregations. */
aggregations?: QueryAggregation[];
}

/** A query response that contains the matching documents for the preceding aggregations. */
export interface QueryTopHitsAggregationResult {
/** Number of matching results. */
matching_results: number;
/** An array of the document results. */
hits?: JsonObject[];
}

/** An object contain retrieval type information. */
export interface RetrievalDetails {
/** Indentifies the document retrieval strategy used for this query. `relevancy_training` indicates that the
Expand Down Expand Up @@ -6824,14 +6858,6 @@ namespace DiscoveryV1 {
type?: string;
}

/** Top hit information for this query. */
export interface TopHitsResults {
/** Number of matching results. */
matching_results?: number;
/** Top results returned by the aggregation. */
hits?: QueryResult[];
}

/** Training information for a specific collection. */
export interface TrainingDataSet {
/** The environment id associated with this training data set. */
Expand Down Expand Up @@ -6920,61 +6946,79 @@ namespace DiscoveryV1 {
xpaths?: string[];
}

/** Calculation. */
export interface Calculation extends QueryAggregation {
/** The field where the aggregation is located in the document. */
field?: string;
/** Value of the aggregation. */
/** Returns a scalar calculation across all documents for the field specified. Possible calculations include min, max, sum, average, and unique_count. */
export interface QueryCalculationAggregation extends QueryAggregation {
/** The field to perform the calculation on. */
field: string;
/** The value of the calculation. */
value?: number;
}

/** Filter. */
export interface Filter extends QueryAggregation {
/** The match the aggregated results queried for. */
match?: string;
/** A modifier that narrows the document set of the sub-aggregations it precedes. */
export interface QueryFilterAggregation extends QueryAggregation {
/** The filter that is written in Discovery Query Language syntax and is applied to the documents before
* sub-aggregations are run.
*/
match: string;
/** Number of documents that match the filter. */
matching_results: number;
/** An array of sub-aggregations. */
aggregations?: QueryAggregation[];
}

/** Histogram. */
export interface Histogram extends QueryAggregation {
/** The field where the aggregation is located in the document. */
field?: string;
/** Interval of the aggregation. (For 'histogram' type). */
interval?: number;
/** Numeric interval segments to categorize documents by using field values from a single numeric field to describe the category. */
export interface QueryHistogramAggregation extends QueryAggregation {
/** The numeric field name used to create the histogram. */
field: string;
/** The size of the sections that the results are split into. */
interval: number;
/** Identifier specified in the query request of this aggregation. */
name?: string;
/** Array of numeric intervals. */
results?: QueryHistogramAggregationResult[];
}

/** Nested. */
export interface Nested extends QueryAggregation {
/** The area of the results the aggregation was restricted to. */
path?: string;
/** A restriction that alters the document set that is used for sub-aggregations it precedes to nested documents found in the field specified. */
export interface QueryNestedAggregation extends QueryAggregation {
/** The path to the document field to scope sub-aggregations to. */
path: string;
/** Number of nested documents found in the specified field. */
matching_results: number;
/** An array of sub-aggregations. */
aggregations?: QueryAggregation[];
}

/** Term. */
export interface Term extends QueryAggregation {
/** The field where the aggregation is located in the document. */
field?: string;
/** The number of terms identified. */
/** Returns the top values for the field specified. */
export interface QueryTermAggregation extends QueryAggregation {
/** The field in the document used to generate top values from. */
field: string;
/** The number of top values returned. */
count?: number;
/** Identifier specified in the query request of this aggregation. */
name?: string;
/** Array of top values for the field. */
results?: QueryTermAggregationResult[];
}

/** Timeslice. */
export interface Timeslice extends QueryAggregation {
/** The field where the aggregation is located in the document. */
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.
*/
interval?: string;
/** Used to indicate that anomaly detection should be performed. Anomaly detection is used to locate unusual
* datapoints within a time series.
*/
anomaly?: boolean;
/** A specialized histogram aggregation that uses dates to create interval segments. */
export interface QueryTimesliceAggregation extends QueryAggregation {
/** The date field name used to create the timeslice. */
field: string;
/** The date interval value. Valid values are seconds, minutes, hours, days, weeks, and years. */
interval: string;
/** Identifier specified in the query request of this aggregation. */
name?: string;
/** Array of aggregation results. */
results?: QueryTimesliceAggregationResult[];
}

/** TopHits. */
export interface TopHits extends QueryAggregation {
/** Number of top hits returned by the aggregation. */
size?: number;
hits?: TopHitsResults;
/** Returns the top documents ranked by the score of the query. */
export interface QueryTopHitsAggregation extends QueryAggregation {
/** The number of documents to return. */
size: number;
/** Identifier specified in the query request of this aggregation. */
name?: string;
hits?: QueryTopHitsAggregationResult;
}
}

Expand Down

0 comments on commit 46752a1

Please sign in to comment.