Class CustomServiceSettings.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<CustomServiceSettings.Builder>
co.elastic.clients.elasticsearch.inference.CustomServiceSettings.Builder
- All Implemented Interfaces:
WithJson<CustomServiceSettings.Builder>
,ObjectBuilder<CustomServiceSettings>
- Enclosing class:
- CustomServiceSettings
public static class CustomServiceSettings.Builder
extends WithJsonObjectBuilderBase<CustomServiceSettings.Builder>
implements ObjectBuilder<CustomServiceSettings>
Builder for
CustomServiceSettings
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aCustomServiceSettings
.Specifies the HTTPS header parameters – such asAuthentication
orContet-Type
– that are required to access the custom service.Specifies the input type translation values that are used to replace the${input_type}
template in the request body.queryParameters
(JsonData value) Specifies the query parameters as a list of tuples.request
(CustomRequestParams value) Required - The request configuration object.Required - The request configuration object.response
(CustomResponseParams value) Required - The response configuration object.Required - The response configuration object.secretParameters
(JsonData value) Required - Specifies secret parameters, likeapi_key
orapi_token
, that are required to access the custom service.protected CustomServiceSettings.Builder
self()
The URL endpoint to use for the requests.Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
headers
Specifies the HTTPS header parameters – such asAuthentication
orContet-Type
– that are required to access the custom service. For example:"headers":{ "Authorization": "Bearer ${api_key}", "Content-Type": "application/json;charset=utf-8" }
API name:
headers
-
inputType
Specifies the input type translation values that are used to replace the${input_type}
template in the request body. For example:"input_type": { "translation": { "ingest": "do_ingest", "search": "do_search" }, "default": "a_default" },
If the subsequent inference requests come from a search context, the
search
key will be used and the template will be replaced withdo_search
. If it comes from the ingest contextdo_ingest
is used. If it's a different context that is not specified, the default value will be used. If no default is specified an empty string is used.translation
can be:classification
clustering
ingest
search
API name:
input_type
-
queryParameters
Specifies the query parameters as a list of tuples. The arrays inside thequery_parameters
must have two items, a key and a value. For example:"query_parameters":[ ["param_key", "some_value"], ["param_key", "another_value"], ["other_key", "other_value"] ]
If the base url is
https://www.elastic.co
it results in:https://www.elastic.co?param_key=some_value¶m_key=another_value&other_key=other_value
.API name:
query_parameters
-
request
Required - The request configuration object.API name:
request
-
request
public final CustomServiceSettings.Builder request(Function<CustomRequestParams.Builder, ObjectBuilder<CustomRequestParams>> fn) Required - The request configuration object.API name:
request
-
response
Required - The response configuration object.API name:
response
-
response
public final CustomServiceSettings.Builder response(Function<CustomResponseParams.Builder, ObjectBuilder<CustomResponseParams>> fn) Required - The response configuration object.API name:
response
-
secretParameters
Required - Specifies secret parameters, likeapi_key
orapi_token
, that are required to access the custom service. For example:"secret_parameters":{ "api_key":"<api_key>" }
API name:
secret_parameters
-
url
The URL endpoint to use for the requests.API name:
url
-
self
- Specified by:
self
in classWithJsonObjectBuilderBase<CustomServiceSettings.Builder>
-
build
Builds aCustomServiceSettings
.- Specified by:
build
in interfaceObjectBuilder<CustomServiceSettings>
- Throws:
NullPointerException
- if some of the required fields are null.
-