Skip to content

Commit

Permalink
[codegen] Update to latest API spec
Browse files Browse the repository at this point in the history
  • Loading branch information
swallez committed May 6, 2023
1 parent 4e7916b commit 082fe35
Show file tree
Hide file tree
Showing 11 changed files with 663 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,7 @@
'ml._types.Category': 'ml/_types/Category.ts#L23-L49',
'ml._types.ChunkingConfig': 'ml/_types/Datafeed.ts#L177-L190',
'ml._types.ChunkingMode': 'ml/_types/Datafeed.ts#L171-L175',
'ml._types.ClassificationInferenceOptions': 'ml/_types/inference.ts#L80-L95',
'ml._types.ClassificationInferenceOptions': 'ml/_types/inference.ts#L85-L100',
'ml._types.ConditionOperator': 'ml/_types/Rule.ts#L74-L79',
'ml._types.DataCounts': 'ml/_types/Job.ts#L129-L149',
'ml._types.DataDescription': 'ml/_types/Job.ts#L151-L167',
Expand Down Expand Up @@ -1626,26 +1626,26 @@
'ml._types.DataframeEvaluationRegressionMetricsMsle': 'ml/_types/DataframeEvaluation.ts#L112-L115',
'ml._types.DataframeState': 'ml/_types/Dataframe.ts#L20-L26',
'ml._types.DelayedDataCheckConfig': 'ml/_types/Datafeed.ts#L119-L130',
'ml._types.DeploymentAllocationState': 'ml/_types/TrainedModel.ts#L280-L293',
'ml._types.DeploymentAssignmentState': 'ml/_types/TrainedModel.ts#L295-L300',
'ml._types.DeploymentState': 'ml/_types/TrainedModel.ts#L265-L278',
'ml._types.DeploymentAllocationState': 'ml/_types/TrainedModel.ts#L282-L295',
'ml._types.DeploymentAssignmentState': 'ml/_types/TrainedModel.ts#L297-L302',
'ml._types.DeploymentState': 'ml/_types/TrainedModel.ts#L267-L280',
'ml._types.DetectionRule': 'ml/_types/Rule.ts#L25-L39',
'ml._types.Detector': 'ml/_types/Detector.ts#L25-L67',
'ml._types.DetectorRead': 'ml/_types/Detector.ts#L69-L80',
'ml._types.DiscoveryNode': 'ml/_types/DiscoveryNode.ts#L24-L30',
'ml._types.ExcludeFrequent': 'ml/_types/Detector.ts#L82-L87',
'ml._types.FillMaskInferenceOptions': 'ml/_types/inference.ts#L241-L249',
'ml._types.FillMaskInferenceUpdateOptions': 'ml/_types/inference.ts#L370-L377',
'ml._types.FillMaskInferenceOptions': 'ml/_types/inference.ts#L256-L264',
'ml._types.FillMaskInferenceUpdateOptions': 'ml/_types/inference.ts#L395-L402',
'ml._types.Filter': 'ml/_types/Filter.ts#L22-L29',
'ml._types.FilterRef': 'ml/_types/Filter.ts#L31-L41',
'ml._types.FilterType': 'ml/_types/Filter.ts#L43-L46',
'ml._types.GeoResults': 'ml/_types/Anomaly.ts#L145-L154',
'ml._types.Hyperparameter': 'ml/_types/TrainedModel.ts#L208-L222',
'ml._types.Hyperparameter': 'ml/_types/TrainedModel.ts#L210-L224',
'ml._types.Hyperparameters': 'ml/_types/DataframeAnalytics.ts#L395-L410',
'ml._types.Include': 'ml/_types/Include.ts#L20-L47',
'ml._types.InferenceConfigCreateContainer': 'ml/_types/inference.ts#L23-L67',
'ml._types.InferenceConfigUpdateContainer': 'ml/_types/inference.ts#L265-L285',
'ml._types.InferenceResponseResult': 'ml/_types/inference.ts#L418-L465',
'ml._types.InferenceConfigCreateContainer': 'ml/_types/inference.ts#L23-L72',
'ml._types.InferenceConfigUpdateContainer': 'ml/_types/inference.ts#L280-L302',
'ml._types.InferenceResponseResult': 'ml/_types/inference.ts#L443-L490',
'ml._types.Influence': 'ml/_types/Anomaly.ts#L140-L143',
'ml._types.Influencer': 'ml/_types/Influencer.ts#L31-L83',
'ml._types.Job': 'ml/_types/Job.ts#L51-L75',
Expand All @@ -1662,61 +1662,63 @@
'ml._types.ModelSizeStats': 'ml/_types/Model.ts#L56-L78',
'ml._types.ModelSnapshot': 'ml/_types/Model.ts#L25-L46',
'ml._types.ModelSnapshotUpgrade': 'ml/_types/Model.ts#L48-L54',
'ml._types.NerInferenceOptions': 'ml/_types/inference.ts#L230-L239',
'ml._types.NerInferenceUpdateOptions': 'ml/_types/inference.ts#L363-L368',
'ml._types.NlpBertTokenizationConfig': 'ml/_types/inference.ts#L116-L143',
'ml._types.NlpRobertaTokenizationConfig': 'ml/_types/inference.ts#L145-L172',
'ml._types.NlpTokenizationUpdateOptions': 'ml/_types/inference.ts#L321-L326',
'ml._types.NerInferenceOptions': 'ml/_types/inference.ts#L245-L254',
'ml._types.NerInferenceUpdateOptions': 'ml/_types/inference.ts#L388-L393',
'ml._types.NlpBertTokenizationConfig': 'ml/_types/inference.ts#L121-L148',
'ml._types.NlpRobertaTokenizationConfig': 'ml/_types/inference.ts#L150-L177',
'ml._types.NlpTokenizationUpdateOptions': 'ml/_types/inference.ts#L340-L345',
'ml._types.OutlierDetectionParameters': 'ml/_types/DataframeAnalytics.ts#L412-L419',
'ml._types.OverallBucket': 'ml/_types/Bucket.ts#L130-L145',
'ml._types.OverallBucketJob': 'ml/_types/Bucket.ts#L146-L149',
'ml._types.Page': 'ml/_types/Page.ts#L22-L33',
'ml._types.PassThroughInferenceOptions': 'ml/_types/inference.ts#L209-L216',
'ml._types.PassThroughInferenceUpdateOptions': 'ml/_types/inference.ts#L350-L355',
'ml._types.PassThroughInferenceOptions': 'ml/_types/inference.ts#L214-L221',
'ml._types.PassThroughInferenceUpdateOptions': 'ml/_types/inference.ts#L369-L374',
'ml._types.PerPartitionCategorization': 'ml/_types/Analysis.ts#L93-L102',
'ml._types.QuestionAnsweringInferenceOptions': 'ml/_types/inference.ts#L251-L261',
'ml._types.QuestionAnsweringInferenceUpdateOptions': 'ml/_types/inference.ts#L379-L390',
'ml._types.RegressionInferenceOptions': 'ml/_types/inference.ts#L69-L78',
'ml._types.RoutingState': 'ml/_types/TrainedModel.ts#L341-L362',
'ml._types.QuestionAnsweringInferenceOptions': 'ml/_types/inference.ts#L266-L276',
'ml._types.QuestionAnsweringInferenceUpdateOptions': 'ml/_types/inference.ts#L404-L415',
'ml._types.RegressionInferenceOptions': 'ml/_types/inference.ts#L74-L83',
'ml._types.RoutingState': 'ml/_types/TrainedModel.ts#L343-L364',
'ml._types.RuleAction': 'ml/_types/Rule.ts#L41-L50',
'ml._types.RuleCondition': 'ml/_types/Rule.ts#L52-L65',
'ml._types.RunningStateSearchInterval': 'ml/_types/Datafeed.ts#L164-L169',
'ml._types.SnapshotUpgradeState': 'ml/_types/Model.ts#L91-L96',
'ml._types.TextClassificationInferenceOptions': 'ml/_types/inference.ts#L174-L184',
'ml._types.TextClassificationInferenceUpdateOptions': 'ml/_types/inference.ts#L328-L337',
'ml._types.TextEmbeddingInferenceOptions': 'ml/_types/inference.ts#L222-L228',
'ml._types.TextEmbeddingInferenceUpdateOptions': 'ml/_types/inference.ts#L357-L361',
'ml._types.TextClassificationInferenceOptions': 'ml/_types/inference.ts#L179-L189',
'ml._types.TextClassificationInferenceUpdateOptions': 'ml/_types/inference.ts#L347-L356',
'ml._types.TextEmbeddingInferenceOptions': 'ml/_types/inference.ts#L227-L235',
'ml._types.TextEmbeddingInferenceUpdateOptions': 'ml/_types/inference.ts#L376-L380',
'ml._types.TextExpansionInferenceOptions': 'ml/_types/inference.ts#L237-L243',
'ml._types.TextExpansionInferenceUpdateOptions': 'ml/_types/inference.ts#L382-L386',
'ml._types.TimingStats': 'ml/_types/DataframeAnalytics.ts#L421-L426',
'ml._types.TokenizationConfigContainer': 'ml/_types/inference.ts#L97-L114',
'ml._types.TokenizationTruncate': 'ml/_types/inference.ts#L315-L319',
'ml._types.TopClassEntry': 'ml/_types/inference.ts#L399-L403',
'ml._types.TotalFeatureImportance': 'ml/_types/TrainedModel.ts#L224-L231',
'ml._types.TotalFeatureImportanceClass': 'ml/_types/TrainedModel.ts#L233-L238',
'ml._types.TotalFeatureImportanceStatistics': 'ml/_types/TrainedModel.ts#L240-L247',
'ml._types.TrainedModelAssignment': 'ml/_types/TrainedModel.ts#L393-L408',
'ml._types.TrainedModelAssignmentRoutingTable': 'ml/_types/TrainedModel.ts#L364-L382',
'ml._types.TrainedModelAssignmentTaskParameters': 'ml/_types/TrainedModel.ts#L307-L339',
'ml._types.TrainedModelConfig': 'ml/_types/TrainedModel.ts#L157-L191',
'ml._types.TrainedModelConfigInput': 'ml/_types/TrainedModel.ts#L193-L196',
'ml._types.TrainedModelConfigMetadata': 'ml/_types/TrainedModel.ts#L198-L206',
'ml._types.TrainedModelDeploymentAllocationStatus': 'ml/_types/TrainedModel.ts#L384-L391',
'ml._types.TrainedModelDeploymentNodesStats': 'ml/_types/TrainedModel.ts#L128-L155',
'ml._types.TrainedModelDeploymentStats': 'ml/_types/TrainedModel.ts#L62-L97',
'ml._types.TrainedModelEntities': 'ml/_types/inference.ts#L392-L398',
'ml._types.TrainedModelInferenceClassImportance': 'ml/_types/inference.ts#L405-L408',
'ml._types.TrainedModelInferenceFeatureImportance': 'ml/_types/inference.ts#L410-L414',
'ml._types.TrainedModelInferenceStats': 'ml/_types/TrainedModel.ts#L99-L119',
'ml._types.TrainedModelLocation': 'ml/_types/TrainedModel.ts#L410-L412',
'ml._types.TrainedModelLocationIndex': 'ml/_types/TrainedModel.ts#L414-L416',
'ml._types.TrainedModelSizeStats': 'ml/_types/TrainedModel.ts#L121-L126',
'ml._types.TokenizationConfigContainer': 'ml/_types/inference.ts#L102-L119',
'ml._types.TokenizationTruncate': 'ml/_types/inference.ts#L334-L338',
'ml._types.TopClassEntry': 'ml/_types/inference.ts#L424-L428',
'ml._types.TotalFeatureImportance': 'ml/_types/TrainedModel.ts#L226-L233',
'ml._types.TotalFeatureImportanceClass': 'ml/_types/TrainedModel.ts#L235-L240',
'ml._types.TotalFeatureImportanceStatistics': 'ml/_types/TrainedModel.ts#L242-L249',
'ml._types.TrainedModelAssignment': 'ml/_types/TrainedModel.ts#L395-L410',
'ml._types.TrainedModelAssignmentRoutingTable': 'ml/_types/TrainedModel.ts#L366-L384',
'ml._types.TrainedModelAssignmentTaskParameters': 'ml/_types/TrainedModel.ts#L309-L341',
'ml._types.TrainedModelConfig': 'ml/_types/TrainedModel.ts#L159-L193',
'ml._types.TrainedModelConfigInput': 'ml/_types/TrainedModel.ts#L195-L198',
'ml._types.TrainedModelConfigMetadata': 'ml/_types/TrainedModel.ts#L200-L208',
'ml._types.TrainedModelDeploymentAllocationStatus': 'ml/_types/TrainedModel.ts#L386-L393',
'ml._types.TrainedModelDeploymentNodesStats': 'ml/_types/TrainedModel.ts#L130-L157',
'ml._types.TrainedModelDeploymentStats': 'ml/_types/TrainedModel.ts#L62-L99',
'ml._types.TrainedModelEntities': 'ml/_types/inference.ts#L417-L423',
'ml._types.TrainedModelInferenceClassImportance': 'ml/_types/inference.ts#L430-L433',
'ml._types.TrainedModelInferenceFeatureImportance': 'ml/_types/inference.ts#L435-L439',
'ml._types.TrainedModelInferenceStats': 'ml/_types/TrainedModel.ts#L101-L121',
'ml._types.TrainedModelLocation': 'ml/_types/TrainedModel.ts#L412-L414',
'ml._types.TrainedModelLocationIndex': 'ml/_types/TrainedModel.ts#L416-L418',
'ml._types.TrainedModelSizeStats': 'ml/_types/TrainedModel.ts#L123-L128',
'ml._types.TrainedModelStats': 'ml/_types/TrainedModel.ts#L42-L60',
'ml._types.TrainedModelType': 'ml/_types/TrainedModel.ts#L249-L263',
'ml._types.TrainingPriority': 'ml/_types/TrainedModel.ts#L302-L305',
'ml._types.TrainedModelType': 'ml/_types/TrainedModel.ts#L251-L265',
'ml._types.TrainingPriority': 'ml/_types/TrainedModel.ts#L304-L307',
'ml._types.TransformAuthorization': 'ml/_types/Authorization.ts#L59-L71',
'ml._types.ValidationLoss': 'ml/_types/DataframeAnalytics.ts#L428-L433',
'ml._types.Vocabulary': 'ml/_types/inference.ts#L218-L220',
'ml._types.ZeroShotClassificationInferenceOptions': 'ml/_types/inference.ts#L186-L207',
'ml._types.ZeroShotClassificationInferenceUpdateOptions': 'ml/_types/inference.ts#L339-L348',
'ml._types.Vocabulary': 'ml/_types/inference.ts#L223-L225',
'ml._types.ZeroShotClassificationInferenceOptions': 'ml/_types/inference.ts#L191-L212',
'ml._types.ZeroShotClassificationInferenceUpdateOptions': 'ml/_types/inference.ts#L358-L367',
'ml.clear_trained_model_deployment_cache.Request': 'ml/clear_trained_model_deployment_cache/MlClearTrainedModelDeploymentCacheRequest.ts#L25-L42',
'ml.clear_trained_model_deployment_cache.Response': 'ml/clear_trained_model_deployment_cache/MlClearTrainedModelDeploymentCacheResponse.ts#L20-L24',
'ml.close_job.Request': 'ml/close_job/MlCloseJobRequest.ts#L24-L77',
Expand Down Expand Up @@ -2581,10 +2583,10 @@
if (hash.length > 1) {
hash = hash.substring(1);
}
window.location = "https://github.com/elastic/elasticsearch-specification/tree/06b773c0e3534f9e823a43b6b23bd901ccc2d28a/specification/" + (paths[hash] || "");
window.location = "https://github.com/elastic/elasticsearch-specification/tree/819413aa006cfc829eb9abd18068a82d972279e7/specification/" + (paths[hash] || "");
</script>
</head>
<body>
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/06b773c0e3534f9e823a43b6b23bd901ccc2d28a/specification/">Elasticsearch API specification</a>.
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/819413aa006cfc829eb9abd18068a82d972279e7/specification/">Elasticsearch API specification</a>.
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ public enum Kind implements JsonEnum {

TextEmbedding("text_embedding"),

TextExpansion("text_expansion"),

QuestionAnswering("question_answering"),

;
Expand Down Expand Up @@ -264,6 +266,23 @@ public TextEmbeddingInferenceOptions textEmbedding() {
return TaggedUnionUtils.get(this, Kind.TextEmbedding);
}

/**
* Is this variant instance of kind {@code text_expansion}?
*/
public boolean isTextExpansion() {
return _kind == Kind.TextExpansion;
}

/**
* Get the {@code text_expansion} variant value.
*
* @throws IllegalStateException
* if the current variant is not of the {@code text_expansion} kind.
*/
public TextExpansionInferenceOptions textExpansion() {
return TaggedUnionUtils.get(this, Kind.TextExpansion);
}

/**
* Is this variant instance of kind {@code question_answering}?
*/
Expand Down Expand Up @@ -400,6 +419,17 @@ public ObjectBuilder<InferenceConfigCreate> textEmbedding(
return this.textEmbedding(fn.apply(new TextEmbeddingInferenceOptions.Builder()).build());
}

public ObjectBuilder<InferenceConfigCreate> textExpansion(TextExpansionInferenceOptions v) {
this._kind = Kind.TextExpansion;
this._value = v;
return this;
}

public ObjectBuilder<InferenceConfigCreate> textExpansion(
Function<TextExpansionInferenceOptions.Builder, ObjectBuilder<TextExpansionInferenceOptions>> fn) {
return this.textExpansion(fn.apply(new TextExpansionInferenceOptions.Builder()).build());
}

public ObjectBuilder<InferenceConfigCreate> questionAnswering(QuestionAnsweringInferenceOptions v) {
this._kind = Kind.QuestionAnswering;
this._value = v;
Expand Down Expand Up @@ -429,6 +459,7 @@ protected static void setupInferenceConfigCreateDeserializer(ObjectDeserializer<
op.add(Builder::ner, NerInferenceOptions._DESERIALIZER, "ner");
op.add(Builder::passThrough, PassThroughInferenceOptions._DESERIALIZER, "pass_through");
op.add(Builder::textEmbedding, TextEmbeddingInferenceOptions._DESERIALIZER, "text_embedding");
op.add(Builder::textExpansion, TextExpansionInferenceOptions._DESERIALIZER, "text_expansion");
op.add(Builder::questionAnswering, QuestionAnsweringInferenceOptions._DESERIALIZER, "question_answering");

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,25 @@ public static InferenceConfigCreate textEmbedding(
return builder.build();
}

/**
* Creates a builder for the {@link TextExpansionInferenceOptions
* text_expansion} {@code InferenceConfigCreate} variant.
*/
public static TextExpansionInferenceOptions.Builder textExpansion() {
return new TextExpansionInferenceOptions.Builder();
}

/**
* Creates a InferenceConfigCreate of the {@link TextExpansionInferenceOptions
* text_expansion} {@code InferenceConfigCreate} variant.
*/
public static InferenceConfigCreate textExpansion(
Function<TextExpansionInferenceOptions.Builder, ObjectBuilder<TextExpansionInferenceOptions>> fn) {
InferenceConfigCreate.Builder builder = new InferenceConfigCreate.Builder();
builder.textExpansion(fn.apply(new TextExpansionInferenceOptions.Builder()).build());
return builder.build();
}

/**
* Creates a builder for the {@link QuestionAnsweringInferenceOptions
* question_answering} {@code InferenceConfigCreate} variant.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public enum Kind implements JsonEnum {

TextEmbedding("text_embedding"),

TextExpansion("text_expansion"),

QuestionAnswering("question_answering"),

;
Expand Down Expand Up @@ -263,6 +265,23 @@ public TextEmbeddingInferenceUpdateOptions textEmbedding() {
return TaggedUnionUtils.get(this, Kind.TextEmbedding);
}

/**
* Is this variant instance of kind {@code text_expansion}?
*/
public boolean isTextExpansion() {
return _kind == Kind.TextExpansion;
}

/**
* Get the {@code text_expansion} variant value.
*
* @throws IllegalStateException
* if the current variant is not of the {@code text_expansion} kind.
*/
public TextExpansionInferenceUpdateOptions textExpansion() {
return TaggedUnionUtils.get(this, Kind.TextExpansion);
}

/**
* Is this variant instance of kind {@code question_answering}?
*/
Expand Down Expand Up @@ -401,6 +420,17 @@ public ObjectBuilder<InferenceConfigUpdate> textEmbedding(
return this.textEmbedding(fn.apply(new TextEmbeddingInferenceUpdateOptions.Builder()).build());
}

public ObjectBuilder<InferenceConfigUpdate> textExpansion(TextExpansionInferenceUpdateOptions v) {
this._kind = Kind.TextExpansion;
this._value = v;
return this;
}

public ObjectBuilder<InferenceConfigUpdate> textExpansion(
Function<TextExpansionInferenceUpdateOptions.Builder, ObjectBuilder<TextExpansionInferenceUpdateOptions>> fn) {
return this.textExpansion(fn.apply(new TextExpansionInferenceUpdateOptions.Builder()).build());
}

public ObjectBuilder<InferenceConfigUpdate> questionAnswering(QuestionAnsweringInferenceUpdateOptions v) {
this._kind = Kind.QuestionAnswering;
this._value = v;
Expand Down Expand Up @@ -431,6 +461,7 @@ protected static void setupInferenceConfigUpdateDeserializer(ObjectDeserializer<
op.add(Builder::ner, NerInferenceUpdateOptions._DESERIALIZER, "ner");
op.add(Builder::passThrough, PassThroughInferenceUpdateOptions._DESERIALIZER, "pass_through");
op.add(Builder::textEmbedding, TextEmbeddingInferenceUpdateOptions._DESERIALIZER, "text_embedding");
op.add(Builder::textExpansion, TextExpansionInferenceUpdateOptions._DESERIALIZER, "text_expansion");
op.add(Builder::questionAnswering, QuestionAnsweringInferenceUpdateOptions._DESERIALIZER, "question_answering");

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,26 @@ public static InferenceConfigUpdate textEmbedding(
return builder.build();
}

/**
* Creates a builder for the {@link TextExpansionInferenceUpdateOptions
* text_expansion} {@code InferenceConfigUpdate} variant.
*/
public static TextExpansionInferenceUpdateOptions.Builder textExpansion() {
return new TextExpansionInferenceUpdateOptions.Builder();
}

/**
* Creates a InferenceConfigUpdate of the
* {@link TextExpansionInferenceUpdateOptions text_expansion}
* {@code InferenceConfigUpdate} variant.
*/
public static InferenceConfigUpdate textExpansion(
Function<TextExpansionInferenceUpdateOptions.Builder, ObjectBuilder<TextExpansionInferenceUpdateOptions>> fn) {
InferenceConfigUpdate.Builder builder = new InferenceConfigUpdate.Builder();
builder.textExpansion(fn.apply(new TextExpansionInferenceUpdateOptions.Builder()).build());
return builder.build();
}

/**
* Creates a builder for the {@link QuestionAnsweringInferenceUpdateOptions
* question_answering} {@code InferenceConfigUpdate} variant.
Expand Down
Loading

0 comments on commit 082fe35

Please sign in to comment.