Class PutModelRequest.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<BuilderT>
co.elastic.clients.elasticsearch._types.RequestBase.AbstractBuilder<PutModelRequest.Builder>
co.elastic.clients.elasticsearch.inference.PutModelRequest.Builder
- All Implemented Interfaces:
WithJson<PutModelRequest.Builder>,ObjectBuilder<PutModelRequest>
- Enclosing class:
- PutModelRequest
public static class PutModelRequest.Builder
extends RequestBase.AbstractBuilder<PutModelRequest.Builder>
implements ObjectBuilder<PutModelRequest>
Builder for
PutModelRequest.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aPutModelRequest.final PutModelRequest.BuildermodelConfig(ModelConfig value) Required - Request body.final PutModelRequest.BuilderRequired - Request body.final PutModelRequest.BuilderRequired - The unique identifier of the inference model.protected PutModelRequest.Builderself()final PutModelRequest.BuilderRequired - The model task typewithJson(jakarta.json.stream.JsonParser parser, JsonpMapper mapper) Sets additional properties values on this object by reading from a JSON input.Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
modelId
Required - The unique identifier of the inference model.API name:
model_id -
taskType
Required - The model task typeAPI name:
task_type -
modelConfig
Required - Request body. -
modelConfig
public final PutModelRequest.Builder modelConfig(Function<ModelConfig.Builder, ObjectBuilder<ModelConfig>> fn) Required - Request body. -
withJson
Description copied from interface:WithJsonSets additional properties values on this object by reading from a JSON input.This is a "partial deserialization": properties that were already set keep their value if they're not present in the JSON input, and properties can also be set after having called this method, including overriding those read from the JSON input.
This low level variant of
withJsongives full control on the json parser and object mapper. Most of the time usingWithJson.withJson(Reader)andWithJson.withJson(InputStream)will be more convenient.- Specified by:
withJsonin interfaceWithJson<PutModelRequest.Builder>- Overrides:
withJsonin classWithJsonObjectBuilderBase<PutModelRequest.Builder>- Parameters:
parser- the JSONP parsermapper- the JSONP mapper used to deserialize values and nested objects- Returns:
- this object
-
self
- Specified by:
selfin classRequestBase.AbstractBuilder<PutModelRequest.Builder>
-
build
Builds aPutModelRequest.- Specified by:
buildin interfaceObjectBuilder<PutModelRequest>- Throws:
NullPointerException- if some of the required fields are null.
-