diff --git a/java-client-serverless/README.md b/java-client-serverless/README.md deleted file mode 100644 index a0f239151..000000000 --- a/java-client-serverless/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Java API client for the Elasticsearch Serverless Service. - -A flavor of the Java API client for the upcoming [Elasticsearch Serverless Service](https://www.elastic.co/search-labs/stateless-your-new-state-of-find-with-elasticsearch). - - -The major difference is that Elasticsearch Serverless will abstract all infrastructure concerns from users, and as such has a reduced API surface. This new flavor of the Elasticsearch Java API client uses the same base framework and same package names as the "regular" client, but with a reduced number of APIs. - -It is meant for users who want to ensure their code will work on the current Elasticsearch and the upcoming Serverless flavor. - -## Usage - -In the initial preview phase, this new flavor of the Java API client is published on the [GitHub project's Maven repository](https://github.com/elastic/elasticsearch-java/packages/1934787). - -To install it, you need to add this repository to your project. This requires to authenticate to GitHub with an application token. Example with Gradle: - -``` -repositories { - maven { - name = "GitHubElasticsearchJava" - url = uri("https://maven.pkg.github.com/elastic/elasticsearch-java") - // See https://docs.gradle.org/current/samples/sample_publishing_credentials.html - credentials(PasswordCredentials::class) - } -} - -dependencies { - implementation("co.elastic.clients", "elasticsearch-java-serverless", "1.0.0-20231031-SNAPSHOT") -} -``` - -## Implementation details - -This project is parallel to [java-client](../java-client). The Java packages that are common to both projects are shared using symbolic links from this project to [java-client](../java-client). This ensures minimal disruption in the code layout and build system while avoiding code duplication. - -In the future, the Java API client will be split into different modules, and there will be parent modules for the two flavors with dependencies on child modules. - - - - diff --git a/java-client-serverless/build.gradle.kts b/java-client-serverless/build.gradle.kts deleted file mode 100644 index 9b6c1f5e1..000000000 --- a/java-client-serverless/build.gradle.kts +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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 com.github.jk1.license.ProjectData -import com.github.jk1.license.render.LicenseDataCollector -import com.github.jk1.license.render.ReportRenderer -import java.io.File -import java.io.FileWriter - -plugins { - java - `java-library` - checkstyle - `maven-publish` - signing - id("com.github.jk1.dependency-license-report") version "2.2" - id("de.thetaphi.forbiddenapis") version "3.4" -} - -checkstyle { - toolVersion = "10.16.0" -} - -version = (File(project.rootDir, "config/version-serverless.txt").readText().trim() + "-SNAPSHOT") - -signing { - sign(publishing.publications) -} - -java { - targetCompatibility = JavaVersion.VERSION_1_8 - sourceCompatibility = JavaVersion.VERSION_1_8 - - withJavadocJar() - withSourcesJar() -} - -sourceSets { - main { - java.srcDir("src/main-flavored/java") - } -} - -forbiddenApis { - signaturesFiles = files(File(rootProject.projectDir, "config/forbidden-apis.txt")) - suppressAnnotations = setOf("co.elastic.clients.util.AllowForbiddenApis") -} - -tasks.forbiddenApisMain { - bundledSignatures = setOf("jdk-system-out") -} - -tasks.getByName("processResources") { - eachFile { - if (name != "apis.json") { - // Only process main source-set resources (test files are large) - expand( - "version" to version, - "git_revision" to (if (rootProject.extra.has("gitHashFull")) rootProject.extra["gitHashFull"] else "unknown") - ) - } - } -} - -tasks.withType { - useJUnitPlatform() -} - -tasks.withType { - doFirst { - if (rootProject.extra.has("gitHashFull")) { - val jar = this as Jar - jar.manifest.attributes["X-Git-Revision"] = rootProject.extra["gitHashFull"] - jar.manifest.attributes["X-Git-Commit-Time"] = rootProject.extra["gitCommitTime"] - } else { - throw GradleException("No git information available") - } - } - - manifest { - attributes["Implementation-Title"] = "Elasticsearch Java client (Serverless edition)" - attributes["Implementation-Vendor"] = "Elastic" - attributes["Implementation-URL"] = "https://github.com/elastic/elasticsearch-java/" - attributes["Build-Date"] = rootProject.extra["buildTime"] - } - - metaInf { - from("../LICENSE.txt") - from("../NOTICE.txt") - } -} - -tasks.withType { - val opt = options as StandardJavadocDocletOptions - // Gradle calls javadoc with a list of file and not a path. This prevents doc-files from being copied. - opt.addStringOption("sourcepath", project.projectDir.path + "/src/main/java") - opt.docFilesSubDirs(true) - opt.addBooleanOption("Xdoclint:-missing", true) - - doLast { - // Javadoc adds its decoration to html doc files, including quite some JS. This slows down the api spec - // redirector that doesn't need it. So overwrite the target file with the original one. - val specFile = "co/elastic/clients/elasticsearch/doc-files/api-spec.html" - val source = File(project.projectDir, "src/main/java/" + specFile) - val target = File(project.projectDir, "build/docs/javadoc/" + specFile) - source.copyTo(target, overwrite = true) - } -} - - -publishing { - repositories { - maven { - // See https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry - // and https://docs.gradle.org/current/samples/sample_publishing_credentials.html - name = "ESJavaGithubPackages" - url = uri("https://maven.pkg.github.com/elastic/elasticsearch-java") - credentials(PasswordCredentials::class) - } - - maven { - name = "Build" - url = uri("${rootProject.buildDir}/repository") - } - - maven { - name = "MavenCentralSnapshot" - setUrl("https://s01.oss.sonatype.org/content/repositories/snapshots/") - credentials { - username = providers.gradleProperty("ossrhUsername").getOrNull() - password = providers.gradleProperty("ossrhPassword").getOrNull() - } - } - } - - publications { - register("maven") { - from(components["java"]) - pom { - name.set("Elasticsearch Java API Client (Serverless edition)") - artifactId = "elasticsearch-java-serverless" - description.set("Java API Client for Elasticsearch Serverless") - url.set("https://github.com/elastic/elasticsearch-java/") - licenses { - license { - name.set("The Apache Software License, Version 2.0") - url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") - } - } - developers { - developer { - name.set("Elastic") - url.set("https://www.elastic.co") - inceptionYear.set("2020") - } - } - scm { - connection.set("scm:git:https://github.com/elastic/elasticsearch-java.git") - developerConnection.set("scm:git:ssh://git@github.com:elastic/elasticsearch-java.git") - url.set("https://github.com/elastic/elasticsearch-java/") - } - -// Fixed version in Serverless. -// withXml { -// // Set the version of dependencies of the org.elasticsearch.client group to the one that we are building. -// // Since the unified release process releases everything at once, this ensures all published artifacts depend -// // on the exact same version. This assumes of course that the binary API and the behavior of these dependencies -// // are the same as the one used in the dependency section below. -// val xPathFactory = javax.xml.xpath.XPathFactory.newInstance() -// val depSelector = xPathFactory.newXPath() -// .compile("/project/dependencies/dependency[groupId/text() = 'org.elasticsearch.client']") -// val versionSelector = xPathFactory.newXPath().compile("version") -// -// var foundVersion = false; -// -// val deps = depSelector.evaluate(asElement().ownerDocument, javax.xml.xpath.XPathConstants.NODESET) -// as org.w3c.dom.NodeList -// -// for (i in 0 until deps.length) { -// val dep = deps.item(i) -// val version = versionSelector.evaluate(dep, javax.xml.xpath.XPathConstants.NODE) as org.w3c.dom.Element -// foundVersion = true; -// version.textContent = project.version.toString() -// } -// -// if (!foundVersion) { -// throw GradleException("Could not find a 'org.elasticsearch.client' to update dependency version in the POM.") -// } -// } - } - } - } -} - -dependencies { - val elasticsearchVersion = "8.10.0" - val jacksonVersion = "2.17.0" - val openTelemetryVersion = "1.29.0" - - // Apache 2.0 - // https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-low.html - api("org.elasticsearch.client", "elasticsearch-rest-client", elasticsearchVersion) - - // Apache 2.0 - // https://search.maven.org/artifact/com.google.code.findbugs/jsr305 - api("com.google.code.findbugs:jsr305:3.0.2") - - // EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - // https://github.com/eclipse-ee4j/jsonp - api("jakarta.json:jakarta.json-api:2.0.1") - - // Needed even if using Jackson to have an implementation of the Jsonp object model - // EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - // https://github.com/eclipse-ee4j/parsson - api("org.eclipse.parsson:parsson:1.0.5") - - // OpenTelemetry API for native instrumentation of the client. - // Apache 2.0 - // https://github.com/open-telemetry/opentelemetry-java - implementation("io.opentelemetry", "opentelemetry-api", openTelemetryVersion) - // Use it once it's stable (see Instrumentation.java). Limited to tests for now. - testImplementation("io.opentelemetry", "opentelemetry-semconv", "$openTelemetryVersion-alpha") - - // EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - // https://github.com/eclipse-ee4j/jsonb-api - compileOnly("jakarta.json.bind", "jakarta.json.bind-api", "2.0.0") - testImplementation("jakarta.json.bind", "jakarta.json.bind-api", "2.0.0") - - // Apache 2.0 - // https://github.com/FasterXML/jackson - compileOnly("com.fasterxml.jackson.core", "jackson-core", jacksonVersion) - compileOnly("com.fasterxml.jackson.core", "jackson-databind", jacksonVersion) - testImplementation("com.fasterxml.jackson.core", "jackson-core", jacksonVersion) - testImplementation("com.fasterxml.jackson.core", "jackson-databind", jacksonVersion) - - // EPL-2.0 OR BSD-3-Clause - // https://eclipse-ee4j.github.io/yasson/ - testImplementation("org.eclipse", "yasson", "2.0.4") { - // Exclude Glassfish as we use Parsson (basically Glassfish renamed in the Jakarta namespace). - exclude(group = "org.glassfish", module = "jakarta.json") - } - - // Apache-2.0 - testImplementation("commons-io:commons-io:2.17.0") - - // EPL-2.0 - // https://junit.org/junit5/ - testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") - - // MIT - // https://github.com/classgraph/classgraph - testImplementation("io.github.classgraph:classgraph:4.8.147") - - // MIT - // https://www.testcontainers.org/ - testImplementation("org.testcontainers", "testcontainers", "1.17.3") - testImplementation("org.testcontainers", "elasticsearch", "1.17.3") - // updating transitive dependency from testcontainers - testImplementation("org.apache.commons","commons-compress","1.26.1") - - testImplementation("io.opentelemetry", "opentelemetry-sdk", openTelemetryVersion) -} - - -licenseReport { - renderers = arrayOf(SpdxReporter(File(rootProject.buildDir, "release/dependencies.csv"))) - excludeGroups = arrayOf("org.elasticsearch.client") -} - -class SpdxReporter(val dest: File) : ReportRenderer { - // License names to their SPDX identifier - val spdxIds = mapOf( - "The Apache License, Version 2.0" to "Apache-2.0", - "Apache License, Version 2.0" to "Apache-2.0", - "The Apache Software License, Version 2.0" to "Apache-2.0", - "BSD Zero Clause License" to "0BSD", - "Eclipse Public License 2.0" to "EPL-2.0", - "Eclipse Public License v. 2.0" to "EPL-2.0", - "Eclipse Public License - v 2.0" to "EPL-2.0", - "GNU General Public License, version 2 with the GNU Classpath Exception" to "GPL-2.0 WITH Classpath-exception-2.0", - "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0" to "CDDL-1.0" - ) - - private fun quote(str: String): String { - return if (str.contains(',') || str.contains("\"")) { - "\"" + str.replace("\"", "\"\"") + "\"" - } else { - str - } - } - - override fun render(data: ProjectData?) { - dest.parentFile.mkdirs() - FileWriter(dest).use { out -> - out.append("name,url,version,revision,license\n") - data?.allDependencies?.forEach { dep -> - - val depVersion = dep.version - val depName = dep.group + ":" + dep.name - - val info = LicenseDataCollector.multiModuleLicenseInfo(dep) - val depUrl = info.moduleUrls.first() - - val licenseIds = info.licenses.mapNotNull { license -> - license.name?.let { - checkNotNull(spdxIds[it]) { "No SPDX identifier for $license" } - } - }.toSet() - - // Combine multiple licenses. - // See https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/#composite-license-expressions - val licenseId = licenseIds.joinToString(" OR ") - - out.append("${quote(depName)},${quote(depUrl)},${quote(depVersion)},,${quote(licenseId)}\n") - } - } - } -} diff --git a/java-client-serverless/docs/getting-started.mdx b/java-client-serverless/docs/getting-started.mdx deleted file mode 100644 index 89c731088..000000000 --- a/java-client-serverless/docs/getting-started.mdx +++ /dev/null @@ -1,166 +0,0 @@ ---- -id: gettingStartedServerlessJava -slug: /serverless-java/docs/getting-started -title: Getting started with the Serverless Java client -description: This page contains quickstart information about the Serverless Java client. -date: 2023-06-27 -tags: ['serverless','Java client','docs', 'getting started', 'Java'] ---- - -This page guides you through the installation process of the Serverless Java -client, shows you how to instantiate the client, and how to perform basic -Elasticsearch operations with it. - -## Requirements - -* Java 8 or later. -* A JSON object mapping library to allow seamless integration of -your application classes with the Elasticsearch API. The examples below -show usage with Jackson. - -## Installation - -You can add the Elasticsearch Serverless Java client to your Java project using either Gradle or Maven. - -### Using Gradle - -```groovy -dependencies { - implementation 'co.elastic.clients:elasticsearch-java-serverless:1.0.0-20231031' - implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.0' -} -``` - -### Using Maven - -In the `pom.xml` of your project, add the following dependencies: - -```xml - - - - - co.elastic.clients - elasticsearch-java-serverless - 1.0.0-20231031 - - - - com.fasterxml.jackson.core - jackson-databind - 2.17.0 - - - - -``` - -## Instantiate a client - -You can connect to the Elasticsearch Service using an API key and the Elasticsearch endpoint: - -```java -// URL and API key -String serverUrl = "https://...elastic.cloud"; -String apiKey = "VnVhQ2ZHY0JDZGJrU..."; - -// Create the low-level client -RestClient restClient = RestClient - .builder(HttpHost.create(serverUrl)) - .setDefaultHeaders(new Header[]{ - new BasicHeader("Authorization", "ApiKey " + apiKey) - }) - .build(); - -// Create the transport with a Jackson mapper -ElasticsearchTransport transport = new RestClientTransport( - restClient, new JacksonJsonpMapper()); - -// And create the API client -ElasticsearchClient esClient = new ElasticsearchClient(transport); -``` - -You can find the Elasticsearch endpoint on the Cloud deployment management page. - - - -You can create a new API Key under **Stack Management** > **Security**: - - - - -## Using the API - -After you instantiated a client with your API key and Elasticsearch endpoint, -you can start ingesting documents into the Elasticsearch Service. - - -### Creating an index and ingesting documents - -You can call the `bulk` API with a body parameter, an array of hashes that -define the action, and a document. - -The following is an example of indexing a document, here a `Product` application object -in the `products` index: - -```java -Product product = new Product("bk-1", "City bike", 123.0); - -IndexResponse response = esClient.index(i -> i - .index("products") - .id(product.getSku()) - .document(product) -); - -logger.info("Indexed with version " + response.version()); -``` - -### Searching - -Now that some data is available, you can search your documents using the -**Search API**: - -```java -String searchText = "bike"; - -SearchResponse response = esClient.search(s -> s - .index("products") - .query(q -> q - .match(t -> t - .field("name") - .query(searchText) - ) - ), - Product.class -); -``` - -A few things to note in the above example: -* the search query is built using a hierarchy of lambda expressions that closely follows the - Elasticsearch JSON API. Lambda expressions allows you to be guided by your IDE's autocompletion, without - having to import (or even know!) the actual classes representing a query. -* The last parameter `Product.class` instructs the client to return results as `Product` application objects - instead of raw JSON. - -### Updating - -You can update your documents using the Update API: - -```java -Product product = new Product("bk-1", "City bike", 123.0); - -esClient.update(u -> u - .index("products") - .id("bk-1") - .upsert(product), - Product.class -); -``` - -### Delete - -You can also delete documents: - -```java -esClient.delete(d -> d.index("products").id("bk-1")); -``` diff --git a/java-client-serverless/docs/images/copy-endpoint.gif b/java-client-serverless/docs/images/copy-endpoint.gif deleted file mode 100644 index af2883dfd..000000000 Binary files a/java-client-serverless/docs/images/copy-endpoint.gif and /dev/null differ diff --git a/java-client-serverless/docs/images/setup-api-key.gif b/java-client-serverless/docs/images/setup-api-key.gif deleted file mode 100644 index f638ef6bb..000000000 Binary files a/java-client-serverless/docs/images/setup-api-key.gif and /dev/null differ diff --git a/java-client-serverless/docs/index.mdx b/java-client-serverless/docs/index.mdx deleted file mode 100644 index e69de29bb..000000000 diff --git a/java-client-serverless/src/main-flavored/java/co/elastic/clients/transport/VersionInfo.java b/java-client-serverless/src/main-flavored/java/co/elastic/clients/transport/VersionInfo.java deleted file mode 100644 index affd910c4..000000000 --- a/java-client-serverless/src/main-flavored/java/co/elastic/clients/transport/VersionInfo.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.transport; - -// Package private -class VersionInfo { - static final String FLAVOR = "serverless"; - static final String VERSION = "1.0.0+20231031"; -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/ApiClient.java b/java-client-serverless/src/main/java/co/elastic/clients/ApiClient.java deleted file mode 120000 index 0e884fbdb..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/ApiClient.java +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../java-client/src/main/java/co/elastic/clients/ApiClient.java \ No newline at end of file diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java deleted file mode 100644 index d17c58377..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java +++ /dev/null @@ -1,1976 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch; - -import co.elastic.clients.ApiClient; -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch.async_search.ElasticsearchAsyncSearchAsyncClient; -import co.elastic.clients.elasticsearch.cat.ElasticsearchCatAsyncClient; -import co.elastic.clients.elasticsearch.cluster.ElasticsearchClusterAsyncClient; -import co.elastic.clients.elasticsearch.connector.ElasticsearchConnectorAsyncClient; -import co.elastic.clients.elasticsearch.core.BulkRequest; -import co.elastic.clients.elasticsearch.core.BulkResponse; -import co.elastic.clients.elasticsearch.core.ClearScrollRequest; -import co.elastic.clients.elasticsearch.core.ClearScrollResponse; -import co.elastic.clients.elasticsearch.core.ClosePointInTimeRequest; -import co.elastic.clients.elasticsearch.core.ClosePointInTimeResponse; -import co.elastic.clients.elasticsearch.core.CountRequest; -import co.elastic.clients.elasticsearch.core.CountResponse; -import co.elastic.clients.elasticsearch.core.CreateRequest; -import co.elastic.clients.elasticsearch.core.CreateResponse; -import co.elastic.clients.elasticsearch.core.DeleteByQueryRequest; -import co.elastic.clients.elasticsearch.core.DeleteByQueryResponse; -import co.elastic.clients.elasticsearch.core.DeleteRequest; -import co.elastic.clients.elasticsearch.core.DeleteResponse; -import co.elastic.clients.elasticsearch.core.DeleteScriptRequest; -import co.elastic.clients.elasticsearch.core.DeleteScriptResponse; -import co.elastic.clients.elasticsearch.core.ExistsRequest; -import co.elastic.clients.elasticsearch.core.ExistsSourceRequest; -import co.elastic.clients.elasticsearch.core.ExplainRequest; -import co.elastic.clients.elasticsearch.core.ExplainResponse; -import co.elastic.clients.elasticsearch.core.FieldCapsRequest; -import co.elastic.clients.elasticsearch.core.FieldCapsResponse; -import co.elastic.clients.elasticsearch.core.GetRequest; -import co.elastic.clients.elasticsearch.core.GetResponse; -import co.elastic.clients.elasticsearch.core.GetScriptRequest; -import co.elastic.clients.elasticsearch.core.GetScriptResponse; -import co.elastic.clients.elasticsearch.core.GetSourceRequest; -import co.elastic.clients.elasticsearch.core.GetSourceResponse; -import co.elastic.clients.elasticsearch.core.IndexRequest; -import co.elastic.clients.elasticsearch.core.IndexResponse; -import co.elastic.clients.elasticsearch.core.InfoRequest; -import co.elastic.clients.elasticsearch.core.InfoResponse; -import co.elastic.clients.elasticsearch.core.MgetRequest; -import co.elastic.clients.elasticsearch.core.MgetResponse; -import co.elastic.clients.elasticsearch.core.MsearchRequest; -import co.elastic.clients.elasticsearch.core.MsearchResponse; -import co.elastic.clients.elasticsearch.core.MsearchTemplateRequest; -import co.elastic.clients.elasticsearch.core.MsearchTemplateResponse; -import co.elastic.clients.elasticsearch.core.MtermvectorsRequest; -import co.elastic.clients.elasticsearch.core.MtermvectorsResponse; -import co.elastic.clients.elasticsearch.core.OpenPointInTimeRequest; -import co.elastic.clients.elasticsearch.core.OpenPointInTimeResponse; -import co.elastic.clients.elasticsearch.core.PingRequest; -import co.elastic.clients.elasticsearch.core.PutScriptRequest; -import co.elastic.clients.elasticsearch.core.PutScriptResponse; -import co.elastic.clients.elasticsearch.core.RankEvalRequest; -import co.elastic.clients.elasticsearch.core.RankEvalResponse; -import co.elastic.clients.elasticsearch.core.ReindexRequest; -import co.elastic.clients.elasticsearch.core.ReindexResponse; -import co.elastic.clients.elasticsearch.core.RenderSearchTemplateRequest; -import co.elastic.clients.elasticsearch.core.RenderSearchTemplateResponse; -import co.elastic.clients.elasticsearch.core.ScriptsPainlessExecuteRequest; -import co.elastic.clients.elasticsearch.core.ScriptsPainlessExecuteResponse; -import co.elastic.clients.elasticsearch.core.ScrollRequest; -import co.elastic.clients.elasticsearch.core.ScrollResponse; -import co.elastic.clients.elasticsearch.core.SearchMvtRequest; -import co.elastic.clients.elasticsearch.core.SearchRequest; -import co.elastic.clients.elasticsearch.core.SearchResponse; -import co.elastic.clients.elasticsearch.core.SearchTemplateRequest; -import co.elastic.clients.elasticsearch.core.SearchTemplateResponse; -import co.elastic.clients.elasticsearch.core.TermsEnumRequest; -import co.elastic.clients.elasticsearch.core.TermsEnumResponse; -import co.elastic.clients.elasticsearch.core.TermvectorsRequest; -import co.elastic.clients.elasticsearch.core.TermvectorsResponse; -import co.elastic.clients.elasticsearch.core.UpdateByQueryRequest; -import co.elastic.clients.elasticsearch.core.UpdateByQueryResponse; -import co.elastic.clients.elasticsearch.core.UpdateRequest; -import co.elastic.clients.elasticsearch.core.UpdateResponse; -import co.elastic.clients.elasticsearch.enrich.ElasticsearchEnrichAsyncClient; -import co.elastic.clients.elasticsearch.eql.ElasticsearchEqlAsyncClient; -import co.elastic.clients.elasticsearch.esql.ElasticsearchEsqlAsyncClient; -import co.elastic.clients.elasticsearch.graph.ElasticsearchGraphAsyncClient; -import co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesAsyncClient; -import co.elastic.clients.elasticsearch.inference.ElasticsearchInferenceAsyncClient; -import co.elastic.clients.elasticsearch.ingest.ElasticsearchIngestAsyncClient; -import co.elastic.clients.elasticsearch.license.ElasticsearchLicenseAsyncClient; -import co.elastic.clients.elasticsearch.logstash.ElasticsearchLogstashAsyncClient; -import co.elastic.clients.elasticsearch.ml.ElasticsearchMlAsyncClient; -import co.elastic.clients.elasticsearch.query_rules.ElasticsearchQueryRulesAsyncClient; -import co.elastic.clients.elasticsearch.search_application.ElasticsearchSearchApplicationAsyncClient; -import co.elastic.clients.elasticsearch.security.ElasticsearchSecurityAsyncClient; -import co.elastic.clients.elasticsearch.sql.ElasticsearchSqlAsyncClient; -import co.elastic.clients.elasticsearch.synonyms.ElasticsearchSynonymsAsyncClient; -import co.elastic.clients.elasticsearch.tasks.ElasticsearchTasksAsyncClient; -import co.elastic.clients.elasticsearch.transform.ElasticsearchTransformAsyncClient; -import co.elastic.clients.transport.ElasticsearchTransport; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.JsonEndpoint; -import co.elastic.clients.transport.Transport; -import co.elastic.clients.transport.TransportOptions; -import co.elastic.clients.transport.endpoints.BinaryResponse; -import co.elastic.clients.transport.endpoints.BooleanResponse; -import co.elastic.clients.transport.endpoints.EndpointWithResponseMapperAttr; -import co.elastic.clients.util.ObjectBuilder; -import java.lang.reflect.Type; -import java.util.concurrent.CompletableFuture; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Client for the namespace. - */ -public class ElasticsearchAsyncClient extends ApiClient { - - public ElasticsearchAsyncClient(ElasticsearchTransport transport) { - super(transport, null); - } - - public ElasticsearchAsyncClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { - super(transport, transportOptions); - } - - @Override - public ElasticsearchAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) { - return new ElasticsearchAsyncClient(this.transport, transportOptions); - } - - // ----- Child clients - - public ElasticsearchAsyncSearchAsyncClient asyncSearch() { - return new ElasticsearchAsyncSearchAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchCatAsyncClient cat() { - return new ElasticsearchCatAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchClusterAsyncClient cluster() { - return new ElasticsearchClusterAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchConnectorAsyncClient connector() { - return new ElasticsearchConnectorAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchEnrichAsyncClient enrich() { - return new ElasticsearchEnrichAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchEqlAsyncClient eql() { - return new ElasticsearchEqlAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchEsqlAsyncClient esql() { - return new ElasticsearchEsqlAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchGraphAsyncClient graph() { - return new ElasticsearchGraphAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchIndicesAsyncClient indices() { - return new ElasticsearchIndicesAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchInferenceAsyncClient inference() { - return new ElasticsearchInferenceAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchIngestAsyncClient ingest() { - return new ElasticsearchIngestAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchLicenseAsyncClient license() { - return new ElasticsearchLicenseAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchLogstashAsyncClient logstash() { - return new ElasticsearchLogstashAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchMlAsyncClient ml() { - return new ElasticsearchMlAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchQueryRulesAsyncClient queryRules() { - return new ElasticsearchQueryRulesAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchSearchApplicationAsyncClient searchApplication() { - return new ElasticsearchSearchApplicationAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchSecurityAsyncClient security() { - return new ElasticsearchSecurityAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchSqlAsyncClient sql() { - return new ElasticsearchSqlAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchSynonymsAsyncClient synonyms() { - return new ElasticsearchSynonymsAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchTasksAsyncClient tasks() { - return new ElasticsearchTasksAsyncClient(this.transport, this.transportOptions); - } - - public ElasticsearchTransformAsyncClient transform() { - return new ElasticsearchTransformAsyncClient(this.transport, this.transportOptions); - } - - // ----- Endpoint: bulk - - /** - * Bulk index or delete documents. Performs multiple indexing or delete - * operations in a single API call. This reduces overhead and can greatly - * increase indexing speed. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture bulk(BulkRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) BulkRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Bulk index or delete documents. Performs multiple indexing or delete - * operations in a single API call. This reduces overhead and can greatly - * increase indexing speed. - * - * @param fn - * a function that initializes a builder to create the - * {@link BulkRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture bulk(Function> fn) { - return bulk(fn.apply(new BulkRequest.Builder()).build()); - } - - /** - * Bulk index or delete documents. Performs multiple indexing or delete - * operations in a single API call. This reduces overhead and can greatly - * increase indexing speed. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture bulk() { - return this.transport.performRequestAsync(new BulkRequest.Builder().build(), BulkRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: clear_scroll - - /** - * Clears the search context and results for a scrolling search. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture clearScroll(ClearScrollRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ClearScrollRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Clears the search context and results for a scrolling search. - * - * @param fn - * a function that initializes a builder to create the - * {@link ClearScrollRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture clearScroll( - Function> fn) { - return clearScroll(fn.apply(new ClearScrollRequest.Builder()).build()); - } - - /** - * Clears the search context and results for a scrolling search. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture clearScroll() { - return this.transport.performRequestAsync(new ClearScrollRequest.Builder().build(), - ClearScrollRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: close_point_in_time - - /** - * Closes a point-in-time. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture closePointInTime(ClosePointInTimeRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ClosePointInTimeRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Closes a point-in-time. - * - * @param fn - * a function that initializes a builder to create the - * {@link ClosePointInTimeRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture closePointInTime( - Function> fn) { - return closePointInTime(fn.apply(new ClosePointInTimeRequest.Builder()).build()); - } - - // ----- Endpoint: count - - /** - * Returns number of documents matching a query. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture count(CountRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) CountRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Returns number of documents matching a query. - * - * @param fn - * a function that initializes a builder to create the - * {@link CountRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture count( - Function> fn) { - return count(fn.apply(new CountRequest.Builder()).build()); - } - - /** - * Returns number of documents matching a query. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture count() { - return this.transport.performRequestAsync(new CountRequest.Builder().build(), CountRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: create - - /** - * Index a document. Adds a JSON document to the specified data stream or index - * and makes it searchable. If the target is an index and the document already - * exists, the request updates the document and increments its version. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture create(CreateRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint, CreateResponse, ErrorResponse> endpoint = (JsonEndpoint, CreateResponse, ErrorResponse>) CreateRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Index a document. Adds a JSON document to the specified data stream or index - * and makes it searchable. If the target is an index and the document already - * exists, the request updates the document and increments its version. - * - * @param fn - * a function that initializes a builder to create the - * {@link CreateRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture create( - Function, ObjectBuilder>> fn) { - return create(fn.apply(new CreateRequest.Builder()).build()); - } - - // ----- Endpoint: delete - - /** - * Delete a document. Removes a JSON document from the specified index. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture delete(DeleteRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Delete a document. Removes a JSON document from the specified index. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeleteRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture delete( - Function> fn) { - return delete(fn.apply(new DeleteRequest.Builder()).build()); - } - - // ----- Endpoint: delete_by_query - - /** - * Delete documents. Deletes documents that match the specified query. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture deleteByQuery(DeleteByQueryRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteByQueryRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Delete documents. Deletes documents that match the specified query. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeleteByQueryRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture deleteByQuery( - Function> fn) { - return deleteByQuery(fn.apply(new DeleteByQueryRequest.Builder()).build()); - } - - // ----- Endpoint: delete_script - - /** - * Delete a script or search template. Deletes a stored script or search - * template. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture deleteScript(DeleteScriptRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteScriptRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Delete a script or search template. Deletes a stored script or search - * template. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeleteScriptRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture deleteScript( - Function> fn) { - return deleteScript(fn.apply(new DeleteScriptRequest.Builder()).build()); - } - - // ----- Endpoint: exists - - /** - * Check a document. Checks if a specified document exists. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture exists(ExistsRequest request) { - @SuppressWarnings("unchecked") - Endpoint endpoint = (Endpoint) ExistsRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Check a document. Checks if a specified document exists. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExistsRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture exists( - Function> fn) { - return exists(fn.apply(new ExistsRequest.Builder()).build()); - } - - // ----- Endpoint: exists_source - - /** - * Check for a document source. Checks if a document's _source is - * stored. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture existsSource(ExistsSourceRequest request) { - @SuppressWarnings("unchecked") - Endpoint endpoint = (Endpoint) ExistsSourceRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Check for a document source. Checks if a document's _source is - * stored. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExistsSourceRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture existsSource( - Function> fn) { - return existsSource(fn.apply(new ExistsSourceRequest.Builder()).build()); - } - - // ----- Endpoint: explain - - /** - * Explain a document match result. Returns information about why a specific - * document matches, or doesn’t match, a query. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> explain(ExplainRequest request, - Class tDocumentClass) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ExplainRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.explain.Response.TDocument", getDeserializer(tDocumentClass)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Explain a document match result. Returns information about why a specific - * document matches, or doesn’t match, a query. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExplainRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> explain( - Function> fn, Class tDocumentClass) { - return explain(fn.apply(new ExplainRequest.Builder()).build(), tDocumentClass); - } - - /** - * Explain a document match result. Returns information about why a specific - * document matches, or doesn’t match, a query. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> explain(ExplainRequest request, - Type tDocumentType) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ExplainRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.explain.Response.TDocument", getDeserializer(tDocumentType)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Explain a document match result. Returns information about why a specific - * document matches, or doesn’t match, a query. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExplainRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> explain( - Function> fn, Type tDocumentType) { - return explain(fn.apply(new ExplainRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: field_caps - - /** - * The field capabilities API returns the information about the capabilities of - * fields among multiple indices. The field capabilities API returns runtime - * fields like any other field. For example, a runtime field with a type of - * keyword is returned as any other field that belongs to the - * keyword family. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture fieldCaps(FieldCapsRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) FieldCapsRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * The field capabilities API returns the information about the capabilities of - * fields among multiple indices. The field capabilities API returns runtime - * fields like any other field. For example, a runtime field with a type of - * keyword is returned as any other field that belongs to the - * keyword family. - * - * @param fn - * a function that initializes a builder to create the - * {@link FieldCapsRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture fieldCaps( - Function> fn) { - return fieldCaps(fn.apply(new FieldCapsRequest.Builder()).build()); - } - - /** - * The field capabilities API returns the information about the capabilities of - * fields among multiple indices. The field capabilities API returns runtime - * fields like any other field. For example, a runtime field with a type of - * keyword is returned as any other field that belongs to the - * keyword family. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture fieldCaps() { - return this.transport.performRequestAsync(new FieldCapsRequest.Builder().build(), FieldCapsRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: get - - /** - * Get a document by its ID. Retrieves the document with the specified ID from - * an index. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> get(GetRequest request, - Class tDocumentClass) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.get.Response.TDocument", getDeserializer(tDocumentClass)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Get a document by its ID. Retrieves the document with the specified ID from - * an index. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> get( - Function> fn, Class tDocumentClass) { - return get(fn.apply(new GetRequest.Builder()).build(), tDocumentClass); - } - - /** - * Get a document by its ID. Retrieves the document with the specified ID from - * an index. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> get(GetRequest request, Type tDocumentType) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.get.Response.TDocument", getDeserializer(tDocumentType)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Get a document by its ID. Retrieves the document with the specified ID from - * an index. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> get( - Function> fn, Type tDocumentType) { - return get(fn.apply(new GetRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: get_script - - /** - * Get a script or search template. Retrieves a stored script or search - * template. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture getScript(GetScriptRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetScriptRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Get a script or search template. Retrieves a stored script or search - * template. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetScriptRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture getScript( - Function> fn) { - return getScript(fn.apply(new GetScriptRequest.Builder()).build()); - } - - // ----- Endpoint: get_source - - /** - * Get a document's source. Returns the source of a document. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> getSource(GetSourceRequest request, - Class tDocumentClass) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetSourceRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.get_source.Response.TDocument", - getDeserializer(tDocumentClass)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Get a document's source. Returns the source of a document. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetSourceRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> getSource( - Function> fn, Class tDocumentClass) { - return getSource(fn.apply(new GetSourceRequest.Builder()).build(), tDocumentClass); - } - - /** - * Get a document's source. Returns the source of a document. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> getSource(GetSourceRequest request, - Type tDocumentType) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetSourceRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.get_source.Response.TDocument", - getDeserializer(tDocumentType)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Get a document's source. Returns the source of a document. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetSourceRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> getSource( - Function> fn, Type tDocumentType) { - return getSource(fn.apply(new GetSourceRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: index - - /** - * Index a document. Adds a JSON document to the specified data stream or index - * and makes it searchable. If the target is an index and the document already - * exists, the request updates the document and increments its version. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture index(IndexRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint, IndexResponse, ErrorResponse> endpoint = (JsonEndpoint, IndexResponse, ErrorResponse>) IndexRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Index a document. Adds a JSON document to the specified data stream or index - * and makes it searchable. If the target is an index and the document already - * exists, the request updates the document and increments its version. - * - * @param fn - * a function that initializes a builder to create the - * {@link IndexRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture index( - Function, ObjectBuilder>> fn) { - return index(fn.apply(new IndexRequest.Builder()).build()); - } - - // ----- Endpoint: info - - /** - * Get cluster info. Returns basic information about the cluster. - * - * @see Documentation - * on elastic.co - */ - public CompletableFuture info() { - return this.transport.performRequestAsync(InfoRequest._INSTANCE, InfoRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: mget - - /** - * Allows to get multiple documents in one request. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> mget(MgetRequest request, - Class tDocumentClass) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MgetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.mget.Response.TDocument", getDeserializer(tDocumentClass)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Allows to get multiple documents in one request. - * - * @param fn - * a function that initializes a builder to create the - * {@link MgetRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> mget( - Function> fn, Class tDocumentClass) { - return mget(fn.apply(new MgetRequest.Builder()).build(), tDocumentClass); - } - - /** - * Allows to get multiple documents in one request. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> mget(MgetRequest request, Type tDocumentType) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MgetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.mget.Response.TDocument", getDeserializer(tDocumentType)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Allows to get multiple documents in one request. - * - * @param fn - * a function that initializes a builder to create the - * {@link MgetRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> mget( - Function> fn, Type tDocumentType) { - return mget(fn.apply(new MgetRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: msearch - - /** - * Allows to execute several search operations in one request. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> msearch(MsearchRequest request, - Class tDocumentClass) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.msearch.Response.TDocument", getDeserializer(tDocumentClass)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Allows to execute several search operations in one request. - * - * @param fn - * a function that initializes a builder to create the - * {@link MsearchRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> msearch( - Function> fn, Class tDocumentClass) { - return msearch(fn.apply(new MsearchRequest.Builder()).build(), tDocumentClass); - } - - /** - * Allows to execute several search operations in one request. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> msearch(MsearchRequest request, - Type tDocumentType) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.msearch.Response.TDocument", getDeserializer(tDocumentType)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Allows to execute several search operations in one request. - * - * @param fn - * a function that initializes a builder to create the - * {@link MsearchRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> msearch( - Function> fn, Type tDocumentType) { - return msearch(fn.apply(new MsearchRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: msearch_template - - /** - * Runs multiple templated searches with a single request. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> msearchTemplate( - MsearchTemplateRequest request, Class tDocumentClass) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchTemplateRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.msearch_template.Response.TDocument", - getDeserializer(tDocumentClass)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Runs multiple templated searches with a single request. - * - * @param fn - * a function that initializes a builder to create the - * {@link MsearchTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> msearchTemplate( - Function> fn, - Class tDocumentClass) { - return msearchTemplate(fn.apply(new MsearchTemplateRequest.Builder()).build(), tDocumentClass); - } - - /** - * Runs multiple templated searches with a single request. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> msearchTemplate( - MsearchTemplateRequest request, Type tDocumentType) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchTemplateRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.msearch_template.Response.TDocument", - getDeserializer(tDocumentType)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Runs multiple templated searches with a single request. - * - * @param fn - * a function that initializes a builder to create the - * {@link MsearchTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> msearchTemplate( - Function> fn, Type tDocumentType) { - return msearchTemplate(fn.apply(new MsearchTemplateRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: mtermvectors - - /** - * Returns multiple termvectors in one request. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture mtermvectors(MtermvectorsRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) MtermvectorsRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Returns multiple termvectors in one request. - * - * @param fn - * a function that initializes a builder to create the - * {@link MtermvectorsRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture mtermvectors( - Function> fn) { - return mtermvectors(fn.apply(new MtermvectorsRequest.Builder()).build()); - } - - /** - * Returns multiple termvectors in one request. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture mtermvectors() { - return this.transport.performRequestAsync(new MtermvectorsRequest.Builder().build(), - MtermvectorsRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: open_point_in_time - - /** - * A search request by default executes against the most recent visible data of - * the target indices, which is called point in time. Elasticsearch pit (point - * in time) is a lightweight view into the state of the data as it existed when - * initiated. In some cases, it’s preferred to perform multiple search requests - * using the same point in time. For example, if refreshes happen between - * search_after requests, then the results of those requests might - * not be consistent as changes happening between searches are only visible to - * the more recent point in time. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture openPointInTime(OpenPointInTimeRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) OpenPointInTimeRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * A search request by default executes against the most recent visible data of - * the target indices, which is called point in time. Elasticsearch pit (point - * in time) is a lightweight view into the state of the data as it existed when - * initiated. In some cases, it’s preferred to perform multiple search requests - * using the same point in time. For example, if refreshes happen between - * search_after requests, then the results of those requests might - * not be consistent as changes happening between searches are only visible to - * the more recent point in time. - * - * @param fn - * a function that initializes a builder to create the - * {@link OpenPointInTimeRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture openPointInTime( - Function> fn) { - return openPointInTime(fn.apply(new OpenPointInTimeRequest.Builder()).build()); - } - - // ----- Endpoint: ping - - /** - * Ping the cluster. Returns whether the cluster is running. - * - * @see Documentation - * on elastic.co - */ - public CompletableFuture ping() { - return this.transport.performRequestAsync(PingRequest._INSTANCE, PingRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: put_script - - /** - * Create or update a script or search template. Creates or updates a stored - * script or search template. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture putScript(PutScriptRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutScriptRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Create or update a script or search template. Creates or updates a stored - * script or search template. - * - * @param fn - * a function that initializes a builder to create the - * {@link PutScriptRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture putScript( - Function> fn) { - return putScript(fn.apply(new PutScriptRequest.Builder()).build()); - } - - // ----- Endpoint: rank_eval - - /** - * Enables you to evaluate the quality of ranked search results over a set of - * typical search queries. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture rankEval(RankEvalRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) RankEvalRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Enables you to evaluate the quality of ranked search results over a set of - * typical search queries. - * - * @param fn - * a function that initializes a builder to create the - * {@link RankEvalRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture rankEval( - Function> fn) { - return rankEval(fn.apply(new RankEvalRequest.Builder()).build()); - } - - // ----- Endpoint: reindex - - /** - * Reindex documents. Copies documents from a source to a destination. The - * source can be any existing index, alias, or data stream. The destination must - * differ from the source. For example, you cannot reindex a data stream into - * itself. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture reindex(ReindexRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ReindexRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Reindex documents. Copies documents from a source to a destination. The - * source can be any existing index, alias, or data stream. The destination must - * differ from the source. For example, you cannot reindex a data stream into - * itself. - * - * @param fn - * a function that initializes a builder to create the - * {@link ReindexRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture reindex( - Function> fn) { - return reindex(fn.apply(new ReindexRequest.Builder()).build()); - } - - // ----- Endpoint: render_search_template - - /** - * Renders a search template as a search request body. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture renderSearchTemplate(RenderSearchTemplateRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) RenderSearchTemplateRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Renders a search template as a search request body. - * - * @param fn - * a function that initializes a builder to create the - * {@link RenderSearchTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture renderSearchTemplate( - Function> fn) { - return renderSearchTemplate(fn.apply(new RenderSearchTemplateRequest.Builder()).build()); - } - - /** - * Renders a search template as a search request body. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture renderSearchTemplate() { - return this.transport.performRequestAsync(new RenderSearchTemplateRequest.Builder().build(), - RenderSearchTemplateRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: scripts_painless_execute - - /** - * Run a script. Runs a script and returns a result. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> scriptsPainlessExecute( - ScriptsPainlessExecuteRequest request, Class tResultClass) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScriptsPainlessExecuteRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.scripts_painless_execute.Response.TResult", - getDeserializer(tResultClass)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Run a script. Runs a script and returns a result. - * - * @param fn - * a function that initializes a builder to create the - * {@link ScriptsPainlessExecuteRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> scriptsPainlessExecute( - Function> fn, - Class tResultClass) { - return scriptsPainlessExecute(fn.apply(new ScriptsPainlessExecuteRequest.Builder()).build(), tResultClass); - } - - /** - * Run a script. Runs a script and returns a result. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> scriptsPainlessExecute( - ScriptsPainlessExecuteRequest request, Type tResultType) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScriptsPainlessExecuteRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.scripts_painless_execute.Response.TResult", - getDeserializer(tResultType)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Run a script. Runs a script and returns a result. - * - * @param fn - * a function that initializes a builder to create the - * {@link ScriptsPainlessExecuteRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> scriptsPainlessExecute( - Function> fn, - Type tResultType) { - return scriptsPainlessExecute(fn.apply(new ScriptsPainlessExecuteRequest.Builder()).build(), tResultType); - } - - // ----- Endpoint: scroll - - /** - * Allows to retrieve a large numbers of results from a single search request. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> scroll(ScrollRequest request, - Class tDocumentClass) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScrollRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.scroll.Response.TDocument", getDeserializer(tDocumentClass)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Allows to retrieve a large numbers of results from a single search request. - * - * @param fn - * a function that initializes a builder to create the - * {@link ScrollRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> scroll( - Function> fn, Class tDocumentClass) { - return scroll(fn.apply(new ScrollRequest.Builder()).build(), tDocumentClass); - } - - /** - * Allows to retrieve a large numbers of results from a single search request. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> scroll(ScrollRequest request, Type tDocumentType) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScrollRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.scroll.Response.TDocument", getDeserializer(tDocumentType)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Allows to retrieve a large numbers of results from a single search request. - * - * @param fn - * a function that initializes a builder to create the - * {@link ScrollRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> scroll( - Function> fn, Type tDocumentType) { - return scroll(fn.apply(new ScrollRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: search - - /** - * Returns search hits that match the query defined in the request. You can - * provide search queries using the q query string parameter or the - * request body. If both are specified, only the query parameter is used. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> search(SearchRequest request, - Class tDocumentClass) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.search.Response.TDocument", getDeserializer(tDocumentClass)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Returns search hits that match the query defined in the request. You can - * provide search queries using the q query string parameter or the - * request body. If both are specified, only the query parameter is used. - * - * @param fn - * a function that initializes a builder to create the - * {@link SearchRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> search( - Function> fn, Class tDocumentClass) { - return search(fn.apply(new SearchRequest.Builder()).build(), tDocumentClass); - } - - /** - * Returns search hits that match the query defined in the request. You can - * provide search queries using the q query string parameter or the - * request body. If both are specified, only the query parameter is used. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> search(SearchRequest request, Type tDocumentType) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.search.Response.TDocument", getDeserializer(tDocumentType)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Returns search hits that match the query defined in the request. You can - * provide search queries using the q query string parameter or the - * request body. If both are specified, only the query parameter is used. - * - * @param fn - * a function that initializes a builder to create the - * {@link SearchRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> search( - Function> fn, Type tDocumentType) { - return search(fn.apply(new SearchRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: search_mvt - - /** - * Search a vector tile. Searches a vector tile for geospatial values. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture searchMvt(SearchMvtRequest request) { - @SuppressWarnings("unchecked") - Endpoint endpoint = (Endpoint) SearchMvtRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Search a vector tile. Searches a vector tile for geospatial values. - * - * @param fn - * a function that initializes a builder to create the - * {@link SearchMvtRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture searchMvt( - Function> fn) { - return searchMvt(fn.apply(new SearchMvtRequest.Builder()).build()); - } - - // ----- Endpoint: search_template - - /** - * Runs a search with a search template. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> searchTemplate( - SearchTemplateRequest request, Class tDocumentClass) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchTemplateRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.search_template.Response.TDocument", - getDeserializer(tDocumentClass)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Runs a search with a search template. - * - * @param fn - * a function that initializes a builder to create the - * {@link SearchTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> searchTemplate( - Function> fn, - Class tDocumentClass) { - return searchTemplate(fn.apply(new SearchTemplateRequest.Builder()).build(), tDocumentClass); - } - - /** - * Runs a search with a search template. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> searchTemplate( - SearchTemplateRequest request, Type tDocumentType) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchTemplateRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.search_template.Response.TDocument", - getDeserializer(tDocumentType)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Runs a search with a search template. - * - * @param fn - * a function that initializes a builder to create the - * {@link SearchTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> searchTemplate( - Function> fn, Type tDocumentType) { - return searchTemplate(fn.apply(new SearchTemplateRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: terms_enum - - /** - * The terms enum API can be used to discover terms in the index that begin with - * the provided string. It is designed for low-latency look-ups used in - * auto-complete scenarios. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture termsEnum(TermsEnumRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) TermsEnumRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * The terms enum API can be used to discover terms in the index that begin with - * the provided string. It is designed for low-latency look-ups used in - * auto-complete scenarios. - * - * @param fn - * a function that initializes a builder to create the - * {@link TermsEnumRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture termsEnum( - Function> fn) { - return termsEnum(fn.apply(new TermsEnumRequest.Builder()).build()); - } - - // ----- Endpoint: termvectors - - /** - * Get term vector information. Returns information and statistics about terms - * in the fields of a particular document. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture termvectors(TermvectorsRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint, TermvectorsResponse, ErrorResponse> endpoint = (JsonEndpoint, TermvectorsResponse, ErrorResponse>) TermvectorsRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Get term vector information. Returns information and statistics about terms - * in the fields of a particular document. - * - * @param fn - * a function that initializes a builder to create the - * {@link TermvectorsRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture termvectors( - Function, ObjectBuilder>> fn) { - return termvectors(fn.apply(new TermvectorsRequest.Builder()).build()); - } - - // ----- Endpoint: update - - /** - * Update a document. Updates a document by running a script or passing a - * partial document. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> update( - UpdateRequest request, Class tDocumentClass) { - @SuppressWarnings("unchecked") - JsonEndpoint, UpdateResponse, ErrorResponse> endpoint = (JsonEndpoint, UpdateResponse, ErrorResponse>) UpdateRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.update.Response.TDocument", getDeserializer(tDocumentClass)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Update a document. Updates a document by running a script or passing a - * partial document. - * - * @param fn - * a function that initializes a builder to create the - * {@link UpdateRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> update( - Function, ObjectBuilder>> fn, - Class tDocumentClass) { - return update(fn.apply(new UpdateRequest.Builder()).build(), tDocumentClass); - } - - /** - * Update a document. Updates a document by running a script or passing a - * partial document. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> update( - UpdateRequest request, Type tDocumentType) { - @SuppressWarnings("unchecked") - JsonEndpoint, UpdateResponse, ErrorResponse> endpoint = (JsonEndpoint, UpdateResponse, ErrorResponse>) UpdateRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.update.Response.TDocument", getDeserializer(tDocumentType)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Update a document. Updates a document by running a script or passing a - * partial document. - * - * @param fn - * a function that initializes a builder to create the - * {@link UpdateRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> update( - Function, ObjectBuilder>> fn, - Type tDocumentType) { - return update(fn.apply(new UpdateRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: update_by_query - - /** - * Update documents. Updates documents that match the specified query. If no - * query is specified, performs an update on every document in the data stream - * or index without modifying the source, which is useful for picking up mapping - * changes. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture updateByQuery(UpdateByQueryRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) UpdateByQueryRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Update documents. Updates documents that match the specified query. If no - * query is specified, performs an update on every document in the data stream - * or index without modifying the source, which is useful for picking up mapping - * changes. - * - * @param fn - * a function that initializes a builder to create the - * {@link UpdateByQueryRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture updateByQuery( - Function> fn) { - return updateByQuery(fn.apply(new UpdateByQueryRequest.Builder()).build()); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java deleted file mode 100644 index 63ece3e8c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java +++ /dev/null @@ -1,2016 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch; - -import co.elastic.clients.ApiClient; -import co.elastic.clients.elasticsearch._types.ElasticsearchException; -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch.async_search.ElasticsearchAsyncSearchClient; -import co.elastic.clients.elasticsearch.cat.ElasticsearchCatClient; -import co.elastic.clients.elasticsearch.cluster.ElasticsearchClusterClient; -import co.elastic.clients.elasticsearch.connector.ElasticsearchConnectorClient; -import co.elastic.clients.elasticsearch.core.BulkRequest; -import co.elastic.clients.elasticsearch.core.BulkResponse; -import co.elastic.clients.elasticsearch.core.ClearScrollRequest; -import co.elastic.clients.elasticsearch.core.ClearScrollResponse; -import co.elastic.clients.elasticsearch.core.ClosePointInTimeRequest; -import co.elastic.clients.elasticsearch.core.ClosePointInTimeResponse; -import co.elastic.clients.elasticsearch.core.CountRequest; -import co.elastic.clients.elasticsearch.core.CountResponse; -import co.elastic.clients.elasticsearch.core.CreateRequest; -import co.elastic.clients.elasticsearch.core.CreateResponse; -import co.elastic.clients.elasticsearch.core.DeleteByQueryRequest; -import co.elastic.clients.elasticsearch.core.DeleteByQueryResponse; -import co.elastic.clients.elasticsearch.core.DeleteRequest; -import co.elastic.clients.elasticsearch.core.DeleteResponse; -import co.elastic.clients.elasticsearch.core.DeleteScriptRequest; -import co.elastic.clients.elasticsearch.core.DeleteScriptResponse; -import co.elastic.clients.elasticsearch.core.ExistsRequest; -import co.elastic.clients.elasticsearch.core.ExistsSourceRequest; -import co.elastic.clients.elasticsearch.core.ExplainRequest; -import co.elastic.clients.elasticsearch.core.ExplainResponse; -import co.elastic.clients.elasticsearch.core.FieldCapsRequest; -import co.elastic.clients.elasticsearch.core.FieldCapsResponse; -import co.elastic.clients.elasticsearch.core.GetRequest; -import co.elastic.clients.elasticsearch.core.GetResponse; -import co.elastic.clients.elasticsearch.core.GetScriptRequest; -import co.elastic.clients.elasticsearch.core.GetScriptResponse; -import co.elastic.clients.elasticsearch.core.GetSourceRequest; -import co.elastic.clients.elasticsearch.core.GetSourceResponse; -import co.elastic.clients.elasticsearch.core.IndexRequest; -import co.elastic.clients.elasticsearch.core.IndexResponse; -import co.elastic.clients.elasticsearch.core.InfoRequest; -import co.elastic.clients.elasticsearch.core.InfoResponse; -import co.elastic.clients.elasticsearch.core.MgetRequest; -import co.elastic.clients.elasticsearch.core.MgetResponse; -import co.elastic.clients.elasticsearch.core.MsearchRequest; -import co.elastic.clients.elasticsearch.core.MsearchResponse; -import co.elastic.clients.elasticsearch.core.MsearchTemplateRequest; -import co.elastic.clients.elasticsearch.core.MsearchTemplateResponse; -import co.elastic.clients.elasticsearch.core.MtermvectorsRequest; -import co.elastic.clients.elasticsearch.core.MtermvectorsResponse; -import co.elastic.clients.elasticsearch.core.OpenPointInTimeRequest; -import co.elastic.clients.elasticsearch.core.OpenPointInTimeResponse; -import co.elastic.clients.elasticsearch.core.PingRequest; -import co.elastic.clients.elasticsearch.core.PutScriptRequest; -import co.elastic.clients.elasticsearch.core.PutScriptResponse; -import co.elastic.clients.elasticsearch.core.RankEvalRequest; -import co.elastic.clients.elasticsearch.core.RankEvalResponse; -import co.elastic.clients.elasticsearch.core.ReindexRequest; -import co.elastic.clients.elasticsearch.core.ReindexResponse; -import co.elastic.clients.elasticsearch.core.RenderSearchTemplateRequest; -import co.elastic.clients.elasticsearch.core.RenderSearchTemplateResponse; -import co.elastic.clients.elasticsearch.core.ScriptsPainlessExecuteRequest; -import co.elastic.clients.elasticsearch.core.ScriptsPainlessExecuteResponse; -import co.elastic.clients.elasticsearch.core.ScrollRequest; -import co.elastic.clients.elasticsearch.core.ScrollResponse; -import co.elastic.clients.elasticsearch.core.SearchMvtRequest; -import co.elastic.clients.elasticsearch.core.SearchRequest; -import co.elastic.clients.elasticsearch.core.SearchResponse; -import co.elastic.clients.elasticsearch.core.SearchTemplateRequest; -import co.elastic.clients.elasticsearch.core.SearchTemplateResponse; -import co.elastic.clients.elasticsearch.core.TermsEnumRequest; -import co.elastic.clients.elasticsearch.core.TermsEnumResponse; -import co.elastic.clients.elasticsearch.core.TermvectorsRequest; -import co.elastic.clients.elasticsearch.core.TermvectorsResponse; -import co.elastic.clients.elasticsearch.core.UpdateByQueryRequest; -import co.elastic.clients.elasticsearch.core.UpdateByQueryResponse; -import co.elastic.clients.elasticsearch.core.UpdateRequest; -import co.elastic.clients.elasticsearch.core.UpdateResponse; -import co.elastic.clients.elasticsearch.enrich.ElasticsearchEnrichClient; -import co.elastic.clients.elasticsearch.eql.ElasticsearchEqlClient; -import co.elastic.clients.elasticsearch.esql.ElasticsearchEsqlClient; -import co.elastic.clients.elasticsearch.graph.ElasticsearchGraphClient; -import co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient; -import co.elastic.clients.elasticsearch.inference.ElasticsearchInferenceClient; -import co.elastic.clients.elasticsearch.ingest.ElasticsearchIngestClient; -import co.elastic.clients.elasticsearch.license.ElasticsearchLicenseClient; -import co.elastic.clients.elasticsearch.logstash.ElasticsearchLogstashClient; -import co.elastic.clients.elasticsearch.ml.ElasticsearchMlClient; -import co.elastic.clients.elasticsearch.query_rules.ElasticsearchQueryRulesClient; -import co.elastic.clients.elasticsearch.search_application.ElasticsearchSearchApplicationClient; -import co.elastic.clients.elasticsearch.security.ElasticsearchSecurityClient; -import co.elastic.clients.elasticsearch.sql.ElasticsearchSqlClient; -import co.elastic.clients.elasticsearch.synonyms.ElasticsearchSynonymsClient; -import co.elastic.clients.elasticsearch.tasks.ElasticsearchTasksClient; -import co.elastic.clients.elasticsearch.transform.ElasticsearchTransformClient; -import co.elastic.clients.transport.ElasticsearchTransport; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.JsonEndpoint; -import co.elastic.clients.transport.Transport; -import co.elastic.clients.transport.TransportOptions; -import co.elastic.clients.transport.endpoints.BinaryResponse; -import co.elastic.clients.transport.endpoints.BooleanResponse; -import co.elastic.clients.transport.endpoints.EndpointWithResponseMapperAttr; -import co.elastic.clients.util.ObjectBuilder; -import java.io.IOException; -import java.lang.reflect.Type; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Client for the namespace. - */ -public class ElasticsearchClient extends ApiClient { - - public ElasticsearchClient(ElasticsearchTransport transport) { - super(transport, null); - } - - public ElasticsearchClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { - super(transport, transportOptions); - } - - @Override - public ElasticsearchClient withTransportOptions(@Nullable TransportOptions transportOptions) { - return new ElasticsearchClient(this.transport, transportOptions); - } - - // ----- Child clients - - public ElasticsearchAsyncSearchClient asyncSearch() { - return new ElasticsearchAsyncSearchClient(this.transport, this.transportOptions); - } - - public ElasticsearchCatClient cat() { - return new ElasticsearchCatClient(this.transport, this.transportOptions); - } - - public ElasticsearchClusterClient cluster() { - return new ElasticsearchClusterClient(this.transport, this.transportOptions); - } - - public ElasticsearchConnectorClient connector() { - return new ElasticsearchConnectorClient(this.transport, this.transportOptions); - } - - public ElasticsearchEnrichClient enrich() { - return new ElasticsearchEnrichClient(this.transport, this.transportOptions); - } - - public ElasticsearchEqlClient eql() { - return new ElasticsearchEqlClient(this.transport, this.transportOptions); - } - - public ElasticsearchEsqlClient esql() { - return new ElasticsearchEsqlClient(this.transport, this.transportOptions); - } - - public ElasticsearchGraphClient graph() { - return new ElasticsearchGraphClient(this.transport, this.transportOptions); - } - - public ElasticsearchIndicesClient indices() { - return new ElasticsearchIndicesClient(this.transport, this.transportOptions); - } - - public ElasticsearchInferenceClient inference() { - return new ElasticsearchInferenceClient(this.transport, this.transportOptions); - } - - public ElasticsearchIngestClient ingest() { - return new ElasticsearchIngestClient(this.transport, this.transportOptions); - } - - public ElasticsearchLicenseClient license() { - return new ElasticsearchLicenseClient(this.transport, this.transportOptions); - } - - public ElasticsearchLogstashClient logstash() { - return new ElasticsearchLogstashClient(this.transport, this.transportOptions); - } - - public ElasticsearchMlClient ml() { - return new ElasticsearchMlClient(this.transport, this.transportOptions); - } - - public ElasticsearchQueryRulesClient queryRules() { - return new ElasticsearchQueryRulesClient(this.transport, this.transportOptions); - } - - public ElasticsearchSearchApplicationClient searchApplication() { - return new ElasticsearchSearchApplicationClient(this.transport, this.transportOptions); - } - - public ElasticsearchSecurityClient security() { - return new ElasticsearchSecurityClient(this.transport, this.transportOptions); - } - - public ElasticsearchSqlClient sql() { - return new ElasticsearchSqlClient(this.transport, this.transportOptions); - } - - public ElasticsearchSynonymsClient synonyms() { - return new ElasticsearchSynonymsClient(this.transport, this.transportOptions); - } - - public ElasticsearchTasksClient tasks() { - return new ElasticsearchTasksClient(this.transport, this.transportOptions); - } - - public ElasticsearchTransformClient transform() { - return new ElasticsearchTransformClient(this.transport, this.transportOptions); - } - - // ----- Endpoint: bulk - - /** - * Bulk index or delete documents. Performs multiple indexing or delete - * operations in a single API call. This reduces overhead and can greatly - * increase indexing speed. - * - * @see Documentation - * on elastic.co - */ - - public BulkResponse bulk(BulkRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) BulkRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Bulk index or delete documents. Performs multiple indexing or delete - * operations in a single API call. This reduces overhead and can greatly - * increase indexing speed. - * - * @param fn - * a function that initializes a builder to create the - * {@link BulkRequest} - * @see Documentation - * on elastic.co - */ - - public final BulkResponse bulk(Function> fn) - throws IOException, ElasticsearchException { - return bulk(fn.apply(new BulkRequest.Builder()).build()); - } - - /** - * Bulk index or delete documents. Performs multiple indexing or delete - * operations in a single API call. This reduces overhead and can greatly - * increase indexing speed. - * - * @see Documentation - * on elastic.co - */ - - public BulkResponse bulk() throws IOException, ElasticsearchException { - return this.transport.performRequest(new BulkRequest.Builder().build(), BulkRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: clear_scroll - - /** - * Clears the search context and results for a scrolling search. - * - * @see Documentation - * on elastic.co - */ - - public ClearScrollResponse clearScroll(ClearScrollRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ClearScrollRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Clears the search context and results for a scrolling search. - * - * @param fn - * a function that initializes a builder to create the - * {@link ClearScrollRequest} - * @see Documentation - * on elastic.co - */ - - public final ClearScrollResponse clearScroll( - Function> fn) - throws IOException, ElasticsearchException { - return clearScroll(fn.apply(new ClearScrollRequest.Builder()).build()); - } - - /** - * Clears the search context and results for a scrolling search. - * - * @see Documentation - * on elastic.co - */ - - public ClearScrollResponse clearScroll() throws IOException, ElasticsearchException { - return this.transport.performRequest(new ClearScrollRequest.Builder().build(), ClearScrollRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: close_point_in_time - - /** - * Closes a point-in-time. - * - * @see Documentation - * on elastic.co - */ - - public ClosePointInTimeResponse closePointInTime(ClosePointInTimeRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ClosePointInTimeRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Closes a point-in-time. - * - * @param fn - * a function that initializes a builder to create the - * {@link ClosePointInTimeRequest} - * @see Documentation - * on elastic.co - */ - - public final ClosePointInTimeResponse closePointInTime( - Function> fn) - throws IOException, ElasticsearchException { - return closePointInTime(fn.apply(new ClosePointInTimeRequest.Builder()).build()); - } - - // ----- Endpoint: count - - /** - * Returns number of documents matching a query. - * - * @see Documentation - * on elastic.co - */ - - public CountResponse count(CountRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) CountRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Returns number of documents matching a query. - * - * @param fn - * a function that initializes a builder to create the - * {@link CountRequest} - * @see Documentation - * on elastic.co - */ - - public final CountResponse count(Function> fn) - throws IOException, ElasticsearchException { - return count(fn.apply(new CountRequest.Builder()).build()); - } - - /** - * Returns number of documents matching a query. - * - * @see Documentation - * on elastic.co - */ - - public CountResponse count() throws IOException, ElasticsearchException { - return this.transport.performRequest(new CountRequest.Builder().build(), CountRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: create - - /** - * Index a document. Adds a JSON document to the specified data stream or index - * and makes it searchable. If the target is an index and the document already - * exists, the request updates the document and increments its version. - * - * @see Documentation - * on elastic.co - */ - - public CreateResponse create(CreateRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, CreateResponse, ErrorResponse> endpoint = (JsonEndpoint, CreateResponse, ErrorResponse>) CreateRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Index a document. Adds a JSON document to the specified data stream or index - * and makes it searchable. If the target is an index and the document already - * exists, the request updates the document and increments its version. - * - * @param fn - * a function that initializes a builder to create the - * {@link CreateRequest} - * @see Documentation - * on elastic.co - */ - - public final CreateResponse create( - Function, ObjectBuilder>> fn) - throws IOException, ElasticsearchException { - return create(fn.apply(new CreateRequest.Builder()).build()); - } - - // ----- Endpoint: delete - - /** - * Delete a document. Removes a JSON document from the specified index. - * - * @see Documentation - * on elastic.co - */ - - public DeleteResponse delete(DeleteRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Delete a document. Removes a JSON document from the specified index. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeleteRequest} - * @see Documentation - * on elastic.co - */ - - public final DeleteResponse delete(Function> fn) - throws IOException, ElasticsearchException { - return delete(fn.apply(new DeleteRequest.Builder()).build()); - } - - // ----- Endpoint: delete_by_query - - /** - * Delete documents. Deletes documents that match the specified query. - * - * @see Documentation - * on elastic.co - */ - - public DeleteByQueryResponse deleteByQuery(DeleteByQueryRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteByQueryRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Delete documents. Deletes documents that match the specified query. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeleteByQueryRequest} - * @see Documentation - * on elastic.co - */ - - public final DeleteByQueryResponse deleteByQuery( - Function> fn) - throws IOException, ElasticsearchException { - return deleteByQuery(fn.apply(new DeleteByQueryRequest.Builder()).build()); - } - - // ----- Endpoint: delete_script - - /** - * Delete a script or search template. Deletes a stored script or search - * template. - * - * @see Documentation - * on elastic.co - */ - - public DeleteScriptResponse deleteScript(DeleteScriptRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteScriptRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Delete a script or search template. Deletes a stored script or search - * template. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeleteScriptRequest} - * @see Documentation - * on elastic.co - */ - - public final DeleteScriptResponse deleteScript( - Function> fn) - throws IOException, ElasticsearchException { - return deleteScript(fn.apply(new DeleteScriptRequest.Builder()).build()); - } - - // ----- Endpoint: exists - - /** - * Check a document. Checks if a specified document exists. - * - * @see Documentation - * on elastic.co - */ - - public BooleanResponse exists(ExistsRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - Endpoint endpoint = (Endpoint) ExistsRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Check a document. Checks if a specified document exists. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExistsRequest} - * @see Documentation - * on elastic.co - */ - - public final BooleanResponse exists(Function> fn) - throws IOException, ElasticsearchException { - return exists(fn.apply(new ExistsRequest.Builder()).build()); - } - - // ----- Endpoint: exists_source - - /** - * Check for a document source. Checks if a document's _source is - * stored. - * - * @see Documentation - * on elastic.co - */ - - public BooleanResponse existsSource(ExistsSourceRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - Endpoint endpoint = (Endpoint) ExistsSourceRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Check for a document source. Checks if a document's _source is - * stored. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExistsSourceRequest} - * @see Documentation - * on elastic.co - */ - - public final BooleanResponse existsSource( - Function> fn) - throws IOException, ElasticsearchException { - return existsSource(fn.apply(new ExistsSourceRequest.Builder()).build()); - } - - // ----- Endpoint: explain - - /** - * Explain a document match result. Returns information about why a specific - * document matches, or doesn’t match, a query. - * - * @see Documentation - * on elastic.co - */ - - public ExplainResponse explain(ExplainRequest request, Class tDocumentClass) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ExplainRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.explain.Response.TDocument", getDeserializer(tDocumentClass)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Explain a document match result. Returns information about why a specific - * document matches, or doesn’t match, a query. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExplainRequest} - * @see Documentation - * on elastic.co - */ - - public final ExplainResponse explain( - Function> fn, Class tDocumentClass) - throws IOException, ElasticsearchException { - return explain(fn.apply(new ExplainRequest.Builder()).build(), tDocumentClass); - } - - /** - * Explain a document match result. Returns information about why a specific - * document matches, or doesn’t match, a query. - * - * @see Documentation - * on elastic.co - */ - - public ExplainResponse explain(ExplainRequest request, Type tDocumentType) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ExplainRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.explain.Response.TDocument", getDeserializer(tDocumentType)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Explain a document match result. Returns information about why a specific - * document matches, or doesn’t match, a query. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExplainRequest} - * @see Documentation - * on elastic.co - */ - - public final ExplainResponse explain( - Function> fn, Type tDocumentType) - throws IOException, ElasticsearchException { - return explain(fn.apply(new ExplainRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: field_caps - - /** - * The field capabilities API returns the information about the capabilities of - * fields among multiple indices. The field capabilities API returns runtime - * fields like any other field. For example, a runtime field with a type of - * keyword is returned as any other field that belongs to the - * keyword family. - * - * @see Documentation - * on elastic.co - */ - - public FieldCapsResponse fieldCaps(FieldCapsRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) FieldCapsRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * The field capabilities API returns the information about the capabilities of - * fields among multiple indices. The field capabilities API returns runtime - * fields like any other field. For example, a runtime field with a type of - * keyword is returned as any other field that belongs to the - * keyword family. - * - * @param fn - * a function that initializes a builder to create the - * {@link FieldCapsRequest} - * @see Documentation - * on elastic.co - */ - - public final FieldCapsResponse fieldCaps(Function> fn) - throws IOException, ElasticsearchException { - return fieldCaps(fn.apply(new FieldCapsRequest.Builder()).build()); - } - - /** - * The field capabilities API returns the information about the capabilities of - * fields among multiple indices. The field capabilities API returns runtime - * fields like any other field. For example, a runtime field with a type of - * keyword is returned as any other field that belongs to the - * keyword family. - * - * @see Documentation - * on elastic.co - */ - - public FieldCapsResponse fieldCaps() throws IOException, ElasticsearchException { - return this.transport.performRequest(new FieldCapsRequest.Builder().build(), FieldCapsRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: get - - /** - * Get a document by its ID. Retrieves the document with the specified ID from - * an index. - * - * @see Documentation - * on elastic.co - */ - - public GetResponse get(GetRequest request, Class tDocumentClass) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.get.Response.TDocument", getDeserializer(tDocumentClass)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Get a document by its ID. Retrieves the document with the specified ID from - * an index. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetRequest} - * @see Documentation - * on elastic.co - */ - - public final GetResponse get(Function> fn, - Class tDocumentClass) throws IOException, ElasticsearchException { - return get(fn.apply(new GetRequest.Builder()).build(), tDocumentClass); - } - - /** - * Get a document by its ID. Retrieves the document with the specified ID from - * an index. - * - * @see Documentation - * on elastic.co - */ - - public GetResponse get(GetRequest request, Type tDocumentType) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.get.Response.TDocument", getDeserializer(tDocumentType)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Get a document by its ID. Retrieves the document with the specified ID from - * an index. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetRequest} - * @see Documentation - * on elastic.co - */ - - public final GetResponse get(Function> fn, - Type tDocumentType) throws IOException, ElasticsearchException { - return get(fn.apply(new GetRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: get_script - - /** - * Get a script or search template. Retrieves a stored script or search - * template. - * - * @see Documentation - * on elastic.co - */ - - public GetScriptResponse getScript(GetScriptRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetScriptRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Get a script or search template. Retrieves a stored script or search - * template. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetScriptRequest} - * @see Documentation - * on elastic.co - */ - - public final GetScriptResponse getScript(Function> fn) - throws IOException, ElasticsearchException { - return getScript(fn.apply(new GetScriptRequest.Builder()).build()); - } - - // ----- Endpoint: get_source - - /** - * Get a document's source. Returns the source of a document. - * - * @see Documentation - * on elastic.co - */ - - public GetSourceResponse getSource(GetSourceRequest request, Class tDocumentClass) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetSourceRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.get_source.Response.TDocument", - getDeserializer(tDocumentClass)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Get a document's source. Returns the source of a document. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetSourceRequest} - * @see Documentation - * on elastic.co - */ - - public final GetSourceResponse getSource( - Function> fn, Class tDocumentClass) - throws IOException, ElasticsearchException { - return getSource(fn.apply(new GetSourceRequest.Builder()).build(), tDocumentClass); - } - - /** - * Get a document's source. Returns the source of a document. - * - * @see Documentation - * on elastic.co - */ - - public GetSourceResponse getSource(GetSourceRequest request, Type tDocumentType) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetSourceRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.get_source.Response.TDocument", - getDeserializer(tDocumentType)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Get a document's source. Returns the source of a document. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetSourceRequest} - * @see Documentation - * on elastic.co - */ - - public final GetSourceResponse getSource( - Function> fn, Type tDocumentType) - throws IOException, ElasticsearchException { - return getSource(fn.apply(new GetSourceRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: index - - /** - * Index a document. Adds a JSON document to the specified data stream or index - * and makes it searchable. If the target is an index and the document already - * exists, the request updates the document and increments its version. - * - * @see Documentation - * on elastic.co - */ - - public IndexResponse index(IndexRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, IndexResponse, ErrorResponse> endpoint = (JsonEndpoint, IndexResponse, ErrorResponse>) IndexRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Index a document. Adds a JSON document to the specified data stream or index - * and makes it searchable. If the target is an index and the document already - * exists, the request updates the document and increments its version. - * - * @param fn - * a function that initializes a builder to create the - * {@link IndexRequest} - * @see Documentation - * on elastic.co - */ - - public final IndexResponse index( - Function, ObjectBuilder>> fn) - throws IOException, ElasticsearchException { - return index(fn.apply(new IndexRequest.Builder()).build()); - } - - // ----- Endpoint: info - - /** - * Get cluster info. Returns basic information about the cluster. - * - * @see Documentation - * on elastic.co - */ - public InfoResponse info() throws IOException, ElasticsearchException { - return this.transport.performRequest(InfoRequest._INSTANCE, InfoRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: mget - - /** - * Allows to get multiple documents in one request. - * - * @see Documentation - * on elastic.co - */ - - public MgetResponse mget(MgetRequest request, Class tDocumentClass) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MgetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.mget.Response.TDocument", getDeserializer(tDocumentClass)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Allows to get multiple documents in one request. - * - * @param fn - * a function that initializes a builder to create the - * {@link MgetRequest} - * @see Documentation - * on elastic.co - */ - - public final MgetResponse mget(Function> fn, - Class tDocumentClass) throws IOException, ElasticsearchException { - return mget(fn.apply(new MgetRequest.Builder()).build(), tDocumentClass); - } - - /** - * Allows to get multiple documents in one request. - * - * @see Documentation - * on elastic.co - */ - - public MgetResponse mget(MgetRequest request, Type tDocumentType) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MgetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.mget.Response.TDocument", getDeserializer(tDocumentType)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Allows to get multiple documents in one request. - * - * @param fn - * a function that initializes a builder to create the - * {@link MgetRequest} - * @see Documentation - * on elastic.co - */ - - public final MgetResponse mget(Function> fn, - Type tDocumentType) throws IOException, ElasticsearchException { - return mget(fn.apply(new MgetRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: msearch - - /** - * Allows to execute several search operations in one request. - * - * @see Documentation - * on elastic.co - */ - - public MsearchResponse msearch(MsearchRequest request, Class tDocumentClass) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.msearch.Response.TDocument", getDeserializer(tDocumentClass)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Allows to execute several search operations in one request. - * - * @param fn - * a function that initializes a builder to create the - * {@link MsearchRequest} - * @see Documentation - * on elastic.co - */ - - public final MsearchResponse msearch( - Function> fn, Class tDocumentClass) - throws IOException, ElasticsearchException { - return msearch(fn.apply(new MsearchRequest.Builder()).build(), tDocumentClass); - } - - /** - * Allows to execute several search operations in one request. - * - * @see Documentation - * on elastic.co - */ - - public MsearchResponse msearch(MsearchRequest request, Type tDocumentType) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.msearch.Response.TDocument", getDeserializer(tDocumentType)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Allows to execute several search operations in one request. - * - * @param fn - * a function that initializes a builder to create the - * {@link MsearchRequest} - * @see Documentation - * on elastic.co - */ - - public final MsearchResponse msearch( - Function> fn, Type tDocumentType) - throws IOException, ElasticsearchException { - return msearch(fn.apply(new MsearchRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: msearch_template - - /** - * Runs multiple templated searches with a single request. - * - * @see Documentation - * on elastic.co - */ - - public MsearchTemplateResponse msearchTemplate(MsearchTemplateRequest request, - Class tDocumentClass) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchTemplateRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.msearch_template.Response.TDocument", - getDeserializer(tDocumentClass)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Runs multiple templated searches with a single request. - * - * @param fn - * a function that initializes a builder to create the - * {@link MsearchTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final MsearchTemplateResponse msearchTemplate( - Function> fn, - Class tDocumentClass) throws IOException, ElasticsearchException { - return msearchTemplate(fn.apply(new MsearchTemplateRequest.Builder()).build(), tDocumentClass); - } - - /** - * Runs multiple templated searches with a single request. - * - * @see Documentation - * on elastic.co - */ - - public MsearchTemplateResponse msearchTemplate(MsearchTemplateRequest request, - Type tDocumentType) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchTemplateRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.msearch_template.Response.TDocument", - getDeserializer(tDocumentType)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Runs multiple templated searches with a single request. - * - * @param fn - * a function that initializes a builder to create the - * {@link MsearchTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final MsearchTemplateResponse msearchTemplate( - Function> fn, Type tDocumentType) - throws IOException, ElasticsearchException { - return msearchTemplate(fn.apply(new MsearchTemplateRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: mtermvectors - - /** - * Returns multiple termvectors in one request. - * - * @see Documentation - * on elastic.co - */ - - public MtermvectorsResponse mtermvectors(MtermvectorsRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) MtermvectorsRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Returns multiple termvectors in one request. - * - * @param fn - * a function that initializes a builder to create the - * {@link MtermvectorsRequest} - * @see Documentation - * on elastic.co - */ - - public final MtermvectorsResponse mtermvectors( - Function> fn) - throws IOException, ElasticsearchException { - return mtermvectors(fn.apply(new MtermvectorsRequest.Builder()).build()); - } - - /** - * Returns multiple termvectors in one request. - * - * @see Documentation - * on elastic.co - */ - - public MtermvectorsResponse mtermvectors() throws IOException, ElasticsearchException { - return this.transport.performRequest(new MtermvectorsRequest.Builder().build(), MtermvectorsRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: open_point_in_time - - /** - * A search request by default executes against the most recent visible data of - * the target indices, which is called point in time. Elasticsearch pit (point - * in time) is a lightweight view into the state of the data as it existed when - * initiated. In some cases, it’s preferred to perform multiple search requests - * using the same point in time. For example, if refreshes happen between - * search_after requests, then the results of those requests might - * not be consistent as changes happening between searches are only visible to - * the more recent point in time. - * - * @see Documentation - * on elastic.co - */ - - public OpenPointInTimeResponse openPointInTime(OpenPointInTimeRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) OpenPointInTimeRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * A search request by default executes against the most recent visible data of - * the target indices, which is called point in time. Elasticsearch pit (point - * in time) is a lightweight view into the state of the data as it existed when - * initiated. In some cases, it’s preferred to perform multiple search requests - * using the same point in time. For example, if refreshes happen between - * search_after requests, then the results of those requests might - * not be consistent as changes happening between searches are only visible to - * the more recent point in time. - * - * @param fn - * a function that initializes a builder to create the - * {@link OpenPointInTimeRequest} - * @see Documentation - * on elastic.co - */ - - public final OpenPointInTimeResponse openPointInTime( - Function> fn) - throws IOException, ElasticsearchException { - return openPointInTime(fn.apply(new OpenPointInTimeRequest.Builder()).build()); - } - - // ----- Endpoint: ping - - /** - * Ping the cluster. Returns whether the cluster is running. - * - * @see Documentation - * on elastic.co - */ - public BooleanResponse ping() throws IOException, ElasticsearchException { - return this.transport.performRequest(PingRequest._INSTANCE, PingRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: put_script - - /** - * Create or update a script or search template. Creates or updates a stored - * script or search template. - * - * @see Documentation - * on elastic.co - */ - - public PutScriptResponse putScript(PutScriptRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutScriptRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Create or update a script or search template. Creates or updates a stored - * script or search template. - * - * @param fn - * a function that initializes a builder to create the - * {@link PutScriptRequest} - * @see Documentation - * on elastic.co - */ - - public final PutScriptResponse putScript(Function> fn) - throws IOException, ElasticsearchException { - return putScript(fn.apply(new PutScriptRequest.Builder()).build()); - } - - // ----- Endpoint: rank_eval - - /** - * Enables you to evaluate the quality of ranked search results over a set of - * typical search queries. - * - * @see Documentation - * on elastic.co - */ - - public RankEvalResponse rankEval(RankEvalRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) RankEvalRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Enables you to evaluate the quality of ranked search results over a set of - * typical search queries. - * - * @param fn - * a function that initializes a builder to create the - * {@link RankEvalRequest} - * @see Documentation - * on elastic.co - */ - - public final RankEvalResponse rankEval(Function> fn) - throws IOException, ElasticsearchException { - return rankEval(fn.apply(new RankEvalRequest.Builder()).build()); - } - - // ----- Endpoint: reindex - - /** - * Reindex documents. Copies documents from a source to a destination. The - * source can be any existing index, alias, or data stream. The destination must - * differ from the source. For example, you cannot reindex a data stream into - * itself. - * - * @see Documentation - * on elastic.co - */ - - public ReindexResponse reindex(ReindexRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ReindexRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Reindex documents. Copies documents from a source to a destination. The - * source can be any existing index, alias, or data stream. The destination must - * differ from the source. For example, you cannot reindex a data stream into - * itself. - * - * @param fn - * a function that initializes a builder to create the - * {@link ReindexRequest} - * @see Documentation - * on elastic.co - */ - - public final ReindexResponse reindex(Function> fn) - throws IOException, ElasticsearchException { - return reindex(fn.apply(new ReindexRequest.Builder()).build()); - } - - // ----- Endpoint: render_search_template - - /** - * Renders a search template as a search request body. - * - * @see Documentation - * on elastic.co - */ - - public RenderSearchTemplateResponse renderSearchTemplate(RenderSearchTemplateRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) RenderSearchTemplateRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Renders a search template as a search request body. - * - * @param fn - * a function that initializes a builder to create the - * {@link RenderSearchTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final RenderSearchTemplateResponse renderSearchTemplate( - Function> fn) - throws IOException, ElasticsearchException { - return renderSearchTemplate(fn.apply(new RenderSearchTemplateRequest.Builder()).build()); - } - - /** - * Renders a search template as a search request body. - * - * @see Documentation - * on elastic.co - */ - - public RenderSearchTemplateResponse renderSearchTemplate() throws IOException, ElasticsearchException { - return this.transport.performRequest(new RenderSearchTemplateRequest.Builder().build(), - RenderSearchTemplateRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: scripts_painless_execute - - /** - * Run a script. Runs a script and returns a result. - * - * @see Documentation - * on elastic.co - */ - - public ScriptsPainlessExecuteResponse scriptsPainlessExecute( - ScriptsPainlessExecuteRequest request, Class tResultClass) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScriptsPainlessExecuteRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.scripts_painless_execute.Response.TResult", - getDeserializer(tResultClass)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Run a script. Runs a script and returns a result. - * - * @param fn - * a function that initializes a builder to create the - * {@link ScriptsPainlessExecuteRequest} - * @see Documentation - * on elastic.co - */ - - public final ScriptsPainlessExecuteResponse scriptsPainlessExecute( - Function> fn, - Class tResultClass) throws IOException, ElasticsearchException { - return scriptsPainlessExecute(fn.apply(new ScriptsPainlessExecuteRequest.Builder()).build(), tResultClass); - } - - /** - * Run a script. Runs a script and returns a result. - * - * @see Documentation - * on elastic.co - */ - - public ScriptsPainlessExecuteResponse scriptsPainlessExecute( - ScriptsPainlessExecuteRequest request, Type tResultType) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScriptsPainlessExecuteRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.scripts_painless_execute.Response.TResult", - getDeserializer(tResultType)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Run a script. Runs a script and returns a result. - * - * @param fn - * a function that initializes a builder to create the - * {@link ScriptsPainlessExecuteRequest} - * @see Documentation - * on elastic.co - */ - - public final ScriptsPainlessExecuteResponse scriptsPainlessExecute( - Function> fn, - Type tResultType) throws IOException, ElasticsearchException { - return scriptsPainlessExecute(fn.apply(new ScriptsPainlessExecuteRequest.Builder()).build(), tResultType); - } - - // ----- Endpoint: scroll - - /** - * Allows to retrieve a large numbers of results from a single search request. - * - * @see Documentation - * on elastic.co - */ - - public ScrollResponse scroll(ScrollRequest request, Class tDocumentClass) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScrollRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.scroll.Response.TDocument", getDeserializer(tDocumentClass)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Allows to retrieve a large numbers of results from a single search request. - * - * @param fn - * a function that initializes a builder to create the - * {@link ScrollRequest} - * @see Documentation - * on elastic.co - */ - - public final ScrollResponse scroll( - Function> fn, Class tDocumentClass) - throws IOException, ElasticsearchException { - return scroll(fn.apply(new ScrollRequest.Builder()).build(), tDocumentClass); - } - - /** - * Allows to retrieve a large numbers of results from a single search request. - * - * @see Documentation - * on elastic.co - */ - - public ScrollResponse scroll(ScrollRequest request, Type tDocumentType) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScrollRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.scroll.Response.TDocument", getDeserializer(tDocumentType)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Allows to retrieve a large numbers of results from a single search request. - * - * @param fn - * a function that initializes a builder to create the - * {@link ScrollRequest} - * @see Documentation - * on elastic.co - */ - - public final ScrollResponse scroll( - Function> fn, Type tDocumentType) - throws IOException, ElasticsearchException { - return scroll(fn.apply(new ScrollRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: search - - /** - * Returns search hits that match the query defined in the request. You can - * provide search queries using the q query string parameter or the - * request body. If both are specified, only the query parameter is used. - * - * @see Documentation - * on elastic.co - */ - - public SearchResponse search(SearchRequest request, Class tDocumentClass) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.search.Response.TDocument", getDeserializer(tDocumentClass)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Returns search hits that match the query defined in the request. You can - * provide search queries using the q query string parameter or the - * request body. If both are specified, only the query parameter is used. - * - * @param fn - * a function that initializes a builder to create the - * {@link SearchRequest} - * @see Documentation - * on elastic.co - */ - - public final SearchResponse search( - Function> fn, Class tDocumentClass) - throws IOException, ElasticsearchException { - return search(fn.apply(new SearchRequest.Builder()).build(), tDocumentClass); - } - - /** - * Returns search hits that match the query defined in the request. You can - * provide search queries using the q query string parameter or the - * request body. If both are specified, only the query parameter is used. - * - * @see Documentation - * on elastic.co - */ - - public SearchResponse search(SearchRequest request, Type tDocumentType) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.search.Response.TDocument", getDeserializer(tDocumentType)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Returns search hits that match the query defined in the request. You can - * provide search queries using the q query string parameter or the - * request body. If both are specified, only the query parameter is used. - * - * @param fn - * a function that initializes a builder to create the - * {@link SearchRequest} - * @see Documentation - * on elastic.co - */ - - public final SearchResponse search( - Function> fn, Type tDocumentType) - throws IOException, ElasticsearchException { - return search(fn.apply(new SearchRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: search_mvt - - /** - * Search a vector tile. Searches a vector tile for geospatial values. - * - * @see Documentation - * on elastic.co - */ - - public BinaryResponse searchMvt(SearchMvtRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - Endpoint endpoint = (Endpoint) SearchMvtRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Search a vector tile. Searches a vector tile for geospatial values. - * - * @param fn - * a function that initializes a builder to create the - * {@link SearchMvtRequest} - * @see Documentation - * on elastic.co - */ - - public final BinaryResponse searchMvt(Function> fn) - throws IOException, ElasticsearchException { - return searchMvt(fn.apply(new SearchMvtRequest.Builder()).build()); - } - - // ----- Endpoint: search_template - - /** - * Runs a search with a search template. - * - * @see Documentation - * on elastic.co - */ - - public SearchTemplateResponse searchTemplate(SearchTemplateRequest request, - Class tDocumentClass) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchTemplateRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.search_template.Response.TDocument", - getDeserializer(tDocumentClass)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Runs a search with a search template. - * - * @param fn - * a function that initializes a builder to create the - * {@link SearchTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final SearchTemplateResponse searchTemplate( - Function> fn, - Class tDocumentClass) throws IOException, ElasticsearchException { - return searchTemplate(fn.apply(new SearchTemplateRequest.Builder()).build(), tDocumentClass); - } - - /** - * Runs a search with a search template. - * - * @see Documentation - * on elastic.co - */ - - public SearchTemplateResponse searchTemplate(SearchTemplateRequest request, - Type tDocumentType) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchTemplateRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.search_template.Response.TDocument", - getDeserializer(tDocumentType)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Runs a search with a search template. - * - * @param fn - * a function that initializes a builder to create the - * {@link SearchTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final SearchTemplateResponse searchTemplate( - Function> fn, Type tDocumentType) - throws IOException, ElasticsearchException { - return searchTemplate(fn.apply(new SearchTemplateRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: terms_enum - - /** - * The terms enum API can be used to discover terms in the index that begin with - * the provided string. It is designed for low-latency look-ups used in - * auto-complete scenarios. - * - * @see Documentation - * on elastic.co - */ - - public TermsEnumResponse termsEnum(TermsEnumRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) TermsEnumRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * The terms enum API can be used to discover terms in the index that begin with - * the provided string. It is designed for low-latency look-ups used in - * auto-complete scenarios. - * - * @param fn - * a function that initializes a builder to create the - * {@link TermsEnumRequest} - * @see Documentation - * on elastic.co - */ - - public final TermsEnumResponse termsEnum(Function> fn) - throws IOException, ElasticsearchException { - return termsEnum(fn.apply(new TermsEnumRequest.Builder()).build()); - } - - // ----- Endpoint: termvectors - - /** - * Get term vector information. Returns information and statistics about terms - * in the fields of a particular document. - * - * @see Documentation - * on elastic.co - */ - - public TermvectorsResponse termvectors(TermvectorsRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, TermvectorsResponse, ErrorResponse> endpoint = (JsonEndpoint, TermvectorsResponse, ErrorResponse>) TermvectorsRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Get term vector information. Returns information and statistics about terms - * in the fields of a particular document. - * - * @param fn - * a function that initializes a builder to create the - * {@link TermvectorsRequest} - * @see Documentation - * on elastic.co - */ - - public final TermvectorsResponse termvectors( - Function, ObjectBuilder>> fn) - throws IOException, ElasticsearchException { - return termvectors(fn.apply(new TermvectorsRequest.Builder()).build()); - } - - // ----- Endpoint: update - - /** - * Update a document. Updates a document by running a script or passing a - * partial document. - * - * @see Documentation - * on elastic.co - */ - - public UpdateResponse update( - UpdateRequest request, Class tDocumentClass) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, UpdateResponse, ErrorResponse> endpoint = (JsonEndpoint, UpdateResponse, ErrorResponse>) UpdateRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.update.Response.TDocument", getDeserializer(tDocumentClass)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Update a document. Updates a document by running a script or passing a - * partial document. - * - * @param fn - * a function that initializes a builder to create the - * {@link UpdateRequest} - * @see Documentation - * on elastic.co - */ - - public final UpdateResponse update( - Function, ObjectBuilder>> fn, - Class tDocumentClass) throws IOException, ElasticsearchException { - return update(fn.apply(new UpdateRequest.Builder()).build(), tDocumentClass); - } - - /** - * Update a document. Updates a document by running a script or passing a - * partial document. - * - * @see Documentation - * on elastic.co - */ - - public UpdateResponse update( - UpdateRequest request, Type tDocumentType) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, UpdateResponse, ErrorResponse> endpoint = (JsonEndpoint, UpdateResponse, ErrorResponse>) UpdateRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.update.Response.TDocument", getDeserializer(tDocumentType)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Update a document. Updates a document by running a script or passing a - * partial document. - * - * @param fn - * a function that initializes a builder to create the - * {@link UpdateRequest} - * @see Documentation - * on elastic.co - */ - - public final UpdateResponse update( - Function, ObjectBuilder>> fn, - Type tDocumentType) throws IOException, ElasticsearchException { - return update(fn.apply(new UpdateRequest.Builder()).build(), tDocumentType); - } - - // ----- Endpoint: update_by_query - - /** - * Update documents. Updates documents that match the specified query. If no - * query is specified, performs an update on every document in the data stream - * or index without modifying the source, which is useful for picking up mapping - * changes. - * - * @see Documentation - * on elastic.co - */ - - public UpdateByQueryResponse updateByQuery(UpdateByQueryRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) UpdateByQueryRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Update documents. Updates documents that match the specified query. If no - * query is specified, performs an update on every document in the data stream - * or index without modifying the source, which is useful for picking up mapping - * changes. - * - * @param fn - * a function that initializes a builder to create the - * {@link UpdateByQueryRequest} - * @see Documentation - * on elastic.co - */ - - public final UpdateByQueryResponse updateByQuery( - Function> fn) - throws IOException, ElasticsearchException { - return updateByQuery(fn.apply(new UpdateByQueryRequest.Builder()).build()); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_helpers b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_helpers deleted file mode 120000 index e85ed36e5..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_helpers +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers \ No newline at end of file diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/AcknowledgedResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/AcknowledgedResponse.java deleted file mode 100644 index 82efd08d4..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/AcknowledgedResponse.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -/** - * Base interface for responses that are acknowledged by the server - */ -public interface AcknowledgedResponse { - boolean acknowledged(); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/AcknowledgedResponseBase.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/AcknowledgedResponseBase.java deleted file mode 100644 index 13cb50641..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/AcknowledgedResponseBase.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.util.Objects; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.AcknowledgedResponseBase - -/** - * - * @see API - * specification - */ - -public abstract class AcknowledgedResponseBase implements AcknowledgedResponse, JsonpSerializable { - private final boolean acknowledged; - - // --------------------------------------------------------------------------------------------- - - protected AcknowledgedResponseBase(AbstractBuilder builder) { - - this.acknowledged = ApiTypeHelper.requireNonNull(builder.acknowledged, this, "acknowledged"); - - } - - /** - * Required - For a successful response, this value is always true. On failure, - * an exception is returned instead. - *

- * API name: {@code acknowledged} - */ - public final boolean acknowledged() { - return this.acknowledged; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("acknowledged"); - generator.write(this.acknowledged); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - public abstract static class AbstractBuilder> - extends - WithJsonObjectBuilderBase { - private Boolean acknowledged; - - /** - * Required - For a successful response, this value is always true. On failure, - * an exception is returned instead. - *

- * API name: {@code acknowledged} - */ - public final BuilderT acknowledged(boolean value) { - this.acknowledged = value; - return self(); - } - - protected abstract BuilderT self(); - - } - - // --------------------------------------------------------------------------------------------- - protected static > void setupAcknowledgedResponseBaseDeserializer( - ObjectDeserializer op) { - - op.add(AbstractBuilder::acknowledged, JsonpDeserializer.booleanDeserializer(), "acknowledged"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/BulkIndexByScrollFailure.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/BulkIndexByScrollFailure.java deleted file mode 100644 index 90dfec471..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/BulkIndexByScrollFailure.java +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.BulkIndexByScrollFailure - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class BulkIndexByScrollFailure implements JsonpSerializable { - private final ErrorCause cause; - - private final String id; - - private final String index; - - private final int status; - - private final String type; - - // --------------------------------------------------------------------------------------------- - - private BulkIndexByScrollFailure(Builder builder) { - - this.cause = ApiTypeHelper.requireNonNull(builder.cause, this, "cause"); - this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); - this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); - this.status = ApiTypeHelper.requireNonNull(builder.status, this, "status"); - this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); - - } - - public static BulkIndexByScrollFailure of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code cause} - */ - public final ErrorCause cause() { - return this.cause; - } - - /** - * Required - API name: {@code id} - */ - public final String id() { - return this.id; - } - - /** - * Required - API name: {@code index} - */ - public final String index() { - return this.index; - } - - /** - * Required - API name: {@code status} - */ - public final int status() { - return this.status; - } - - /** - * Required - API name: {@code type} - */ - public final String type() { - return this.type; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("cause"); - this.cause.serialize(generator, mapper); - - generator.writeKey("id"); - generator.write(this.id); - - generator.writeKey("index"); - generator.write(this.index); - - generator.writeKey("status"); - generator.write(this.status); - - generator.writeKey("type"); - generator.write(this.type); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link BulkIndexByScrollFailure}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private ErrorCause cause; - - private String id; - - private String index; - - private Integer status; - - private String type; - - /** - * Required - API name: {@code cause} - */ - public final Builder cause(ErrorCause value) { - this.cause = value; - return this; - } - - /** - * Required - API name: {@code cause} - */ - public final Builder cause(Function> fn) { - return this.cause(fn.apply(new ErrorCause.Builder()).build()); - } - - /** - * Required - API name: {@code id} - */ - public final Builder id(String value) { - this.id = value; - return this; - } - - /** - * Required - API name: {@code index} - */ - public final Builder index(String value) { - this.index = value; - return this; - } - - /** - * Required - API name: {@code status} - */ - public final Builder status(int value) { - this.status = value; - return this; - } - - /** - * Required - API name: {@code type} - */ - public final Builder type(String value) { - this.type = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link BulkIndexByScrollFailure}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public BulkIndexByScrollFailure build() { - _checkSingleUse(); - - return new BulkIndexByScrollFailure(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link BulkIndexByScrollFailure} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, BulkIndexByScrollFailure::setupBulkIndexByScrollFailureDeserializer); - - protected static void setupBulkIndexByScrollFailureDeserializer( - ObjectDeserializer op) { - - op.add(Builder::cause, ErrorCause._DESERIALIZER, "cause"); - op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id"); - op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); - op.add(Builder::status, JsonpDeserializer.integerDeserializer(), "status"); - op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Bytes.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Bytes.java deleted file mode 100644 index 86c5b4c26..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Bytes.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API specification - */ -@JsonpDeserializable -public enum Bytes implements JsonEnum { - Bytes("b"), - - KiloBytes("kb"), - - MegaBytes("mb"), - - GigaBytes("gb"), - - TeraBytes("tb"), - - PetaBytes("pb"), - - ; - - private final String jsonValue; - - Bytes(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(Bytes.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterDetails.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterDetails.java deleted file mode 100644 index d7991c598..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterDetails.java +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Long; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.ClusterDetails - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterDetails implements JsonpSerializable { - private final ClusterSearchStatus status; - - private final String indices; - - @Nullable - private final Long took; - - private final boolean timedOut; - - @Nullable - private final ShardStatistics shards; - - private final List failures; - - // --------------------------------------------------------------------------------------------- - - private ClusterDetails(Builder builder) { - - this.status = ApiTypeHelper.requireNonNull(builder.status, this, "status"); - this.indices = ApiTypeHelper.requireNonNull(builder.indices, this, "indices"); - this.took = builder.took; - this.timedOut = ApiTypeHelper.requireNonNull(builder.timedOut, this, "timedOut"); - this.shards = builder.shards; - this.failures = ApiTypeHelper.unmodifiable(builder.failures); - - } - - public static ClusterDetails of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code status} - */ - public final ClusterSearchStatus status() { - return this.status; - } - - /** - * Required - API name: {@code indices} - */ - public final String indices() { - return this.indices; - } - - /** - * API name: {@code took} - */ - @Nullable - public final Long took() { - return this.took; - } - - /** - * Required - API name: {@code timed_out} - */ - public final boolean timedOut() { - return this.timedOut; - } - - /** - * API name: {@code _shards} - */ - @Nullable - public final ShardStatistics shards() { - return this.shards; - } - - /** - * API name: {@code failures} - */ - public final List failures() { - return this.failures; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("status"); - this.status.serialize(generator, mapper); - generator.writeKey("indices"); - generator.write(this.indices); - - if (this.took != null) { - generator.writeKey("took"); - generator.write(this.took); - - } - generator.writeKey("timed_out"); - generator.write(this.timedOut); - - if (this.shards != null) { - generator.writeKey("_shards"); - this.shards.serialize(generator, mapper); - - } - if (ApiTypeHelper.isDefined(this.failures)) { - generator.writeKey("failures"); - generator.writeStartArray(); - for (ShardFailure item0 : this.failures) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterDetails}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private ClusterSearchStatus status; - - private String indices; - - @Nullable - private Long took; - - private Boolean timedOut; - - @Nullable - private ShardStatistics shards; - - @Nullable - private List failures; - - /** - * Required - API name: {@code status} - */ - public final Builder status(ClusterSearchStatus value) { - this.status = value; - return this; - } - - /** - * Required - API name: {@code indices} - */ - public final Builder indices(String value) { - this.indices = value; - return this; - } - - /** - * API name: {@code took} - */ - public final Builder took(@Nullable Long value) { - this.took = value; - return this; - } - - /** - * Required - API name: {@code timed_out} - */ - public final Builder timedOut(boolean value) { - this.timedOut = value; - return this; - } - - /** - * API name: {@code _shards} - */ - public final Builder shards(@Nullable ShardStatistics value) { - this.shards = value; - return this; - } - - /** - * API name: {@code _shards} - */ - public final Builder shards(Function> fn) { - return this.shards(fn.apply(new ShardStatistics.Builder()).build()); - } - - /** - * API name: {@code failures} - *

- * Adds all elements of list to failures. - */ - public final Builder failures(List list) { - this.failures = _listAddAll(this.failures, list); - return this; - } - - /** - * API name: {@code failures} - *

- * Adds one or more values to failures. - */ - public final Builder failures(ShardFailure value, ShardFailure... values) { - this.failures = _listAdd(this.failures, value, values); - return this; - } - - /** - * API name: {@code failures} - *

- * Adds a value to failures using a builder lambda. - */ - public final Builder failures(Function> fn) { - return failures(fn.apply(new ShardFailure.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterDetails}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterDetails build() { - _checkSingleUse(); - - return new ClusterDetails(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterDetails} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ClusterDetails::setupClusterDetailsDeserializer); - - protected static void setupClusterDetailsDeserializer(ObjectDeserializer op) { - - op.add(Builder::status, ClusterSearchStatus._DESERIALIZER, "status"); - op.add(Builder::indices, JsonpDeserializer.stringDeserializer(), "indices"); - op.add(Builder::took, JsonpDeserializer.longDeserializer(), "took"); - op.add(Builder::timedOut, JsonpDeserializer.booleanDeserializer(), "timed_out"); - op.add(Builder::shards, ShardStatistics._DESERIALIZER, "_shards"); - op.add(Builder::failures, JsonpDeserializer.arrayDeserializer(ShardFailure._DESERIALIZER), "failures"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterInfoTarget.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterInfoTarget.java deleted file mode 100644 index 586d2ca64..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterInfoTarget.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum ClusterInfoTarget implements JsonEnum { - All("_all"), - - Http("http"), - - Ingest("ingest"), - - ThreadPool("thread_pool"), - - Script("script"), - - ; - - private final String jsonValue; - - ClusterInfoTarget(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - ClusterInfoTarget.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterSearchStatus.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterSearchStatus.java deleted file mode 100644 index 2ba0d100d..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterSearchStatus.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum ClusterSearchStatus implements JsonEnum { - Running("running"), - - Successful("successful"), - - Partial("partial"), - - Skipped("skipped"), - - Failed("failed"), - - ; - - private final String jsonValue; - - ClusterSearchStatus(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - ClusterSearchStatus.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterStatistics.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterStatistics.java deleted file mode 100644 index 40c028dcf..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterStatistics.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.ClusterStatistics - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterStatistics implements JsonpSerializable { - private final int skipped; - - private final int successful; - - private final int total; - - private final int running; - - private final int partial; - - private final int failed; - - private final Map details; - - // --------------------------------------------------------------------------------------------- - - private ClusterStatistics(Builder builder) { - - this.skipped = ApiTypeHelper.requireNonNull(builder.skipped, this, "skipped"); - this.successful = ApiTypeHelper.requireNonNull(builder.successful, this, "successful"); - this.total = ApiTypeHelper.requireNonNull(builder.total, this, "total"); - this.running = ApiTypeHelper.requireNonNull(builder.running, this, "running"); - this.partial = ApiTypeHelper.requireNonNull(builder.partial, this, "partial"); - this.failed = ApiTypeHelper.requireNonNull(builder.failed, this, "failed"); - this.details = ApiTypeHelper.unmodifiable(builder.details); - - } - - public static ClusterStatistics of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code skipped} - */ - public final int skipped() { - return this.skipped; - } - - /** - * Required - API name: {@code successful} - */ - public final int successful() { - return this.successful; - } - - /** - * Required - API name: {@code total} - */ - public final int total() { - return this.total; - } - - /** - * Required - API name: {@code running} - */ - public final int running() { - return this.running; - } - - /** - * Required - API name: {@code partial} - */ - public final int partial() { - return this.partial; - } - - /** - * Required - API name: {@code failed} - */ - public final int failed() { - return this.failed; - } - - /** - * API name: {@code details} - */ - public final Map details() { - return this.details; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("skipped"); - generator.write(this.skipped); - - generator.writeKey("successful"); - generator.write(this.successful); - - generator.writeKey("total"); - generator.write(this.total); - - generator.writeKey("running"); - generator.write(this.running); - - generator.writeKey("partial"); - generator.write(this.partial); - - generator.writeKey("failed"); - generator.write(this.failed); - - if (ApiTypeHelper.isDefined(this.details)) { - generator.writeKey("details"); - generator.writeStartObject(); - for (Map.Entry item0 : this.details.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterStatistics}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Integer skipped; - - private Integer successful; - - private Integer total; - - private Integer running; - - private Integer partial; - - private Integer failed; - - @Nullable - private Map details; - - /** - * Required - API name: {@code skipped} - */ - public final Builder skipped(int value) { - this.skipped = value; - return this; - } - - /** - * Required - API name: {@code successful} - */ - public final Builder successful(int value) { - this.successful = value; - return this; - } - - /** - * Required - API name: {@code total} - */ - public final Builder total(int value) { - this.total = value; - return this; - } - - /** - * Required - API name: {@code running} - */ - public final Builder running(int value) { - this.running = value; - return this; - } - - /** - * Required - API name: {@code partial} - */ - public final Builder partial(int value) { - this.partial = value; - return this; - } - - /** - * Required - API name: {@code failed} - */ - public final Builder failed(int value) { - this.failed = value; - return this; - } - - /** - * API name: {@code details} - *

- * Adds all entries of map to details. - */ - public final Builder details(Map map) { - this.details = _mapPutAll(this.details, map); - return this; - } - - /** - * API name: {@code details} - *

- * Adds an entry to details. - */ - public final Builder details(String key, ClusterDetails value) { - this.details = _mapPut(this.details, key, value); - return this; - } - - /** - * API name: {@code details} - *

- * Adds an entry to details using a builder lambda. - */ - public final Builder details(String key, Function> fn) { - return details(key, fn.apply(new ClusterDetails.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterStatistics}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterStatistics build() { - _checkSingleUse(); - - return new ClusterStatistics(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterStatistics} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ClusterStatistics::setupClusterStatisticsDeserializer); - - protected static void setupClusterStatisticsDeserializer(ObjectDeserializer op) { - - op.add(Builder::skipped, JsonpDeserializer.integerDeserializer(), "skipped"); - op.add(Builder::successful, JsonpDeserializer.integerDeserializer(), "successful"); - op.add(Builder::total, JsonpDeserializer.integerDeserializer(), "total"); - op.add(Builder::running, JsonpDeserializer.integerDeserializer(), "running"); - op.add(Builder::partial, JsonpDeserializer.integerDeserializer(), "partial"); - op.add(Builder::failed, JsonpDeserializer.integerDeserializer(), "failed"); - op.add(Builder::details, JsonpDeserializer.stringMapDeserializer(ClusterDetails._DESERIALIZER), "details"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Conflicts.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Conflicts.java deleted file mode 100644 index 2e580abea..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Conflicts.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum Conflicts implements JsonEnum { - /** - * Stop reindexing if there are conflicts. - */ - Abort("abort"), - - /** - * Continue reindexing even if there are conflicts. - */ - Proceed("proceed"), - - ; - - private final String jsonValue; - - Conflicts(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - Conflicts.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/CoordsGeoBounds.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/CoordsGeoBounds.java deleted file mode 100644 index 031fab42e..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/CoordsGeoBounds.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Double; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.CoordsGeoBounds - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class CoordsGeoBounds implements JsonpSerializable { - private final double top; - - private final double bottom; - - private final double left; - - private final double right; - - // --------------------------------------------------------------------------------------------- - - private CoordsGeoBounds(Builder builder) { - - this.top = ApiTypeHelper.requireNonNull(builder.top, this, "top"); - this.bottom = ApiTypeHelper.requireNonNull(builder.bottom, this, "bottom"); - this.left = ApiTypeHelper.requireNonNull(builder.left, this, "left"); - this.right = ApiTypeHelper.requireNonNull(builder.right, this, "right"); - - } - - public static CoordsGeoBounds of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code top} - */ - public final double top() { - return this.top; - } - - /** - * Required - API name: {@code bottom} - */ - public final double bottom() { - return this.bottom; - } - - /** - * Required - API name: {@code left} - */ - public final double left() { - return this.left; - } - - /** - * Required - API name: {@code right} - */ - public final double right() { - return this.right; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("top"); - generator.write(this.top); - - generator.writeKey("bottom"); - generator.write(this.bottom); - - generator.writeKey("left"); - generator.write(this.left); - - generator.writeKey("right"); - generator.write(this.right); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link CoordsGeoBounds}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Double top; - - private Double bottom; - - private Double left; - - private Double right; - - /** - * Required - API name: {@code top} - */ - public final Builder top(double value) { - this.top = value; - return this; - } - - /** - * Required - API name: {@code bottom} - */ - public final Builder bottom(double value) { - this.bottom = value; - return this; - } - - /** - * Required - API name: {@code left} - */ - public final Builder left(double value) { - this.left = value; - return this; - } - - /** - * Required - API name: {@code right} - */ - public final Builder right(double value) { - this.right = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link CoordsGeoBounds}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public CoordsGeoBounds build() { - _checkSingleUse(); - - return new CoordsGeoBounds(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link CoordsGeoBounds} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - CoordsGeoBounds::setupCoordsGeoBoundsDeserializer); - - protected static void setupCoordsGeoBoundsDeserializer(ObjectDeserializer op) { - - op.add(Builder::top, JsonpDeserializer.doubleDeserializer(), "top"); - op.add(Builder::bottom, JsonpDeserializer.doubleDeserializer(), "bottom"); - op.add(Builder::left, JsonpDeserializer.doubleDeserializer(), "left"); - op.add(Builder::right, JsonpDeserializer.doubleDeserializer(), "right"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFIIndependenceMeasure.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFIIndependenceMeasure.java deleted file mode 100644 index 71bc959d4..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFIIndependenceMeasure.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum DFIIndependenceMeasure implements JsonEnum { - Standardized("standardized"), - - Saturated("saturated"), - - Chisquared("chisquared"), - - ; - - private final String jsonValue; - - DFIIndependenceMeasure(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - DFIIndependenceMeasure.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFRAfterEffect.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFRAfterEffect.java deleted file mode 100644 index b5004f87b..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFRAfterEffect.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum DFRAfterEffect implements JsonEnum { - No("no"), - - B("b"), - - L("l"), - - ; - - private final String jsonValue; - - DFRAfterEffect(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - DFRAfterEffect.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFRBasicModel.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFRBasicModel.java deleted file mode 100644 index 83d456825..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFRBasicModel.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum DFRBasicModel implements JsonEnum { - Be("be"), - - D("d"), - - G("g"), - - If("if"), - - In("in"), - - Ine("ine"), - - P("p"), - - ; - - private final String jsonValue; - - DFRBasicModel(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - DFRBasicModel.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DistanceUnit.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DistanceUnit.java deleted file mode 100644 index a6b908b9b..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DistanceUnit.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum DistanceUnit implements JsonEnum { - Inches("in"), - - Feet("ft"), - - Yards("yd"), - - Miles("mi"), - - NauticMiles("nmi"), - - Kilometers("km"), - - Meters("m"), - - Centimeters("cm"), - - Millimeters("mm"), - - ; - - private final String jsonValue; - - DistanceUnit(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - DistanceUnit.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java deleted file mode 100644 index bad5ca106..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.transport.http.TransportHttpClient; - -import javax.annotation.Nullable; - -/** - * Exception thrown by API client methods when Elasticsearch could not accept or - * process a request. - *

- * The {@link #error()} contains the error's type and reason along with - * additional details that depend on the error type and the API endpoint that - * was called. - */ -public class ElasticsearchException extends RuntimeException { - - private final ErrorResponse response; - private final String endpointId; - @Nullable - private final TransportHttpClient.Response httpResponse; - - public ElasticsearchException(String endpointId, ErrorResponse response, - @Nullable TransportHttpClient.Response httpResponse) { - super("[" + endpointId + "] failed: [" + response.error().type() + "] " + response.error().reason()); - this.response = response; - this.endpointId = endpointId; - this.httpResponse = httpResponse; - } - - public ElasticsearchException(String endpointId, ErrorResponse response) { - this(endpointId, response, null); - } - - /** - * Identifier of the API endpoint that failed to be called. - */ - public String endpointId() { - return this.endpointId; - } - - /** - * The error response sent by Elasticsearch - */ - public ErrorResponse response() { - return this.response; - } - - /** - * The cause of the error. Shortcut for {@code response().error()}. - */ - public ErrorCause error() { - return this.response.error(); - } - - /** - * Status code returned by Elasticsearch. Shortcut for - * {@code response().status()}. - */ - public int status() { - return this.response.status(); - } - - /** - * The underlying http response, if available. - */ - @Nullable - public TransportHttpClient.Response httpResponse() { - return this.httpResponse; - } -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchVersionInfo.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchVersionInfo.java deleted file mode 100644 index ac2c58313..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchVersionInfo.java +++ /dev/null @@ -1,353 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.DateTime; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.ElasticsearchVersionInfo - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ElasticsearchVersionInfo implements JsonpSerializable { - private final DateTime buildDate; - - private final String buildFlavor; - - private final String buildHash; - - private final boolean buildSnapshot; - - private final String buildType; - - private final String luceneVersion; - - private final String minimumIndexCompatibilityVersion; - - private final String minimumWireCompatibilityVersion; - - private final String number; - - // --------------------------------------------------------------------------------------------- - - private ElasticsearchVersionInfo(Builder builder) { - - this.buildDate = ApiTypeHelper.requireNonNull(builder.buildDate, this, "buildDate"); - this.buildFlavor = ApiTypeHelper.requireNonNull(builder.buildFlavor, this, "buildFlavor"); - this.buildHash = ApiTypeHelper.requireNonNull(builder.buildHash, this, "buildHash"); - this.buildSnapshot = ApiTypeHelper.requireNonNull(builder.buildSnapshot, this, "buildSnapshot"); - this.buildType = ApiTypeHelper.requireNonNull(builder.buildType, this, "buildType"); - this.luceneVersion = ApiTypeHelper.requireNonNull(builder.luceneVersion, this, "luceneVersion"); - this.minimumIndexCompatibilityVersion = ApiTypeHelper.requireNonNull(builder.minimumIndexCompatibilityVersion, - this, "minimumIndexCompatibilityVersion"); - this.minimumWireCompatibilityVersion = ApiTypeHelper.requireNonNull(builder.minimumWireCompatibilityVersion, - this, "minimumWireCompatibilityVersion"); - this.number = ApiTypeHelper.requireNonNull(builder.number, this, "number"); - - } - - public static ElasticsearchVersionInfo of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code build_date} - */ - public final DateTime buildDate() { - return this.buildDate; - } - - /** - * Required - API name: {@code build_flavor} - */ - public final String buildFlavor() { - return this.buildFlavor; - } - - /** - * Required - API name: {@code build_hash} - */ - public final String buildHash() { - return this.buildHash; - } - - /** - * Required - API name: {@code build_snapshot} - */ - public final boolean buildSnapshot() { - return this.buildSnapshot; - } - - /** - * Required - API name: {@code build_type} - */ - public final String buildType() { - return this.buildType; - } - - /** - * Required - API name: {@code lucene_version} - */ - public final String luceneVersion() { - return this.luceneVersion; - } - - /** - * Required - API name: {@code minimum_index_compatibility_version} - */ - public final String minimumIndexCompatibilityVersion() { - return this.minimumIndexCompatibilityVersion; - } - - /** - * Required - API name: {@code minimum_wire_compatibility_version} - */ - public final String minimumWireCompatibilityVersion() { - return this.minimumWireCompatibilityVersion; - } - - /** - * Required - API name: {@code number} - */ - public final String number() { - return this.number; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("build_date"); - this.buildDate.serialize(generator, mapper); - generator.writeKey("build_flavor"); - generator.write(this.buildFlavor); - - generator.writeKey("build_hash"); - generator.write(this.buildHash); - - generator.writeKey("build_snapshot"); - generator.write(this.buildSnapshot); - - generator.writeKey("build_type"); - generator.write(this.buildType); - - generator.writeKey("lucene_version"); - generator.write(this.luceneVersion); - - generator.writeKey("minimum_index_compatibility_version"); - generator.write(this.minimumIndexCompatibilityVersion); - - generator.writeKey("minimum_wire_compatibility_version"); - generator.write(this.minimumWireCompatibilityVersion); - - generator.writeKey("number"); - generator.write(this.number); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ElasticsearchVersionInfo}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private DateTime buildDate; - - private String buildFlavor; - - private String buildHash; - - private Boolean buildSnapshot; - - private String buildType; - - private String luceneVersion; - - private String minimumIndexCompatibilityVersion; - - private String minimumWireCompatibilityVersion; - - private String number; - - /** - * Required - API name: {@code build_date} - */ - public final Builder buildDate(DateTime value) { - this.buildDate = value; - return this; - } - - /** - * Required - API name: {@code build_flavor} - */ - public final Builder buildFlavor(String value) { - this.buildFlavor = value; - return this; - } - - /** - * Required - API name: {@code build_hash} - */ - public final Builder buildHash(String value) { - this.buildHash = value; - return this; - } - - /** - * Required - API name: {@code build_snapshot} - */ - public final Builder buildSnapshot(boolean value) { - this.buildSnapshot = value; - return this; - } - - /** - * Required - API name: {@code build_type} - */ - public final Builder buildType(String value) { - this.buildType = value; - return this; - } - - /** - * Required - API name: {@code lucene_version} - */ - public final Builder luceneVersion(String value) { - this.luceneVersion = value; - return this; - } - - /** - * Required - API name: {@code minimum_index_compatibility_version} - */ - public final Builder minimumIndexCompatibilityVersion(String value) { - this.minimumIndexCompatibilityVersion = value; - return this; - } - - /** - * Required - API name: {@code minimum_wire_compatibility_version} - */ - public final Builder minimumWireCompatibilityVersion(String value) { - this.minimumWireCompatibilityVersion = value; - return this; - } - - /** - * Required - API name: {@code number} - */ - public final Builder number(String value) { - this.number = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ElasticsearchVersionInfo}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ElasticsearchVersionInfo build() { - _checkSingleUse(); - - return new ElasticsearchVersionInfo(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ElasticsearchVersionInfo} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ElasticsearchVersionInfo::setupElasticsearchVersionInfoDeserializer); - - protected static void setupElasticsearchVersionInfoDeserializer( - ObjectDeserializer op) { - - op.add(Builder::buildDate, DateTime._DESERIALIZER, "build_date"); - op.add(Builder::buildFlavor, JsonpDeserializer.stringDeserializer(), "build_flavor"); - op.add(Builder::buildHash, JsonpDeserializer.stringDeserializer(), "build_hash"); - op.add(Builder::buildSnapshot, JsonpDeserializer.booleanDeserializer(), "build_snapshot"); - op.add(Builder::buildType, JsonpDeserializer.stringDeserializer(), "build_type"); - op.add(Builder::luceneVersion, JsonpDeserializer.stringDeserializer(), "lucene_version"); - op.add(Builder::minimumIndexCompatibilityVersion, JsonpDeserializer.stringDeserializer(), - "minimum_index_compatibility_version"); - op.add(Builder::minimumWireCompatibilityVersion, JsonpDeserializer.stringDeserializer(), - "minimum_wire_compatibility_version"); - op.add(Builder::number, JsonpDeserializer.stringDeserializer(), "number"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/EmptyObject.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/EmptyObject.java deleted file mode 100644 index c0b97a9a9..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/EmptyObject.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * For empty Class assignments - * - * @see API - * specification - */ -@JsonpDeserializable -public class EmptyObject implements JsonpSerializable { - - public static final class Builder implements ObjectBuilder { - @Override - public EmptyObject build() { - return EmptyObject._INSTANCE; - } - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - generator.writeEnd(); - } - - /** - * Singleton instance for empty class {@link EmptyObject}. - */ - public static final EmptyObject _INSTANCE = new EmptyObject(); - - public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer - .emptyObject(EmptyObject._INSTANCE); - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ErrorCause.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ErrorCause.java deleted file mode 100644 index 4a9156c7d..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ErrorCause.java +++ /dev/null @@ -1,425 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.ErrorCause - -/** - * Cause and details about a request failure. This class defines the properties - * common to all error types. Additional details are also provided, that depend - * on the error type. - * - * @see API - * specification - */ -@JsonpDeserializable -public class ErrorCause implements JsonpSerializable { - private final Map metadata; - - @Nullable - private final String type; - - @Nullable - private final String reason; - - @Nullable - private final String stackTrace; - - @Nullable - private final ErrorCause causedBy; - - private final List rootCause; - - private final List suppressed; - - // --------------------------------------------------------------------------------------------- - - private ErrorCause(Builder builder) { - - this.metadata = ApiTypeHelper.unmodifiable(builder.metadata); - - this.type = builder.type; - this.reason = builder.reason; - this.stackTrace = builder.stackTrace; - this.causedBy = builder.causedBy; - this.rootCause = ApiTypeHelper.unmodifiable(builder.rootCause); - this.suppressed = ApiTypeHelper.unmodifiable(builder.suppressed); - - } - - public static ErrorCause of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Additional details about the error - */ - public final Map metadata() { - return this.metadata; - } - - /** - * The type of error - *

- * API name: {@code type} - */ - @Nullable - public final String type() { - return this.type; - } - - /** - * A human-readable explanation of the error, in english - *

- * API name: {@code reason} - */ - @Nullable - public final String reason() { - return this.reason; - } - - /** - * The server stack trace. Present only if the error_trace=true - * parameter was sent with the request. - *

- * API name: {@code stack_trace} - */ - @Nullable - public final String stackTrace() { - return this.stackTrace; - } - - /** - * API name: {@code caused_by} - */ - @Nullable - public final ErrorCause causedBy() { - return this.causedBy; - } - - /** - * API name: {@code root_cause} - */ - public final List rootCause() { - return this.rootCause; - } - - /** - * API name: {@code suppressed} - */ - public final List suppressed() { - return this.suppressed; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - for (Map.Entry item0 : this.metadata.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - - if (this.type != null) { - generator.writeKey("type"); - generator.write(this.type); - - } - if (this.reason != null) { - generator.writeKey("reason"); - generator.write(this.reason); - - } - if (this.stackTrace != null) { - generator.writeKey("stack_trace"); - generator.write(this.stackTrace); - - } - if (this.causedBy != null) { - generator.writeKey("caused_by"); - this.causedBy.serialize(generator, mapper); - - } - if (ApiTypeHelper.isDefined(this.rootCause)) { - generator.writeKey("root_cause"); - generator.writeStartArray(); - for (ErrorCause item0 : this.rootCause) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.suppressed)) { - generator.writeKey("suppressed"); - generator.writeStartArray(); - for (ErrorCause item0 : this.suppressed) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ErrorCause}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private Map metadata = new HashMap<>(); - - /** - * Additional details about the error - *

- * Adds all entries of map to metadata. - */ - public final Builder metadata(Map map) { - this.metadata = _mapPutAll(this.metadata, map); - return this; - } - - /** - * Additional details about the error - *

- * Adds an entry to metadata. - */ - public final Builder metadata(String key, JsonData value) { - this.metadata = _mapPut(this.metadata, key, value); - return this; - } - - @Nullable - private String type; - - @Nullable - private String reason; - - @Nullable - private String stackTrace; - - @Nullable - private ErrorCause causedBy; - - @Nullable - private List rootCause; - - @Nullable - private List suppressed; - - /** - * The type of error - *

- * API name: {@code type} - */ - public final Builder type(@Nullable String value) { - this.type = value; - return this; - } - - /** - * A human-readable explanation of the error, in english - *

- * API name: {@code reason} - */ - public final Builder reason(@Nullable String value) { - this.reason = value; - return this; - } - - /** - * The server stack trace. Present only if the error_trace=true - * parameter was sent with the request. - *

- * API name: {@code stack_trace} - */ - public final Builder stackTrace(@Nullable String value) { - this.stackTrace = value; - return this; - } - - /** - * API name: {@code caused_by} - */ - public final Builder causedBy(@Nullable ErrorCause value) { - this.causedBy = value; - return this; - } - - /** - * API name: {@code caused_by} - */ - public final Builder causedBy(Function> fn) { - return this.causedBy(fn.apply(new ErrorCause.Builder()).build()); - } - - /** - * API name: {@code root_cause} - *

- * Adds all elements of list to rootCause. - */ - public final Builder rootCause(List list) { - this.rootCause = _listAddAll(this.rootCause, list); - return this; - } - - /** - * API name: {@code root_cause} - *

- * Adds one or more values to rootCause. - */ - public final Builder rootCause(ErrorCause value, ErrorCause... values) { - this.rootCause = _listAdd(this.rootCause, value, values); - return this; - } - - /** - * API name: {@code root_cause} - *

- * Adds a value to rootCause using a builder lambda. - */ - public final Builder rootCause(Function> fn) { - return rootCause(fn.apply(new ErrorCause.Builder()).build()); - } - - /** - * API name: {@code suppressed} - *

- * Adds all elements of list to suppressed. - */ - public final Builder suppressed(List list) { - this.suppressed = _listAddAll(this.suppressed, list); - return this; - } - - /** - * API name: {@code suppressed} - *

- * Adds one or more values to suppressed. - */ - public final Builder suppressed(ErrorCause value, ErrorCause... values) { - this.suppressed = _listAdd(this.suppressed, value, values); - return this; - } - - /** - * API name: {@code suppressed} - *

- * Adds a value to suppressed using a builder lambda. - */ - public final Builder suppressed(Function> fn) { - return suppressed(fn.apply(new ErrorCause.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ErrorCause}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ErrorCause build() { - _checkSingleUse(); - - return new ErrorCause(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ErrorCause} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ErrorCause::setupErrorCauseDeserializer); - - protected static void setupErrorCauseDeserializer(ObjectDeserializer op) { - - op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); - op.add(Builder::reason, JsonpDeserializer.stringDeserializer(), "reason"); - op.add(Builder::stackTrace, JsonpDeserializer.stringDeserializer(), "stack_trace"); - op.add(Builder::causedBy, ErrorCause._DESERIALIZER, "caused_by"); - op.add(Builder::rootCause, JsonpDeserializer.arrayDeserializer(ErrorCause._DESERIALIZER), "root_cause"); - op.add(Builder::suppressed, JsonpDeserializer.arrayDeserializer(ErrorCause._DESERIALIZER), "suppressed"); - - op.setUnknownFieldHandler((builder, name, parser, mapper) -> { - builder.metadata(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); - }); - op.shortcutProperty("reason"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ErrorResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ErrorResponse.java deleted file mode 100644 index aa9bdfcbc..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ErrorResponse.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.ErrorResponseBase - -/** - * The response returned by Elasticsearch when request execution did not - * succeed. - * - * @see API - * specification - */ -@JsonpDeserializable -public class ErrorResponse implements JsonpSerializable { - private final ErrorCause error; - - private final int status; - - // --------------------------------------------------------------------------------------------- - - private ErrorResponse(Builder builder) { - - this.error = ApiTypeHelper.requireNonNull(builder.error, this, "error"); - this.status = ApiTypeHelper.requireNonNull(builder.status, this, "status"); - - } - - public static ErrorResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code error} - */ - public final ErrorCause error() { - return this.error; - } - - /** - * Required - API name: {@code status} - */ - public final int status() { - return this.status; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("error"); - this.error.serialize(generator, mapper); - - generator.writeKey("status"); - generator.write(this.status); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ErrorResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private ErrorCause error; - - private Integer status; - - /** - * Required - API name: {@code error} - */ - public final Builder error(ErrorCause value) { - this.error = value; - return this; - } - - /** - * Required - API name: {@code error} - */ - public final Builder error(Function> fn) { - return this.error(fn.apply(new ErrorCause.Builder()).build()); - } - - /** - * Required - API name: {@code status} - */ - public final Builder status(int value) { - this.status = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ErrorResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ErrorResponse build() { - _checkSingleUse(); - - return new ErrorResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ErrorResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ErrorResponse::setupErrorResponseDeserializer); - - protected static void setupErrorResponseDeserializer(ObjectDeserializer op) { - - op.add(Builder::error, ErrorCause._DESERIALIZER, "error"); - op.add(Builder::status, JsonpDeserializer.integerDeserializer(), "status"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ExpandWildcard.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ExpandWildcard.java deleted file mode 100644 index 29e214ce6..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ExpandWildcard.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum ExpandWildcard implements JsonEnum { - /** - * Match any data stream or index, including hidden ones. - */ - All("all"), - - /** - * Match open, non-hidden indices. Also matches any non-hidden data stream. - */ - Open("open"), - - /** - * Match closed, non-hidden indices. Also matches any non-hidden data stream. - * Data streams cannot be closed. - */ - Closed("closed"), - - /** - * Match hidden data streams and hidden indices. Must be combined with open, - * closed, or both. - */ - Hidden("hidden"), - - /** - * Wildcard expressions are not accepted. - */ - None("none"), - - ; - - private final String jsonValue; - - ExpandWildcard(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - ExpandWildcard.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSort.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSort.java deleted file mode 100644 index a0b377a02..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSort.java +++ /dev/null @@ -1,404 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.elasticsearch._types.mapping.FieldType; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.FieldSort - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class FieldSort implements JsonpSerializable { - // Single key dictionary - private final String field; - - @Nullable - private final FieldValue missing; - - @Nullable - private final SortMode mode; - - @Nullable - private final NestedSortValue nested; - - @Nullable - private final SortOrder order; - - @Nullable - private final FieldType unmappedType; - - @Nullable - private final FieldSortNumericType numericType; - - @Nullable - private final String format; - - // --------------------------------------------------------------------------------------------- - - private FieldSort(Builder builder) { - - this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); - - this.missing = builder.missing; - this.mode = builder.mode; - this.nested = builder.nested; - this.order = builder.order; - this.unmappedType = builder.unmappedType; - this.numericType = builder.numericType; - this.format = builder.format; - - } - - public static FieldSort of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - The target field - */ - public final String field() { - return this.field; - } - - /** - * API name: {@code missing} - */ - @Nullable - public final FieldValue missing() { - return this.missing; - } - - /** - * API name: {@code mode} - */ - @Nullable - public final SortMode mode() { - return this.mode; - } - - /** - * API name: {@code nested} - */ - @Nullable - public final NestedSortValue nested() { - return this.nested; - } - - /** - * API name: {@code order} - */ - @Nullable - public final SortOrder order() { - return this.order; - } - - /** - * API name: {@code unmapped_type} - */ - @Nullable - public final FieldType unmappedType() { - return this.unmappedType; - } - - /** - * API name: {@code numeric_type} - */ - @Nullable - public final FieldSortNumericType numericType() { - return this.numericType; - } - - /** - * API name: {@code format} - */ - @Nullable - public final String format() { - return this.format; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(this.field); - - if (this.missing != null) { - generator.writeKey("missing"); - this.missing.serialize(generator, mapper); - - } - if (this.mode != null) { - generator.writeKey("mode"); - this.mode.serialize(generator, mapper); - } - if (this.nested != null) { - generator.writeKey("nested"); - this.nested.serialize(generator, mapper); - - } - if (this.order != null) { - generator.writeKey("order"); - this.order.serialize(generator, mapper); - } - if (this.unmappedType != null) { - generator.writeKey("unmapped_type"); - this.unmappedType.serialize(generator, mapper); - } - if (this.numericType != null) { - generator.writeKey("numeric_type"); - this.numericType.serialize(generator, mapper); - } - if (this.format != null) { - generator.writeKey("format"); - generator.write(this.format); - - } - - generator.writeEnd(); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link FieldSort}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String field; - - /** - * Required - The target field - */ - public final Builder field(String value) { - this.field = value; - return this; - } - - @Nullable - private FieldValue missing; - - @Nullable - private SortMode mode; - - @Nullable - private NestedSortValue nested; - - @Nullable - private SortOrder order; - - @Nullable - private FieldType unmappedType; - - @Nullable - private FieldSortNumericType numericType; - - @Nullable - private String format; - - /** - * API name: {@code missing} - */ - public final Builder missing(@Nullable FieldValue value) { - this.missing = value; - return this; - } - - /** - * API name: {@code missing} - */ - public final Builder missing(Function> fn) { - return this.missing(fn.apply(new FieldValue.Builder()).build()); - } - - /** - * API name: {@code missing} - */ - public final Builder missing(String value) { - this.missing = FieldValue.of(value); - return this; - } - - /** - * API name: {@code missing} - */ - public final Builder missing(long value) { - this.missing = FieldValue.of(value); - return this; - } - - /** - * API name: {@code missing} - */ - public final Builder missing(double value) { - this.missing = FieldValue.of(value); - return this; - } - - /** - * API name: {@code missing} - */ - public final Builder missing(boolean value) { - this.missing = FieldValue.of(value); - return this; - } - - /** - * API name: {@code mode} - */ - public final Builder mode(@Nullable SortMode value) { - this.mode = value; - return this; - } - - /** - * API name: {@code nested} - */ - public final Builder nested(@Nullable NestedSortValue value) { - this.nested = value; - return this; - } - - /** - * API name: {@code nested} - */ - public final Builder nested(Function> fn) { - return this.nested(fn.apply(new NestedSortValue.Builder()).build()); - } - - /** - * API name: {@code order} - */ - public final Builder order(@Nullable SortOrder value) { - this.order = value; - return this; - } - - /** - * API name: {@code unmapped_type} - */ - public final Builder unmappedType(@Nullable FieldType value) { - this.unmappedType = value; - return this; - } - - /** - * API name: {@code numeric_type} - */ - public final Builder numericType(@Nullable FieldSortNumericType value) { - this.numericType = value; - return this; - } - - /** - * API name: {@code format} - */ - public final Builder format(@Nullable String value) { - this.format = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link FieldSort}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public FieldSort build() { - _checkSingleUse(); - - return new FieldSort(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link FieldSort} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - FieldSort::setupFieldSortDeserializer); - - protected static void setupFieldSortDeserializer(ObjectDeserializer op) { - - op.add(Builder::missing, FieldValue._DESERIALIZER, "missing"); - op.add(Builder::mode, SortMode._DESERIALIZER, "mode"); - op.add(Builder::nested, NestedSortValue._DESERIALIZER, "nested"); - op.add(Builder::order, SortOrder._DESERIALIZER, "order"); - op.add(Builder::unmappedType, FieldType._DESERIALIZER, "unmapped_type"); - op.add(Builder::numericType, FieldSortNumericType._DESERIALIZER, "numeric_type"); - op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format"); - - op.setKey(Builder::field, JsonpDeserializer.stringDeserializer()); - op.shortcutProperty("order"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSortNumericType.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSortNumericType.java deleted file mode 100644 index a1117ce30..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSortNumericType.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum FieldSortNumericType implements JsonEnum { - Long("long"), - - Double("double"), - - Date("date"), - - DateNanos("date_nanos"), - - ; - - private final String jsonValue; - - FieldSortNumericType(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - FieldSortNumericType.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldValue.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldValue.java deleted file mode 100644 index 289399e10..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldValue.java +++ /dev/null @@ -1,320 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.ObjectBuilderBase; -import co.elastic.clients.util.TaggedUnion; -import co.elastic.clients.util.TaggedUnionUtils; -import jakarta.json.stream.JsonGenerator; -import jakarta.json.stream.JsonParser; - -import java.lang.Boolean; -import java.lang.Double; -import java.lang.Long; -import java.lang.Object; -import java.lang.String; -import java.util.EnumSet; -import java.util.function.Consumer; - -// typedef: _types.FieldValue - -@JsonpDeserializable -public class FieldValue implements TaggedUnion, JsonpSerializable { - - public static FieldValue of(long value) { - return new FieldValue(Kind.Long, value); - } - - public static FieldValue of(double value) { - return new FieldValue(Kind.Double, value); - } - - public static FieldValue of(boolean value) { - return value ? TRUE : FALSE; - } - - public static FieldValue of(String value) { - return new FieldValue(Kind.String, value); - } - - public static FieldValue of(JsonData value) { - return new FieldValue(Kind.Any, value); - } - - public static FieldValue of(Object value) { - return of(JsonData.of(value)); - } - - public static final FieldValue NULL = new FieldValue(Kind.Null, null); - public static final FieldValue TRUE = new FieldValue(Kind.Boolean, Boolean.TRUE); - public static final FieldValue FALSE = new FieldValue(Kind.Boolean, Boolean.FALSE); - - public enum Kind { - Double, Long, Boolean, String, Null, Any - } - - private final Kind _kind; - private final Object _value; - - @Override - public final Kind _kind() { - return _kind; - } - - @Override - public final Object _get() { - return _value; - } - - public String _toJsonString() { - switch (_kind) { - case Double : - return String.valueOf(this.doubleValue()); - case Long : - return String.valueOf(this.longValue()); - case Boolean : - return String.valueOf(this.booleanValue()); - case String : - return this.stringValue(); - case Null : - return "null"; - case Any : - throw new IllegalStateException("Composite field value cannot be formatted as a string"); - - default : - throw new IllegalStateException("Unknown kind " + _kind); - } - } - - private FieldValue(Builder builder) { - this(builder._kind, builder._value); - } - - private FieldValue(Kind kind, Object value) { - this._kind = ApiTypeHelper.requireNonNull(kind, this, ""); - this._value = kind == Kind.Null ? null : ApiTypeHelper.requireNonNull(value, this, ""); - } - - public static FieldValue of(Consumer fn) { - Builder builder = new Builder(); - fn.accept(builder); - return builder.build(); - } - - /** - * Is this variant instance of kind {@code double}? - */ - public boolean isDouble() { - return _kind == Kind.Double; - } - - /** - * Get the {@code double} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code double} kind. - */ - public double doubleValue() { - return TaggedUnionUtils.get(this, Kind.Double); - } - - /** - * Is this variant instance of kind {@code long}? - */ - public boolean isLong() { - return _kind == Kind.Long; - } - - /** - * Get the {@code long} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code long} kind. - */ - public long longValue() { - return TaggedUnionUtils.get(this, Kind.Long); - } - - /** - * Is this variant instance of kind {@code boolean}? - */ - public boolean isBoolean() { - return _kind == Kind.Boolean; - } - - /** - * Get the {@code boolean} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code boolean} kind. - */ - public boolean booleanValue() { - return TaggedUnionUtils.get(this, Kind.Boolean); - } - - /** - * Is this variant instance of kind {@code string}? - */ - public boolean isString() { - return _kind == Kind.String; - } - - /** - * Get the {@code string} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code string} kind. - */ - public String stringValue() { - return TaggedUnionUtils.get(this, Kind.String); - } - - /** - * Is this variant instance of kind {@code any}? - */ - public boolean isAny() { - return _kind == Kind.Any; - } - - /** - * Get the {@code any} variant value, used to represent non-scalar values (i.e. - * objects and arrays) - * - * @throws IllegalStateException - * if the current variant is not of the {@code string} kind. - */ - public JsonData anyValue() { - return TaggedUnionUtils.get(this, Kind.Any); - } - - /** - * Is this variant instance of kind {@code null}? - */ - public boolean isNull() { - return _kind == Kind.Null; - } - - @Override - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - switch (_kind) { - case Double : - generator.write(((Double) this._value)); - break; - case Long : - generator.write(((Long) this._value)); - break; - case Boolean : - generator.write(((Boolean) this._value)); - break; - case String : - generator.write(((String) this._value)); - break; - case Null : - generator.writeNull(); - break; - case Any : - ((JsonData) this._value).serialize(generator, mapper); - break; - } - } - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private Kind _kind; - private Object _value; - - public ObjectBuilder doubleValue(double v) { - this._kind = Kind.Double; - this._value = v; - return this; - } - - public ObjectBuilder longValue(long v) { - this._kind = Kind.Long; - this._value = v; - return this; - } - - public ObjectBuilder booleanValue(boolean v) { - this._kind = Kind.Boolean; - this._value = v; - return this; - } - - public ObjectBuilder stringValue(String v) { - this._kind = Kind.String; - this._value = v; - return this; - } - - public ObjectBuilder anyValue(JsonData v) { - this._kind = Kind.Any; - this._value = v; - return this; - } - - public ObjectBuilder nullValue() { - this._kind = Kind.Null; - this._value = null; - return this; - } - - public FieldValue build() { - _checkSingleUse(); - return new FieldValue(this); - } - } - - public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer - .lazy(() -> JsonpDeserializer.of(EnumSet.of(JsonParser.Event.VALUE_STRING, JsonParser.Event.VALUE_NUMBER, - JsonParser.Event.VALUE_NULL, JsonParser.Event.VALUE_TRUE, JsonParser.Event.VALUE_FALSE, - JsonParser.Event.START_OBJECT, JsonParser.Event.START_ARRAY), (parser, mapper, event) -> { - switch (event) { - case VALUE_NULL : - return NULL; - case VALUE_STRING : - return FieldValue.of(parser.getString()); - case VALUE_TRUE : - return FieldValue.of(true); - case VALUE_FALSE : - return FieldValue.of(false); - case VALUE_NUMBER : - if (parser.isIntegralNumber()) { - return FieldValue.of(parser.getLong()); - } else { - return FieldValue.of(parser.getBigDecimal().doubleValue()); - } - case START_OBJECT : - case START_ARRAY : - return FieldValue.of(JsonData.of(parser.getValue())); - } - return null; - })); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoBounds.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoBounds.java deleted file mode 100644 index 514b2f8b5..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoBounds.java +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.json.UnionDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.ObjectBuilderBase; -import co.elastic.clients.util.TaggedUnion; -import co.elastic.clients.util.TaggedUnionUtils; -import jakarta.json.stream.JsonGenerator; -import java.lang.Object; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.GeoBounds - -/** - * A geo bounding box. It can be represented in various ways: - *

    - *
  • as 4 top/bottom/left/right coordinates
  • - *
  • as 2 top_left / bottom_right points
  • - *
  • as 2 top_right / bottom_left points
  • - *
  • as a WKT bounding box
  • - *
- * - * @see API - * specification - */ -@JsonpDeserializable -public class GeoBounds implements TaggedUnion, JsonpSerializable { - - public enum Kind { - Coords, Tlbr, Trbl, Wkt - - } - - private final Kind _kind; - private final Object _value; - - @Override - public final Kind _kind() { - return _kind; - } - - @Override - public final Object _get() { - return _value; - } - - private GeoBounds(Kind kind, Object value) { - this._kind = kind; - this._value = value; - } - - private GeoBounds(Builder builder) { - - this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); - this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); - - } - - public static GeoBounds of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Is this variant instance of kind {@code coords}? - */ - public boolean isCoords() { - return _kind == Kind.Coords; - } - - /** - * Get the {@code coords} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code coords} kind. - */ - public CoordsGeoBounds coords() { - return TaggedUnionUtils.get(this, Kind.Coords); - } - - /** - * Is this variant instance of kind {@code tlbr}? - */ - public boolean isTlbr() { - return _kind == Kind.Tlbr; - } - - /** - * Get the {@code tlbr} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code tlbr} kind. - */ - public TopLeftBottomRightGeoBounds tlbr() { - return TaggedUnionUtils.get(this, Kind.Tlbr); - } - - /** - * Is this variant instance of kind {@code trbl}? - */ - public boolean isTrbl() { - return _kind == Kind.Trbl; - } - - /** - * Get the {@code trbl} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code trbl} kind. - */ - public TopRightBottomLeftGeoBounds trbl() { - return TaggedUnionUtils.get(this, Kind.Trbl); - } - - /** - * Is this variant instance of kind {@code wkt}? - */ - public boolean isWkt() { - return _kind == Kind.Wkt; - } - - /** - * Get the {@code wkt} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code wkt} kind. - */ - public WktGeoBounds wkt() { - return TaggedUnionUtils.get(this, Kind.Wkt); - } - - @Override - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - if (_value instanceof JsonpSerializable) { - ((JsonpSerializable) _value).serialize(generator, mapper); - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private Kind _kind; - private Object _value; - - public ObjectBuilder coords(CoordsGeoBounds v) { - this._kind = Kind.Coords; - this._value = v; - return this; - } - - public ObjectBuilder coords(Function> fn) { - return this.coords(fn.apply(new CoordsGeoBounds.Builder()).build()); - } - - public ObjectBuilder tlbr(TopLeftBottomRightGeoBounds v) { - this._kind = Kind.Tlbr; - this._value = v; - return this; - } - - public ObjectBuilder tlbr( - Function> fn) { - return this.tlbr(fn.apply(new TopLeftBottomRightGeoBounds.Builder()).build()); - } - - public ObjectBuilder trbl(TopRightBottomLeftGeoBounds v) { - this._kind = Kind.Trbl; - this._value = v; - return this; - } - - public ObjectBuilder trbl( - Function> fn) { - return this.trbl(fn.apply(new TopRightBottomLeftGeoBounds.Builder()).build()); - } - - public ObjectBuilder wkt(WktGeoBounds v) { - this._kind = Kind.Wkt; - this._value = v; - return this; - } - - public ObjectBuilder wkt(Function> fn) { - return this.wkt(fn.apply(new WktGeoBounds.Builder()).build()); - } - - public GeoBounds build() { - _checkSingleUse(); - return new GeoBounds(this); - } - - } - - private static JsonpDeserializer buildGeoBoundsDeserializer() { - return new UnionDeserializer.Builder(GeoBounds::new, false) - .addMember(Kind.Coords, CoordsGeoBounds._DESERIALIZER) - .addMember(Kind.Tlbr, TopLeftBottomRightGeoBounds._DESERIALIZER) - .addMember(Kind.Trbl, TopRightBottomLeftGeoBounds._DESERIALIZER) - .addMember(Kind.Wkt, WktGeoBounds._DESERIALIZER).build(); - } - - public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer - .lazy(GeoBounds::buildGeoBoundsDeserializer); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoBoundsBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoBoundsBuilders.java deleted file mode 100644 index c1b3f2e30..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoBoundsBuilders.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.util.ObjectBuilder; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Builders for {@link GeoBounds} variants. - */ -public class GeoBoundsBuilders { - private GeoBoundsBuilders() { - } - - /** - * Creates a builder for the {@link CoordsGeoBounds coords} {@code GeoBounds} - * variant. - */ - public static CoordsGeoBounds.Builder coords() { - return new CoordsGeoBounds.Builder(); - } - - /** - * Creates a builder for the {@link TopLeftBottomRightGeoBounds tlbr} - * {@code GeoBounds} variant. - */ - public static TopLeftBottomRightGeoBounds.Builder tlbr() { - return new TopLeftBottomRightGeoBounds.Builder(); - } - - /** - * Creates a builder for the {@link TopRightBottomLeftGeoBounds trbl} - * {@code GeoBounds} variant. - */ - public static TopRightBottomLeftGeoBounds.Builder trbl() { - return new TopRightBottomLeftGeoBounds.Builder(); - } - - /** - * Creates a builder for the {@link WktGeoBounds wkt} {@code GeoBounds} variant. - */ - public static WktGeoBounds.Builder wkt() { - return new WktGeoBounds.Builder(); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoDistanceSort.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoDistanceSort.java deleted file mode 100644 index 88626e8cf..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoDistanceSort.java +++ /dev/null @@ -1,386 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.GeoDistanceSort - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class GeoDistanceSort implements SortOptionsVariant, JsonpSerializable { - private final String field; - - private final List location; - - @Nullable - private final SortMode mode; - - @Nullable - private final GeoDistanceType distanceType; - - @Nullable - private final Boolean ignoreUnmapped; - - @Nullable - private final SortOrder order; - - @Nullable - private final DistanceUnit unit; - - @Nullable - private final NestedSortValue nested; - - // --------------------------------------------------------------------------------------------- - - private GeoDistanceSort(Builder builder) { - - this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); - this.location = ApiTypeHelper.unmodifiableRequired(builder.location, this, "location"); - - this.mode = builder.mode; - this.distanceType = builder.distanceType; - this.ignoreUnmapped = builder.ignoreUnmapped; - this.order = builder.order; - this.unit = builder.unit; - this.nested = builder.nested; - - } - - public static GeoDistanceSort of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * SortOptions variant kind. - */ - @Override - public SortOptions.Kind _sortOptionsKind() { - return SortOptions.Kind.GeoDistance; - } - - /** - * Required - - */ - public final String field() { - return this.field; - } - - /** - * Required - - */ - public final List location() { - return this.location; - } - - /** - * API name: {@code mode} - */ - @Nullable - public final SortMode mode() { - return this.mode; - } - - /** - * API name: {@code distance_type} - */ - @Nullable - public final GeoDistanceType distanceType() { - return this.distanceType; - } - - /** - * API name: {@code ignore_unmapped} - */ - @Nullable - public final Boolean ignoreUnmapped() { - return this.ignoreUnmapped; - } - - /** - * API name: {@code order} - */ - @Nullable - public final SortOrder order() { - return this.order; - } - - /** - * API name: {@code unit} - */ - @Nullable - public final DistanceUnit unit() { - return this.unit; - } - - /** - * API name: {@code nested} - */ - @Nullable - public final NestedSortValue nested() { - return this.nested; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - generator.writeKey(this.field); - generator.writeStartArray(); - for (GeoLocation item0 : this.location) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - if (this.mode != null) { - generator.writeKey("mode"); - this.mode.serialize(generator, mapper); - } - if (this.distanceType != null) { - generator.writeKey("distance_type"); - this.distanceType.serialize(generator, mapper); - } - if (this.ignoreUnmapped != null) { - generator.writeKey("ignore_unmapped"); - generator.write(this.ignoreUnmapped); - - } - if (this.order != null) { - generator.writeKey("order"); - this.order.serialize(generator, mapper); - } - if (this.unit != null) { - generator.writeKey("unit"); - this.unit.serialize(generator, mapper); - } - if (this.nested != null) { - generator.writeKey("nested"); - this.nested.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GeoDistanceSort}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String field; - - private List location; - - /** - * Required - - */ - public final Builder field(String value) { - this.field = value; - return this; - } - - /** - * Required - Adds all elements of list to location. - */ - public final Builder location(List list) { - this.location = _listAddAll(this.location, list); - return this; - } - - /** - * Required - Adds one or more values to location. - */ - public final Builder location(GeoLocation value, GeoLocation... values) { - this.location = _listAdd(this.location, value, values); - return this; - } - - /** - * Required - Adds a value to location using a builder lambda. - */ - public final Builder location(Function> fn) { - return location(fn.apply(new GeoLocation.Builder()).build()); - } - - @Nullable - private SortMode mode; - - @Nullable - private GeoDistanceType distanceType; - - @Nullable - private Boolean ignoreUnmapped; - - @Nullable - private SortOrder order; - - @Nullable - private DistanceUnit unit; - - @Nullable - private NestedSortValue nested; - - /** - * API name: {@code mode} - */ - public final Builder mode(@Nullable SortMode value) { - this.mode = value; - return this; - } - - /** - * API name: {@code distance_type} - */ - public final Builder distanceType(@Nullable GeoDistanceType value) { - this.distanceType = value; - return this; - } - - /** - * API name: {@code ignore_unmapped} - */ - public final Builder ignoreUnmapped(@Nullable Boolean value) { - this.ignoreUnmapped = value; - return this; - } - - /** - * API name: {@code order} - */ - public final Builder order(@Nullable SortOrder value) { - this.order = value; - return this; - } - - /** - * API name: {@code unit} - */ - public final Builder unit(@Nullable DistanceUnit value) { - this.unit = value; - return this; - } - - /** - * API name: {@code nested} - */ - public final Builder nested(@Nullable NestedSortValue value) { - this.nested = value; - return this; - } - - /** - * API name: {@code nested} - */ - public final Builder nested(Function> fn) { - return this.nested(fn.apply(new NestedSortValue.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GeoDistanceSort}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GeoDistanceSort build() { - _checkSingleUse(); - - return new GeoDistanceSort(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link GeoDistanceSort} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - GeoDistanceSort::setupGeoDistanceSortDeserializer); - - protected static void setupGeoDistanceSortDeserializer(ObjectDeserializer op) { - - op.add(Builder::mode, SortMode._DESERIALIZER, "mode"); - op.add(Builder::distanceType, GeoDistanceType._DESERIALIZER, "distance_type"); - op.add(Builder::ignoreUnmapped, JsonpDeserializer.booleanDeserializer(), "ignore_unmapped"); - op.add(Builder::order, SortOrder._DESERIALIZER, "order"); - op.add(Builder::unit, DistanceUnit._DESERIALIZER, "unit"); - op.add(Builder::nested, NestedSortValue._DESERIALIZER, "nested"); - - op.setUnknownFieldHandler((builder, name, parser, mapper) -> { - builder.field(name); - builder.location( - JsonpDeserializer.arrayDeserializer(GeoLocation._DESERIALIZER).deserialize(parser, mapper)); - }); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoDistanceType.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoDistanceType.java deleted file mode 100644 index 7bae7004c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoDistanceType.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum GeoDistanceType implements JsonEnum { - /** - * The arc calculation is the most accurate. - */ - Arc("arc"), - - /** - * The plane calculation is faster but less accurate. - */ - Plane("plane"), - - ; - - private final String jsonValue; - - GeoDistanceType(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - GeoDistanceType.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashLocation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashLocation.java deleted file mode 100644 index 262704160..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashLocation.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.GeoHashLocation - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class GeoHashLocation implements JsonpSerializable { - private final String geohash; - - // --------------------------------------------------------------------------------------------- - - private GeoHashLocation(Builder builder) { - - this.geohash = ApiTypeHelper.requireNonNull(builder.geohash, this, "geohash"); - - } - - public static GeoHashLocation of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code geohash} - */ - public final String geohash() { - return this.geohash; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("geohash"); - generator.write(this.geohash); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GeoHashLocation}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String geohash; - - /** - * Required - API name: {@code geohash} - */ - public final Builder geohash(String value) { - this.geohash = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GeoHashLocation}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GeoHashLocation build() { - _checkSingleUse(); - - return new GeoHashLocation(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link GeoHashLocation} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - GeoHashLocation::setupGeoHashLocationDeserializer); - - protected static void setupGeoHashLocationDeserializer(ObjectDeserializer op) { - - op.add(Builder::geohash, JsonpDeserializer.stringDeserializer(), "geohash"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashPrecision.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashPrecision.java deleted file mode 100644 index a0661a79d..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashPrecision.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.json.UnionDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.ObjectBuilderBase; -import co.elastic.clients.util.TaggedUnion; -import co.elastic.clients.util.TaggedUnionUtils; -import jakarta.json.stream.JsonGenerator; -import java.lang.Number; -import java.lang.Object; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.GeoHashPrecision - -/** - * A precision that can be expressed as a geohash length between 1 and 12, or a - * distance measure like "1km", "10m". - * - * @see API - * specification - */ -@JsonpDeserializable -public class GeoHashPrecision implements TaggedUnion, JsonpSerializable { - - public enum Kind { - GeohashLength, Distance - - } - - private final Kind _kind; - private final Object _value; - - @Override - public final Kind _kind() { - return _kind; - } - - @Override - public final Object _get() { - return _value; - } - - private GeoHashPrecision(Kind kind, Object value) { - this._kind = kind; - this._value = value; - } - - public String _toJsonString() { - switch (_kind) { - case GeohashLength : - return this.geohashLength().toString(); - case Distance : - return this.distance(); - - default : - throw new IllegalStateException("Unknown kind " + _kind); - } - } - - private GeoHashPrecision(Builder builder) { - - this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); - this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); - - } - - public static GeoHashPrecision of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Is this variant instance of kind {@code geohash_length}? - */ - public boolean isGeohashLength() { - return _kind == Kind.GeohashLength; - } - - /** - * Get the {@code geohash_length} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code geohash_length} kind. - */ - public Number geohashLength() { - return TaggedUnionUtils.get(this, Kind.GeohashLength); - } - - /** - * Is this variant instance of kind {@code distance}? - */ - public boolean isDistance() { - return _kind == Kind.Distance; - } - - /** - * Get the {@code distance} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code distance} kind. - */ - public String distance() { - return TaggedUnionUtils.get(this, Kind.Distance); - } - - @Override - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - if (_value instanceof JsonpSerializable) { - ((JsonpSerializable) _value).serialize(generator, mapper); - } else { - switch (_kind) { - case GeohashLength : - generator.write(((Number) this._value).doubleValue()); - - break; - case Distance : - generator.write(((String) this._value)); - - break; - } - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private Kind _kind; - private Object _value; - - public ObjectBuilder geohashLength(Number v) { - this._kind = Kind.GeohashLength; - this._value = v; - return this; - } - - public ObjectBuilder distance(String v) { - this._kind = Kind.Distance; - this._value = v; - return this; - } - - public GeoHashPrecision build() { - _checkSingleUse(); - return new GeoHashPrecision(this); - } - - } - - private static JsonpDeserializer buildGeoHashPrecisionDeserializer() { - return new UnionDeserializer.Builder(GeoHashPrecision::new, false) - .addMember(Kind.GeohashLength, JsonpDeserializer.numberDeserializer()) - .addMember(Kind.Distance, JsonpDeserializer.stringDeserializer()).build(); - } - - public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer - .lazy(GeoHashPrecision::buildGeoHashPrecisionDeserializer); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashPrecisionBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashPrecisionBuilders.java deleted file mode 100644 index cb2a78226..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashPrecisionBuilders.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.util.ObjectBuilder; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Builders for {@link GeoHashPrecision} variants. - *

- * Variants geohash_length, distance are not available - * here as they don't have a dedicated class. Use {@link GeoHashPrecision}'s - * builder for these. - * - */ -public class GeoHashPrecisionBuilders { - private GeoHashPrecisionBuilders() { - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLine.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLine.java deleted file mode 100644 index 9c5f892ba..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLine.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Double; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.GeoLine - -/** - * A GeoJson GeoLine. - * - * @see API - * specification - */ -@JsonpDeserializable -public class GeoLine implements JsonpSerializable { - private final String type; - - private final List> coordinates; - - // --------------------------------------------------------------------------------------------- - - private GeoLine(Builder builder) { - - this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); - this.coordinates = ApiTypeHelper.unmodifiableRequired(builder.coordinates, this, "coordinates"); - - } - - public static GeoLine of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Always "LineString" - *

- * API name: {@code type} - */ - public final String type() { - return this.type; - } - - /** - * Required - Array of [lon, lat] coordinates - *

- * API name: {@code coordinates} - */ - public final List> coordinates() { - return this.coordinates; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("type"); - generator.write(this.type); - - if (ApiTypeHelper.isDefined(this.coordinates)) { - generator.writeKey("coordinates"); - generator.writeStartArray(); - for (List item0 : this.coordinates) { - generator.writeStartArray(); - if (item0 != null) { - for (Double item1 : item0) { - generator.write(item1); - - } - } - generator.writeEnd(); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GeoLine}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String type; - - private List> coordinates; - - /** - * Required - Always "LineString" - *

- * API name: {@code type} - */ - public final Builder type(String value) { - this.type = value; - return this; - } - - /** - * Required - Array of [lon, lat] coordinates - *

- * API name: {@code coordinates} - *

- * Adds all elements of list to coordinates. - */ - public final Builder coordinates(List> list) { - this.coordinates = _listAddAll(this.coordinates, list); - return this; - } - - /** - * Required - Array of [lon, lat] coordinates - *

- * API name: {@code coordinates} - *

- * Adds one or more values to coordinates. - */ - public final Builder coordinates(List value, List... values) { - this.coordinates = _listAdd(this.coordinates, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GeoLine}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GeoLine build() { - _checkSingleUse(); - - return new GeoLine(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link GeoLine} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - GeoLine::setupGeoLineDeserializer); - - protected static void setupGeoLineDeserializer(ObjectDeserializer op) { - - op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); - op.add(Builder::coordinates, JsonpDeserializer.arrayDeserializer( - JsonpDeserializer.arrayDeserializer(JsonpDeserializer.doubleDeserializer())), "coordinates"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLocation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLocation.java deleted file mode 100644 index 5b59638a3..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLocation.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.json.UnionDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.ObjectBuilderBase; -import co.elastic.clients.util.TaggedUnion; -import co.elastic.clients.util.TaggedUnionUtils; -import jakarta.json.stream.JsonGenerator; -import java.lang.Double; -import java.lang.Object; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.GeoLocation - -/** - * A latitude/longitude as a 2 dimensional point. It can be represented in - * various ways: - *

    - *
  • as a {lat, long} object
  • - *
  • as a geo hash value
  • - *
  • as a [lon, lat] array
  • - *
  • as a string in "<lat>, <lon>" or WKT - * point formats
  • - *
- * - * @see API - * specification - */ -@JsonpDeserializable -public class GeoLocation implements TaggedUnion, JsonpSerializable { - - public enum Kind { - Coords, Geohash, Latlon, Text - - } - - private final Kind _kind; - private final Object _value; - - @Override - public final Kind _kind() { - return _kind; - } - - @Override - public final Object _get() { - return _value; - } - - private GeoLocation(Kind kind, Object value) { - this._kind = kind; - this._value = value; - } - - private GeoLocation(Builder builder) { - - this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); - this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); - - } - - public static GeoLocation of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Is this variant instance of kind {@code coords}? - */ - public boolean isCoords() { - return _kind == Kind.Coords; - } - - /** - * Get the {@code coords} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code coords} kind. - */ - public List coords() { - return TaggedUnionUtils.get(this, Kind.Coords); - } - - /** - * Is this variant instance of kind {@code geohash}? - */ - public boolean isGeohash() { - return _kind == Kind.Geohash; - } - - /** - * Get the {@code geohash} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code geohash} kind. - */ - public GeoHashLocation geohash() { - return TaggedUnionUtils.get(this, Kind.Geohash); - } - - /** - * Is this variant instance of kind {@code latlon}? - */ - public boolean isLatlon() { - return _kind == Kind.Latlon; - } - - /** - * Get the {@code latlon} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code latlon} kind. - */ - public LatLonGeoLocation latlon() { - return TaggedUnionUtils.get(this, Kind.Latlon); - } - - /** - * Is this variant instance of kind {@code text}? - */ - public boolean isText() { - return _kind == Kind.Text; - } - - /** - * Get the {@code text} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code text} kind. - */ - public String text() { - return TaggedUnionUtils.get(this, Kind.Text); - } - - @Override - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - if (_value instanceof JsonpSerializable) { - ((JsonpSerializable) _value).serialize(generator, mapper); - } else { - switch (_kind) { - case Coords : - generator.writeStartArray(); - for (Double item0 : ((List) this._value)) { - generator.write(item0); - - } - generator.writeEnd(); - - break; - case Text : - generator.write(((String) this._value)); - - break; - } - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private Kind _kind; - private Object _value; - - public ObjectBuilder coords(List v) { - this._kind = Kind.Coords; - this._value = v; - return this; - } - - public ObjectBuilder geohash(GeoHashLocation v) { - this._kind = Kind.Geohash; - this._value = v; - return this; - } - - public ObjectBuilder geohash( - Function> fn) { - return this.geohash(fn.apply(new GeoHashLocation.Builder()).build()); - } - - public ObjectBuilder latlon(LatLonGeoLocation v) { - this._kind = Kind.Latlon; - this._value = v; - return this; - } - - public ObjectBuilder latlon( - Function> fn) { - return this.latlon(fn.apply(new LatLonGeoLocation.Builder()).build()); - } - - public ObjectBuilder text(String v) { - this._kind = Kind.Text; - this._value = v; - return this; - } - - public GeoLocation build() { - _checkSingleUse(); - return new GeoLocation(this); - } - - } - - private static JsonpDeserializer buildGeoLocationDeserializer() { - return new UnionDeserializer.Builder(GeoLocation::new, false) - .addMember(Kind.Coords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.doubleDeserializer())) - .addMember(Kind.Geohash, GeoHashLocation._DESERIALIZER) - .addMember(Kind.Latlon, LatLonGeoLocation._DESERIALIZER) - .addMember(Kind.Text, JsonpDeserializer.stringDeserializer()).build(); - } - - public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer - .lazy(GeoLocation::buildGeoLocationDeserializer); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLocationBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLocationBuilders.java deleted file mode 100644 index 2a6abee76..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLocationBuilders.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.util.ObjectBuilder; -import java.lang.Double; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Builders for {@link GeoLocation} variants. - *

- * Variants coords, text are not available here as - * they don't have a dedicated class. Use {@link GeoLocation}'s builder for - * these. - * - */ -public class GeoLocationBuilders { - private GeoLocationBuilders() { - } - - /** - * Creates a builder for the {@link GeoHashLocation geohash} {@code GeoLocation} - * variant. - */ - public static GeoHashLocation.Builder geohash() { - return new GeoHashLocation.Builder(); - } - - /** - * Creates a builder for the {@link LatLonGeoLocation latlon} - * {@code GeoLocation} variant. - */ - public static LatLonGeoLocation.Builder latlon() { - return new LatLonGeoLocation.Builder(); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoShapeRelation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoShapeRelation.java deleted file mode 100644 index 4e43da4a9..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoShapeRelation.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum GeoShapeRelation implements JsonEnum { - /** - * Return all documents whose geo_shape or geo_point - * field intersects the query geometry. - */ - Intersects("intersects"), - - /** - * Return all documents whose geo_shape or geo_point - * field has nothing in common with the query geometry. - */ - Disjoint("disjoint"), - - /** - * Return all documents whose geo_shape or geo_point - * field is within the query geometry. Line geometries are not supported. - */ - Within("within"), - - /** - * Return all documents whose geo_shape or geo_point - * field contains the query geometry. - */ - Contains("contains"), - - ; - - private final String jsonValue; - - GeoShapeRelation(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - GeoShapeRelation.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/HealthStatus.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/HealthStatus.java deleted file mode 100644 index 60b09e818..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/HealthStatus.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum HealthStatus implements JsonEnum { - /** - * All shards are assigned. - */ - Green("green", "GREEN"), - - /** - * All primary shards are assigned, but one or more replica shards are - * unassigned. If a node in the cluster fails, some data could be unavailable - * until that node is repaired. - */ - Yellow("yellow", "YELLOW"), - - /** - * One or more primary shards are unassigned, so some data is unavailable. This - * can occur briefly during cluster startup as primary shards are assigned. - */ - Red("red", "RED"), - - ; - - private final String jsonValue; - private final String[] aliases; - - HealthStatus(String jsonValue, String... aliases) { - this.jsonValue = jsonValue; - this.aliases = aliases; - } - - public String jsonValue() { - return this.jsonValue; - } - - public String[] aliases() { - return this.aliases; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - HealthStatus.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IBDistribution.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IBDistribution.java deleted file mode 100644 index e8c0f5283..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IBDistribution.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum IBDistribution implements JsonEnum { - Ll("ll"), - - Spl("spl"), - - ; - - private final String jsonValue; - - IBDistribution(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - IBDistribution.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IBLambda.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IBLambda.java deleted file mode 100644 index 1ed99e56e..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IBLambda.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum IBLambda implements JsonEnum { - Df("df"), - - Ttf("ttf"), - - ; - - private final String jsonValue; - - IBLambda(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(IBLambda.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IndicesOptions.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IndicesOptions.java deleted file mode 100644 index 1bb5d1a6b..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IndicesOptions.java +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.IndicesOptions - -/** - * Controls how to deal with unavailable concrete indices (closed or missing), - * how wildcard expressions are expanded to actual indices (all, closed or open - * indices) and how to deal with wildcard expressions that resolve to no - * indices. - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndicesOptions implements JsonpSerializable { - @Nullable - private final Boolean allowNoIndices; - - private final List expandWildcards; - - @Nullable - private final Boolean ignoreUnavailable; - - @Nullable - private final Boolean ignoreThrottled; - - // --------------------------------------------------------------------------------------------- - - private IndicesOptions(Builder builder) { - - this.allowNoIndices = builder.allowNoIndices; - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.ignoreUnavailable = builder.ignoreUnavailable; - this.ignoreThrottled = builder.ignoreThrottled; - - } - - public static IndicesOptions of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If false, the request returns an error if any wildcard expression, index - * alias, or _all value targets only missing or closed indices. - * This behavior applies even if the request targets other open indices. For - * example, a request targeting foo*,bar* returns an error if an - * index starts with foo but no index starts with bar. - *

- * API name: {@code allow_no_indices} - */ - @Nullable - public final Boolean allowNoIndices() { - return this.allowNoIndices; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * If true, missing or closed indices are not included in the response. - *

- * API name: {@code ignore_unavailable} - */ - @Nullable - public final Boolean ignoreUnavailable() { - return this.ignoreUnavailable; - } - - /** - * If true, concrete, expanded or aliased indices are ignored when frozen. - *

- * API name: {@code ignore_throttled} - */ - @Nullable - public final Boolean ignoreThrottled() { - return this.ignoreThrottled; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.allowNoIndices != null) { - generator.writeKey("allow_no_indices"); - generator.write(this.allowNoIndices); - - } - if (ApiTypeHelper.isDefined(this.expandWildcards)) { - generator.writeKey("expand_wildcards"); - generator.writeStartArray(); - for (ExpandWildcard item0 : this.expandWildcards) { - item0.serialize(generator, mapper); - } - generator.writeEnd(); - - } - if (this.ignoreUnavailable != null) { - generator.writeKey("ignore_unavailable"); - generator.write(this.ignoreUnavailable); - - } - if (this.ignoreThrottled != null) { - generator.writeKey("ignore_throttled"); - generator.write(this.ignoreThrottled); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndicesOptions}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private Boolean allowNoIndices; - - @Nullable - private List expandWildcards; - - @Nullable - private Boolean ignoreUnavailable; - - @Nullable - private Boolean ignoreThrottled; - - /** - * If false, the request returns an error if any wildcard expression, index - * alias, or _all value targets only missing or closed indices. - * This behavior applies even if the request targets other open indices. For - * example, a request targeting foo*,bar* returns an error if an - * index starts with foo but no index starts with bar. - *

- * API name: {@code allow_no_indices} - */ - public final Builder allowNoIndices(@Nullable Boolean value) { - this.allowNoIndices = value; - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * If true, missing or closed indices are not included in the response. - *

- * API name: {@code ignore_unavailable} - */ - public final Builder ignoreUnavailable(@Nullable Boolean value) { - this.ignoreUnavailable = value; - return this; - } - - /** - * If true, concrete, expanded or aliased indices are ignored when frozen. - *

- * API name: {@code ignore_throttled} - */ - public final Builder ignoreThrottled(@Nullable Boolean value) { - this.ignoreThrottled = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndicesOptions}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndicesOptions build() { - _checkSingleUse(); - - return new IndicesOptions(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndicesOptions} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - IndicesOptions::setupIndicesOptionsDeserializer); - - protected static void setupIndicesOptionsDeserializer(ObjectDeserializer op) { - - op.add(Builder::allowNoIndices, JsonpDeserializer.booleanDeserializer(), "allow_no_indices"); - op.add(Builder::expandWildcards, JsonpDeserializer.arrayDeserializer(ExpandWildcard._DESERIALIZER), - "expand_wildcards"); - op.add(Builder::ignoreUnavailable, JsonpDeserializer.booleanDeserializer(), "ignore_unavailable"); - op.add(Builder::ignoreThrottled, JsonpDeserializer.booleanDeserializer(), "ignore_throttled"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IndicesResponseBase.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IndicesResponseBase.java deleted file mode 100644 index 3ab0d7365..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IndicesResponseBase.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.IndicesResponseBase - -/** - * - * @see API - * specification - */ - -public abstract class IndicesResponseBase extends AcknowledgedResponseBase { - @Nullable - private final ShardStatistics shards; - - // --------------------------------------------------------------------------------------------- - - protected IndicesResponseBase(AbstractBuilder builder) { - super(builder); - - this.shards = builder.shards; - - } - - /** - * API name: {@code _shards} - */ - @Nullable - public final ShardStatistics shards() { - return this.shards; - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - super.serializeInternal(generator, mapper); - if (this.shards != null) { - generator.writeKey("_shards"); - this.shards.serialize(generator, mapper); - - } - - } - - public abstract static class AbstractBuilder> - extends - AcknowledgedResponseBase.AbstractBuilder { - @Nullable - private ShardStatistics shards; - - /** - * API name: {@code _shards} - */ - public final BuilderT shards(@Nullable ShardStatistics value) { - this.shards = value; - return self(); - } - - /** - * API name: {@code _shards} - */ - public final BuilderT shards(Function> fn) { - return this.shards(fn.apply(new ShardStatistics.Builder()).build()); - } - - } - - // --------------------------------------------------------------------------------------------- - protected static > void setupIndicesResponseBaseDeserializer( - ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - op.add(AbstractBuilder::shards, ShardStatistics._DESERIALIZER, "_shards"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/InlineGet.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/InlineGet.java deleted file mode 100644 index 85e6f102c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/InlineGet.java +++ /dev/null @@ -1,398 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpSerializer; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.NamedDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Long; -import java.lang.String; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.function.Supplier; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.InlineGet - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class InlineGet implements JsonpSerializable { - private final Map metadata; - - private final Map fields; - - private final boolean found; - - @Nullable - private final Long seqNo; - - @Nullable - private final Long primaryTerm; - - @Nullable - private final String routing; - - @Nullable - private final TDocument source; - - @Nullable - private final JsonpSerializer tDocumentSerializer; - - // --------------------------------------------------------------------------------------------- - - private InlineGet(Builder builder) { - - this.metadata = ApiTypeHelper.unmodifiable(builder.metadata); - - this.fields = ApiTypeHelper.unmodifiable(builder.fields); - this.found = ApiTypeHelper.requireNonNull(builder.found, this, "found"); - this.seqNo = builder.seqNo; - this.primaryTerm = builder.primaryTerm; - this.routing = builder.routing; - this.source = builder.source; - this.tDocumentSerializer = builder.tDocumentSerializer; - - } - - public static InlineGet of( - Function, ObjectBuilder>> fn) { - return fn.apply(new Builder<>()).build(); - } - - /** - * Document metadata - */ - public final Map metadata() { - return this.metadata; - } - - /** - * API name: {@code fields} - */ - public final Map fields() { - return this.fields; - } - - /** - * Required - API name: {@code found} - */ - public final boolean found() { - return this.found; - } - - /** - * API name: {@code _seq_no} - */ - @Nullable - public final Long seqNo() { - return this.seqNo; - } - - /** - * API name: {@code _primary_term} - */ - @Nullable - public final Long primaryTerm() { - return this.primaryTerm; - } - - /** - * API name: {@code _routing} - */ - @Nullable - public final String routing() { - return this.routing; - } - - /** - * API name: {@code _source} - */ - @Nullable - public final TDocument source() { - return this.source; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - for (Map.Entry item0 : this.metadata.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - - if (ApiTypeHelper.isDefined(this.fields)) { - generator.writeKey("fields"); - generator.writeStartObject(); - for (Map.Entry item0 : this.fields.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - generator.writeKey("found"); - generator.write(this.found); - - if (this.seqNo != null) { - generator.writeKey("_seq_no"); - generator.write(this.seqNo); - - } - if (this.primaryTerm != null) { - generator.writeKey("_primary_term"); - generator.write(this.primaryTerm); - - } - if (this.routing != null) { - generator.writeKey("_routing"); - generator.write(this.routing); - - } - if (this.source != null) { - generator.writeKey("_source"); - JsonpUtils.serialize(this.source, generator, tDocumentSerializer, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link InlineGet}. - */ - - public static class Builder extends WithJsonObjectBuilderBase> - implements - ObjectBuilder> { - @Nullable - private Map metadata = new HashMap<>(); - - /** - * Document metadata - *

- * Adds all entries of map to metadata. - */ - public final Builder metadata(Map map) { - this.metadata = _mapPutAll(this.metadata, map); - return this; - } - - /** - * Document metadata - *

- * Adds an entry to metadata. - */ - public final Builder metadata(String key, JsonData value) { - this.metadata = _mapPut(this.metadata, key, value); - return this; - } - - @Nullable - private Map fields; - - private Boolean found; - - @Nullable - private Long seqNo; - - @Nullable - private Long primaryTerm; - - @Nullable - private String routing; - - @Nullable - private TDocument source; - - @Nullable - private JsonpSerializer tDocumentSerializer; - - /** - * API name: {@code fields} - *

- * Adds all entries of map to fields. - */ - public final Builder fields(Map map) { - this.fields = _mapPutAll(this.fields, map); - return this; - } - - /** - * API name: {@code fields} - *

- * Adds an entry to fields. - */ - public final Builder fields(String key, JsonData value) { - this.fields = _mapPut(this.fields, key, value); - return this; - } - - /** - * Required - API name: {@code found} - */ - public final Builder found(boolean value) { - this.found = value; - return this; - } - - /** - * API name: {@code _seq_no} - */ - public final Builder seqNo(@Nullable Long value) { - this.seqNo = value; - return this; - } - - /** - * API name: {@code _primary_term} - */ - public final Builder primaryTerm(@Nullable Long value) { - this.primaryTerm = value; - return this; - } - - /** - * API name: {@code _routing} - */ - public final Builder routing(@Nullable String value) { - this.routing = value; - return this; - } - - /** - * API name: {@code _source} - */ - public final Builder source(@Nullable TDocument value) { - this.source = value; - return this; - } - - /** - * Serializer for TDocument. If not set, an attempt will be made to find a - * serializer from the JSON context. - */ - public final Builder tDocumentSerializer(@Nullable JsonpSerializer value) { - this.tDocumentSerializer = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link InlineGet}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public InlineGet build() { - _checkSingleUse(); - - return new InlineGet(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Create a JSON deserializer for InlineGet - */ - public static JsonpDeserializer> createInlineGetDeserializer( - JsonpDeserializer tDocumentDeserializer) { - return ObjectBuilderDeserializer.createForObject((Supplier>) Builder::new, - op -> InlineGet.setupInlineGetDeserializer(op, tDocumentDeserializer)); - }; - - /** - * Json deserializer for {@link InlineGet} based on named deserializers provided - * by the calling {@code JsonMapper}. - */ - public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer - .lazy(() -> createInlineGetDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_types.InlineGet.TDocument"))); - - protected static void setupInlineGetDeserializer(ObjectDeserializer> op, - JsonpDeserializer tDocumentDeserializer) { - - op.add(Builder::fields, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "fields"); - op.add(Builder::found, JsonpDeserializer.booleanDeserializer(), "found"); - op.add(Builder::seqNo, JsonpDeserializer.longDeserializer(), "_seq_no"); - op.add(Builder::primaryTerm, JsonpDeserializer.longDeserializer(), "_primary_term"); - op.add(Builder::routing, JsonpDeserializer.stringDeserializer(), "_routing"); - op.add(Builder::source, tDocumentDeserializer, "_source"); - - op.setUnknownFieldHandler((builder, name, parser, mapper) -> { - builder.metadata(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); - }); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnQuery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnQuery.java deleted file mode 100644 index 66ebb9d8c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnQuery.java +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.elasticsearch._types.query_dsl.Query; -import co.elastic.clients.elasticsearch._types.query_dsl.QueryBase; -import co.elastic.clients.elasticsearch._types.query_dsl.QueryVariant; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Float; -import java.lang.Integer; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.KnnQuery - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class KnnQuery extends QueryBase implements QueryVariant { - private final String field; - - private final List queryVector; - - @Nullable - private final QueryVectorBuilder queryVectorBuilder; - - @Nullable - private final Integer numCandidates; - - @Nullable - private final Integer k; - - private final List filter; - - @Nullable - private final Float similarity; - - // --------------------------------------------------------------------------------------------- - - private KnnQuery(Builder builder) { - super(builder); - - this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); - this.queryVector = ApiTypeHelper.unmodifiable(builder.queryVector); - this.queryVectorBuilder = builder.queryVectorBuilder; - this.numCandidates = builder.numCandidates; - this.k = builder.k; - this.filter = ApiTypeHelper.unmodifiable(builder.filter); - this.similarity = builder.similarity; - - } - - public static KnnQuery of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Query variant kind. - */ - @Override - public Query.Kind _queryKind() { - return Query.Kind.Knn; - } - - /** - * Required - The name of the vector field to search against - *

- * API name: {@code field} - */ - public final String field() { - return this.field; - } - - /** - * The query vector - *

- * API name: {@code query_vector} - */ - public final List queryVector() { - return this.queryVector; - } - - /** - * The query vector builder. You must provide a query_vector_builder or - * query_vector, but not both. - *

- * API name: {@code query_vector_builder} - */ - @Nullable - public final QueryVectorBuilder queryVectorBuilder() { - return this.queryVectorBuilder; - } - - /** - * The number of nearest neighbor candidates to consider per shard - *

- * API name: {@code num_candidates} - */ - @Nullable - public final Integer numCandidates() { - return this.numCandidates; - } - - /** - * The final number of nearest neighbors to return as top hits - *

- * API name: {@code k} - */ - @Nullable - public final Integer k() { - return this.k; - } - - /** - * Filters for the kNN search query - *

- * API name: {@code filter} - */ - public final List filter() { - return this.filter; - } - - /** - * The minimum similarity for a vector to be considered a match - *

- * API name: {@code similarity} - */ - @Nullable - public final Float similarity() { - return this.similarity; - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - super.serializeInternal(generator, mapper); - generator.writeKey("field"); - generator.write(this.field); - - if (ApiTypeHelper.isDefined(this.queryVector)) { - generator.writeKey("query_vector"); - generator.writeStartArray(); - for (Float item0 : this.queryVector) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (this.queryVectorBuilder != null) { - generator.writeKey("query_vector_builder"); - this.queryVectorBuilder.serialize(generator, mapper); - - } - if (this.numCandidates != null) { - generator.writeKey("num_candidates"); - generator.write(this.numCandidates); - - } - if (this.k != null) { - generator.writeKey("k"); - generator.write(this.k); - - } - if (ApiTypeHelper.isDefined(this.filter)) { - generator.writeKey("filter"); - generator.writeStartArray(); - for (Query item0 : this.filter) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.similarity != null) { - generator.writeKey("similarity"); - generator.write(this.similarity); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link KnnQuery}. - */ - - public static class Builder extends QueryBase.AbstractBuilder implements ObjectBuilder { - private String field; - - @Nullable - private List queryVector; - - @Nullable - private QueryVectorBuilder queryVectorBuilder; - - @Nullable - private Integer numCandidates; - - @Nullable - private Integer k; - - @Nullable - private List filter; - - @Nullable - private Float similarity; - - /** - * Required - The name of the vector field to search against - *

- * API name: {@code field} - */ - public final Builder field(String value) { - this.field = value; - return this; - } - - /** - * The query vector - *

- * API name: {@code query_vector} - *

- * Adds all elements of list to queryVector. - */ - public final Builder queryVector(List list) { - this.queryVector = _listAddAll(this.queryVector, list); - return this; - } - - /** - * The query vector - *

- * API name: {@code query_vector} - *

- * Adds one or more values to queryVector. - */ - public final Builder queryVector(Float value, Float... values) { - this.queryVector = _listAdd(this.queryVector, value, values); - return this; - } - - /** - * The query vector builder. You must provide a query_vector_builder or - * query_vector, but not both. - *

- * API name: {@code query_vector_builder} - */ - public final Builder queryVectorBuilder(@Nullable QueryVectorBuilder value) { - this.queryVectorBuilder = value; - return this; - } - - /** - * The query vector builder. You must provide a query_vector_builder or - * query_vector, but not both. - *

- * API name: {@code query_vector_builder} - */ - public final Builder queryVectorBuilder( - Function> fn) { - return this.queryVectorBuilder(fn.apply(new QueryVectorBuilder.Builder()).build()); - } - - /** - * The number of nearest neighbor candidates to consider per shard - *

- * API name: {@code num_candidates} - */ - public final Builder numCandidates(@Nullable Integer value) { - this.numCandidates = value; - return this; - } - - /** - * The final number of nearest neighbors to return as top hits - *

- * API name: {@code k} - */ - public final Builder k(@Nullable Integer value) { - this.k = value; - return this; - } - - /** - * Filters for the kNN search query - *

- * API name: {@code filter} - *

- * Adds all elements of list to filter. - */ - public final Builder filter(List list) { - this.filter = _listAddAll(this.filter, list); - return this; - } - - /** - * Filters for the kNN search query - *

- * API name: {@code filter} - *

- * Adds one or more values to filter. - */ - public final Builder filter(Query value, Query... values) { - this.filter = _listAdd(this.filter, value, values); - return this; - } - - /** - * Filters for the kNN search query - *

- * API name: {@code filter} - *

- * Adds a value to filter using a builder lambda. - */ - public final Builder filter(Function> fn) { - return filter(fn.apply(new Query.Builder()).build()); - } - - /** - * The minimum similarity for a vector to be considered a match - *

- * API name: {@code similarity} - */ - public final Builder similarity(@Nullable Float value) { - this.similarity = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link KnnQuery}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public KnnQuery build() { - _checkSingleUse(); - - return new KnnQuery(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link KnnQuery} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - KnnQuery::setupKnnQueryDeserializer); - - protected static void setupKnnQueryDeserializer(ObjectDeserializer op) { - QueryBase.setupQueryBaseDeserializer(op); - op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); - op.add(Builder::queryVector, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.floatDeserializer()), - "query_vector"); - op.add(Builder::queryVectorBuilder, QueryVectorBuilder._DESERIALIZER, "query_vector_builder"); - op.add(Builder::numCandidates, JsonpDeserializer.integerDeserializer(), "num_candidates"); - op.add(Builder::k, JsonpDeserializer.integerDeserializer(), "k"); - op.add(Builder::filter, JsonpDeserializer.arrayDeserializer(Query._DESERIALIZER), "filter"); - op.add(Builder::similarity, JsonpDeserializer.floatDeserializer(), "similarity"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnRetriever.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnRetriever.java deleted file mode 100644 index ab29ddb82..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnRetriever.java +++ /dev/null @@ -1,343 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Float; -import java.lang.Integer; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.KnnRetriever - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class KnnRetriever extends RetrieverBase implements RetrieverVariant { - private final String field; - - private final List queryVector; - - @Nullable - private final QueryVectorBuilder queryVectorBuilder; - - private final int k; - - private final int numCandidates; - - @Nullable - private final Float similarity; - - // --------------------------------------------------------------------------------------------- - - private KnnRetriever(Builder builder) { - super(builder); - - this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); - this.queryVector = ApiTypeHelper.unmodifiable(builder.queryVector); - this.queryVectorBuilder = builder.queryVectorBuilder; - this.k = ApiTypeHelper.requireNonNull(builder.k, this, "k"); - this.numCandidates = ApiTypeHelper.requireNonNull(builder.numCandidates, this, "numCandidates"); - this.similarity = builder.similarity; - - } - - public static KnnRetriever of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Retriever variant kind. - */ - @Override - public Retriever.Kind _retrieverKind() { - return Retriever.Kind.Knn; - } - - /** - * Required - The name of the vector field to search against. - *

- * API name: {@code field} - */ - public final String field() { - return this.field; - } - - /** - * Query vector. Must have the same number of dimensions as the vector field you - * are searching against. You must provide a query_vector_builder or - * query_vector, but not both. - *

- * API name: {@code query_vector} - */ - public final List queryVector() { - return this.queryVector; - } - - /** - * Defines a model to build a query vector. - *

- * API name: {@code query_vector_builder} - */ - @Nullable - public final QueryVectorBuilder queryVectorBuilder() { - return this.queryVectorBuilder; - } - - /** - * Required - Number of nearest neighbors to return as top hits. - *

- * API name: {@code k} - */ - public final int k() { - return this.k; - } - - /** - * Required - Number of nearest neighbor candidates to consider per shard. - *

- * API name: {@code num_candidates} - */ - public final int numCandidates() { - return this.numCandidates; - } - - /** - * The minimum similarity required for a document to be considered a match. - *

- * API name: {@code similarity} - */ - @Nullable - public final Float similarity() { - return this.similarity; - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - super.serializeInternal(generator, mapper); - generator.writeKey("field"); - generator.write(this.field); - - if (ApiTypeHelper.isDefined(this.queryVector)) { - generator.writeKey("query_vector"); - generator.writeStartArray(); - for (Float item0 : this.queryVector) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (this.queryVectorBuilder != null) { - generator.writeKey("query_vector_builder"); - this.queryVectorBuilder.serialize(generator, mapper); - - } - generator.writeKey("k"); - generator.write(this.k); - - generator.writeKey("num_candidates"); - generator.write(this.numCandidates); - - if (this.similarity != null) { - generator.writeKey("similarity"); - generator.write(this.similarity); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link KnnRetriever}. - */ - - public static class Builder extends RetrieverBase.AbstractBuilder implements ObjectBuilder { - private String field; - - @Nullable - private List queryVector; - - @Nullable - private QueryVectorBuilder queryVectorBuilder; - - private Integer k; - - private Integer numCandidates; - - @Nullable - private Float similarity; - - /** - * Required - The name of the vector field to search against. - *

- * API name: {@code field} - */ - public final Builder field(String value) { - this.field = value; - return this; - } - - /** - * Query vector. Must have the same number of dimensions as the vector field you - * are searching against. You must provide a query_vector_builder or - * query_vector, but not both. - *

- * API name: {@code query_vector} - *

- * Adds all elements of list to queryVector. - */ - public final Builder queryVector(List list) { - this.queryVector = _listAddAll(this.queryVector, list); - return this; - } - - /** - * Query vector. Must have the same number of dimensions as the vector field you - * are searching against. You must provide a query_vector_builder or - * query_vector, but not both. - *

- * API name: {@code query_vector} - *

- * Adds one or more values to queryVector. - */ - public final Builder queryVector(Float value, Float... values) { - this.queryVector = _listAdd(this.queryVector, value, values); - return this; - } - - /** - * Defines a model to build a query vector. - *

- * API name: {@code query_vector_builder} - */ - public final Builder queryVectorBuilder(@Nullable QueryVectorBuilder value) { - this.queryVectorBuilder = value; - return this; - } - - /** - * Defines a model to build a query vector. - *

- * API name: {@code query_vector_builder} - */ - public final Builder queryVectorBuilder( - Function> fn) { - return this.queryVectorBuilder(fn.apply(new QueryVectorBuilder.Builder()).build()); - } - - /** - * Required - Number of nearest neighbors to return as top hits. - *

- * API name: {@code k} - */ - public final Builder k(int value) { - this.k = value; - return this; - } - - /** - * Required - Number of nearest neighbor candidates to consider per shard. - *

- * API name: {@code num_candidates} - */ - public final Builder numCandidates(int value) { - this.numCandidates = value; - return this; - } - - /** - * The minimum similarity required for a document to be considered a match. - *

- * API name: {@code similarity} - */ - public final Builder similarity(@Nullable Float value) { - this.similarity = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link KnnRetriever}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public KnnRetriever build() { - _checkSingleUse(); - - return new KnnRetriever(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link KnnRetriever} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - KnnRetriever::setupKnnRetrieverDeserializer); - - protected static void setupKnnRetrieverDeserializer(ObjectDeserializer op) { - RetrieverBase.setupRetrieverBaseDeserializer(op); - op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); - op.add(Builder::queryVector, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.floatDeserializer()), - "query_vector"); - op.add(Builder::queryVectorBuilder, QueryVectorBuilder._DESERIALIZER, "query_vector_builder"); - op.add(Builder::k, JsonpDeserializer.integerDeserializer(), "k"); - op.add(Builder::numCandidates, JsonpDeserializer.integerDeserializer(), "num_candidates"); - op.add(Builder::similarity, JsonpDeserializer.floatDeserializer(), "similarity"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnSearch.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnSearch.java deleted file mode 100644 index 3a1184c25..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnSearch.java +++ /dev/null @@ -1,495 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.elasticsearch._types.query_dsl.Query; -import co.elastic.clients.elasticsearch.core.search.InnerHits; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Float; -import java.lang.Integer; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.KnnSearch - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class KnnSearch implements JsonpSerializable { - private final String field; - - private final List queryVector; - - @Nullable - private final QueryVectorBuilder queryVectorBuilder; - - @Nullable - private final Integer k; - - @Nullable - private final Integer numCandidates; - - @Nullable - private final Float boost; - - private final List filter; - - @Nullable - private final Float similarity; - - @Nullable - private final InnerHits innerHits; - - // --------------------------------------------------------------------------------------------- - - private KnnSearch(Builder builder) { - - this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); - this.queryVector = ApiTypeHelper.unmodifiable(builder.queryVector); - this.queryVectorBuilder = builder.queryVectorBuilder; - this.k = builder.k; - this.numCandidates = builder.numCandidates; - this.boost = builder.boost; - this.filter = ApiTypeHelper.unmodifiable(builder.filter); - this.similarity = builder.similarity; - this.innerHits = builder.innerHits; - - } - - public static KnnSearch of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - The name of the vector field to search against - *

- * API name: {@code field} - */ - public final String field() { - return this.field; - } - - /** - * The query vector - *

- * API name: {@code query_vector} - */ - public final List queryVector() { - return this.queryVector; - } - - /** - * The query vector builder. You must provide a query_vector_builder or - * query_vector, but not both. - *

- * API name: {@code query_vector_builder} - */ - @Nullable - public final QueryVectorBuilder queryVectorBuilder() { - return this.queryVectorBuilder; - } - - /** - * The final number of nearest neighbors to return as top hits - *

- * API name: {@code k} - */ - @Nullable - public final Integer k() { - return this.k; - } - - /** - * The number of nearest neighbor candidates to consider per shard - *

- * API name: {@code num_candidates} - */ - @Nullable - public final Integer numCandidates() { - return this.numCandidates; - } - - /** - * Boost value to apply to kNN scores - *

- * API name: {@code boost} - */ - @Nullable - public final Float boost() { - return this.boost; - } - - /** - * Filters for the kNN search query - *

- * API name: {@code filter} - */ - public final List filter() { - return this.filter; - } - - /** - * The minimum similarity for a vector to be considered a match - *

- * API name: {@code similarity} - */ - @Nullable - public final Float similarity() { - return this.similarity; - } - - /** - * If defined, each search hit will contain inner hits. - *

- * API name: {@code inner_hits} - */ - @Nullable - public final InnerHits innerHits() { - return this.innerHits; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("field"); - generator.write(this.field); - - if (ApiTypeHelper.isDefined(this.queryVector)) { - generator.writeKey("query_vector"); - generator.writeStartArray(); - for (Float item0 : this.queryVector) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (this.queryVectorBuilder != null) { - generator.writeKey("query_vector_builder"); - this.queryVectorBuilder.serialize(generator, mapper); - - } - if (this.k != null) { - generator.writeKey("k"); - generator.write(this.k); - - } - if (this.numCandidates != null) { - generator.writeKey("num_candidates"); - generator.write(this.numCandidates); - - } - if (this.boost != null) { - generator.writeKey("boost"); - generator.write(this.boost); - - } - if (ApiTypeHelper.isDefined(this.filter)) { - generator.writeKey("filter"); - generator.writeStartArray(); - for (Query item0 : this.filter) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.similarity != null) { - generator.writeKey("similarity"); - generator.write(this.similarity); - - } - if (this.innerHits != null) { - generator.writeKey("inner_hits"); - this.innerHits.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link KnnSearch}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String field; - - @Nullable - private List queryVector; - - @Nullable - private QueryVectorBuilder queryVectorBuilder; - - @Nullable - private Integer k; - - @Nullable - private Integer numCandidates; - - @Nullable - private Float boost; - - @Nullable - private List filter; - - @Nullable - private Float similarity; - - @Nullable - private InnerHits innerHits; - - /** - * Required - The name of the vector field to search against - *

- * API name: {@code field} - */ - public final Builder field(String value) { - this.field = value; - return this; - } - - /** - * The query vector - *

- * API name: {@code query_vector} - *

- * Adds all elements of list to queryVector. - */ - public final Builder queryVector(List list) { - this.queryVector = _listAddAll(this.queryVector, list); - return this; - } - - /** - * The query vector - *

- * API name: {@code query_vector} - *

- * Adds one or more values to queryVector. - */ - public final Builder queryVector(Float value, Float... values) { - this.queryVector = _listAdd(this.queryVector, value, values); - return this; - } - - /** - * The query vector builder. You must provide a query_vector_builder or - * query_vector, but not both. - *

- * API name: {@code query_vector_builder} - */ - public final Builder queryVectorBuilder(@Nullable QueryVectorBuilder value) { - this.queryVectorBuilder = value; - return this; - } - - /** - * The query vector builder. You must provide a query_vector_builder or - * query_vector, but not both. - *

- * API name: {@code query_vector_builder} - */ - public final Builder queryVectorBuilder( - Function> fn) { - return this.queryVectorBuilder(fn.apply(new QueryVectorBuilder.Builder()).build()); - } - - /** - * The final number of nearest neighbors to return as top hits - *

- * API name: {@code k} - */ - public final Builder k(@Nullable Integer value) { - this.k = value; - return this; - } - - /** - * The number of nearest neighbor candidates to consider per shard - *

- * API name: {@code num_candidates} - */ - public final Builder numCandidates(@Nullable Integer value) { - this.numCandidates = value; - return this; - } - - /** - * Boost value to apply to kNN scores - *

- * API name: {@code boost} - */ - public final Builder boost(@Nullable Float value) { - this.boost = value; - return this; - } - - /** - * Filters for the kNN search query - *

- * API name: {@code filter} - *

- * Adds all elements of list to filter. - */ - public final Builder filter(List list) { - this.filter = _listAddAll(this.filter, list); - return this; - } - - /** - * Filters for the kNN search query - *

- * API name: {@code filter} - *

- * Adds one or more values to filter. - */ - public final Builder filter(Query value, Query... values) { - this.filter = _listAdd(this.filter, value, values); - return this; - } - - /** - * Filters for the kNN search query - *

- * API name: {@code filter} - *

- * Adds a value to filter using a builder lambda. - */ - public final Builder filter(Function> fn) { - return filter(fn.apply(new Query.Builder()).build()); - } - - /** - * The minimum similarity for a vector to be considered a match - *

- * API name: {@code similarity} - */ - public final Builder similarity(@Nullable Float value) { - this.similarity = value; - return this; - } - - /** - * If defined, each search hit will contain inner hits. - *

- * API name: {@code inner_hits} - */ - public final Builder innerHits(@Nullable InnerHits value) { - this.innerHits = value; - return this; - } - - /** - * If defined, each search hit will contain inner hits. - *

- * API name: {@code inner_hits} - */ - public final Builder innerHits(Function> fn) { - return this.innerHits(fn.apply(new InnerHits.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link KnnSearch}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public KnnSearch build() { - _checkSingleUse(); - - return new KnnSearch(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link KnnSearch} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - KnnSearch::setupKnnSearchDeserializer); - - protected static void setupKnnSearchDeserializer(ObjectDeserializer op) { - - op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); - op.add(Builder::queryVector, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.floatDeserializer()), - "query_vector"); - op.add(Builder::queryVectorBuilder, QueryVectorBuilder._DESERIALIZER, "query_vector_builder"); - op.add(Builder::k, JsonpDeserializer.integerDeserializer(), "k"); - op.add(Builder::numCandidates, JsonpDeserializer.integerDeserializer(), "num_candidates"); - op.add(Builder::boost, JsonpDeserializer.floatDeserializer(), "boost"); - op.add(Builder::filter, JsonpDeserializer.arrayDeserializer(Query._DESERIALIZER), "filter"); - op.add(Builder::similarity, JsonpDeserializer.floatDeserializer(), "similarity"); - op.add(Builder::innerHits, InnerHits._DESERIALIZER, "inner_hits"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/LatLonGeoLocation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/LatLonGeoLocation.java deleted file mode 100644 index a291a5622..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/LatLonGeoLocation.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Double; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.LatLonGeoLocation - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class LatLonGeoLocation implements JsonpSerializable { - private final double lat; - - private final double lon; - - // --------------------------------------------------------------------------------------------- - - private LatLonGeoLocation(Builder builder) { - - this.lat = ApiTypeHelper.requireNonNull(builder.lat, this, "lat"); - this.lon = ApiTypeHelper.requireNonNull(builder.lon, this, "lon"); - - } - - public static LatLonGeoLocation of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Latitude - *

- * API name: {@code lat} - */ - public final double lat() { - return this.lat; - } - - /** - * Required - Longitude - *

- * API name: {@code lon} - */ - public final double lon() { - return this.lon; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("lat"); - generator.write(this.lat); - - generator.writeKey("lon"); - generator.write(this.lon); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link LatLonGeoLocation}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Double lat; - - private Double lon; - - /** - * Required - Latitude - *

- * API name: {@code lat} - */ - public final Builder lat(double value) { - this.lat = value; - return this; - } - - /** - * Required - Longitude - *

- * API name: {@code lon} - */ - public final Builder lon(double value) { - this.lon = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link LatLonGeoLocation}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public LatLonGeoLocation build() { - _checkSingleUse(); - - return new LatLonGeoLocation(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link LatLonGeoLocation} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, LatLonGeoLocation::setupLatLonGeoLocationDeserializer); - - protected static void setupLatLonGeoLocationDeserializer(ObjectDeserializer op) { - - op.add(Builder::lat, JsonpDeserializer.doubleDeserializer(), "lat"); - op.add(Builder::lon, JsonpDeserializer.doubleDeserializer(), "lon"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/NestedSortValue.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/NestedSortValue.java deleted file mode 100644 index 32c09c21a..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/NestedSortValue.java +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.elasticsearch._types.query_dsl.Query; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.NestedSortValue - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class NestedSortValue implements JsonpSerializable { - @Nullable - private final Query filter; - - @Nullable - private final Integer maxChildren; - - @Nullable - private final NestedSortValue nested; - - private final String path; - - // --------------------------------------------------------------------------------------------- - - private NestedSortValue(Builder builder) { - - this.filter = builder.filter; - this.maxChildren = builder.maxChildren; - this.nested = builder.nested; - this.path = ApiTypeHelper.requireNonNull(builder.path, this, "path"); - - } - - public static NestedSortValue of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code filter} - */ - @Nullable - public final Query filter() { - return this.filter; - } - - /** - * API name: {@code max_children} - */ - @Nullable - public final Integer maxChildren() { - return this.maxChildren; - } - - /** - * API name: {@code nested} - */ - @Nullable - public final NestedSortValue nested() { - return this.nested; - } - - /** - * Required - API name: {@code path} - */ - public final String path() { - return this.path; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.filter != null) { - generator.writeKey("filter"); - this.filter.serialize(generator, mapper); - - } - if (this.maxChildren != null) { - generator.writeKey("max_children"); - generator.write(this.maxChildren); - - } - if (this.nested != null) { - generator.writeKey("nested"); - this.nested.serialize(generator, mapper); - - } - generator.writeKey("path"); - generator.write(this.path); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link NestedSortValue}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private Query filter; - - @Nullable - private Integer maxChildren; - - @Nullable - private NestedSortValue nested; - - private String path; - - /** - * API name: {@code filter} - */ - public final Builder filter(@Nullable Query value) { - this.filter = value; - return this; - } - - /** - * API name: {@code filter} - */ - public final Builder filter(Function> fn) { - return this.filter(fn.apply(new Query.Builder()).build()); - } - - /** - * API name: {@code max_children} - */ - public final Builder maxChildren(@Nullable Integer value) { - this.maxChildren = value; - return this; - } - - /** - * API name: {@code nested} - */ - public final Builder nested(@Nullable NestedSortValue value) { - this.nested = value; - return this; - } - - /** - * API name: {@code nested} - */ - public final Builder nested(Function> fn) { - return this.nested(fn.apply(new NestedSortValue.Builder()).build()); - } - - /** - * Required - API name: {@code path} - */ - public final Builder path(String value) { - this.path = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link NestedSortValue}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public NestedSortValue build() { - _checkSingleUse(); - - return new NestedSortValue(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link NestedSortValue} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - NestedSortValue::setupNestedSortValueDeserializer); - - protected static void setupNestedSortValueDeserializer(ObjectDeserializer op) { - - op.add(Builder::filter, Query._DESERIALIZER, "filter"); - op.add(Builder::maxChildren, JsonpDeserializer.integerDeserializer(), "max_children"); - op.add(Builder::nested, NestedSortValue._DESERIALIZER, "nested"); - op.add(Builder::path, JsonpDeserializer.stringDeserializer(), "path"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Normalization.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Normalization.java deleted file mode 100644 index 9531b9b02..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Normalization.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum Normalization implements JsonEnum { - No("no"), - - H1("h1"), - - H2("h2"), - - H3("h3"), - - Z("z"), - - ; - - private final String jsonValue; - - Normalization(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - Normalization.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/OpType.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/OpType.java deleted file mode 100644 index 563769454..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/OpType.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API specification - */ -@JsonpDeserializable -public enum OpType implements JsonEnum { - /** - * Overwrite any documents that already exist. - */ - Index("index"), - - /** - * Only index documents that do not already exist. - */ - Create("create"), - - ; - - private final String jsonValue; - - OpType(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(OpType.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilder.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilder.java deleted file mode 100644 index 808b04c57..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilder.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.TaggedUnion; -import co.elastic.clients.util.TaggedUnionUtils; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Object; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.QueryVectorBuilder - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class QueryVectorBuilder implements TaggedUnion, JsonpSerializable { - - /** - * {@link QueryVectorBuilder} variant kinds. - * - * @see API - * specification - */ - - public enum Kind implements JsonEnum { - TextEmbedding("text_embedding"), - - ; - - private final String jsonValue; - - Kind(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - } - - private final Kind _kind; - private final Object _value; - - @Override - public final Kind _kind() { - return _kind; - } - - @Override - public final Object _get() { - return _value; - } - - public QueryVectorBuilder(QueryVectorBuilderVariant value) { - - this._kind = ApiTypeHelper.requireNonNull(value._queryVectorBuilderKind(), this, ""); - this._value = ApiTypeHelper.requireNonNull(value, this, ""); - - } - - private QueryVectorBuilder(Builder builder) { - - this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); - this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); - - } - - public static QueryVectorBuilder of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Is this variant instance of kind {@code text_embedding}? - */ - public boolean isTextEmbedding() { - return _kind == Kind.TextEmbedding; - } - - /** - * Get the {@code text_embedding} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code text_embedding} kind. - */ - public TextEmbedding textEmbedding() { - return TaggedUnionUtils.get(this, Kind.TextEmbedding); - } - - @Override - @SuppressWarnings("unchecked") - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeStartObject(); - - generator.writeKey(_kind.jsonValue()); - if (_value instanceof JsonpSerializable) { - ((JsonpSerializable) _value).serialize(generator, mapper); - } - - generator.writeEnd(); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private Kind _kind; - private Object _value; - - @Override - protected Builder self() { - return this; - } - public ObjectBuilder textEmbedding(TextEmbedding v) { - this._kind = Kind.TextEmbedding; - this._value = v; - return this; - } - - public ObjectBuilder textEmbedding( - Function> fn) { - return this.textEmbedding(fn.apply(new TextEmbedding.Builder()).build()); - } - - public QueryVectorBuilder build() { - _checkSingleUse(); - return new QueryVectorBuilder(this); - } - - } - - protected static void setupQueryVectorBuilderDeserializer(ObjectDeserializer op) { - - op.add(Builder::textEmbedding, TextEmbedding._DESERIALIZER, "text_embedding"); - - } - - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, QueryVectorBuilder::setupQueryVectorBuilderDeserializer, Builder::build); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilderBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilderBuilders.java deleted file mode 100644 index 521debc0c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilderBuilders.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.util.ObjectBuilder; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Builders for {@link QueryVectorBuilder} variants. - */ -public class QueryVectorBuilderBuilders { - private QueryVectorBuilderBuilders() { - } - - /** - * Creates a builder for the {@link TextEmbedding text_embedding} - * {@code QueryVectorBuilder} variant. - */ - public static TextEmbedding.Builder textEmbedding() { - return new TextEmbedding.Builder(); - } - - /** - * Creates a QueryVectorBuilder of the {@link TextEmbedding text_embedding} - * {@code QueryVectorBuilder} variant. - */ - public static QueryVectorBuilder textEmbedding(Function> fn) { - QueryVectorBuilder.Builder builder = new QueryVectorBuilder.Builder(); - builder.textEmbedding(fn.apply(new TextEmbedding.Builder()).build()); - return builder.build(); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilderVariant.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilderVariant.java deleted file mode 100644 index ac17ab51e..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilderVariant.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Base interface for {@link QueryVectorBuilder} variants. - */ -public interface QueryVectorBuilderVariant { - - QueryVectorBuilder.Kind _queryVectorBuilderKind(); - - default QueryVectorBuilder _toQueryVectorBuilder() { - return new QueryVectorBuilder(this); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RRFRetriever.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RRFRetriever.java deleted file mode 100644 index a828554de..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RRFRetriever.java +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.RRFRetriever - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class RRFRetriever extends RetrieverBase implements RetrieverVariant { - private final List retrievers; - - @Nullable - private final Integer rankConstant; - - @Nullable - private final Integer rankWindowSize; - - // --------------------------------------------------------------------------------------------- - - private RRFRetriever(Builder builder) { - super(builder); - - this.retrievers = ApiTypeHelper.unmodifiableRequired(builder.retrievers, this, "retrievers"); - this.rankConstant = builder.rankConstant; - this.rankWindowSize = builder.rankWindowSize; - - } - - public static RRFRetriever of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Retriever variant kind. - */ - @Override - public Retriever.Kind _retrieverKind() { - return Retriever.Kind.Rrf; - } - - /** - * Required - A list of child retrievers to specify which sets of returned top - * documents will have the RRF formula applied to them. - *

- * API name: {@code retrievers} - */ - public final List retrievers() { - return this.retrievers; - } - - /** - * This value determines how much influence documents in individual result sets - * per query have over the final ranked result set. - *

- * API name: {@code rank_constant} - */ - @Nullable - public final Integer rankConstant() { - return this.rankConstant; - } - - /** - * This value determines the size of the individual result sets per query. - *

- * API name: {@code rank_window_size} - */ - @Nullable - public final Integer rankWindowSize() { - return this.rankWindowSize; - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - super.serializeInternal(generator, mapper); - if (ApiTypeHelper.isDefined(this.retrievers)) { - generator.writeKey("retrievers"); - generator.writeStartArray(); - for (Retriever item0 : this.retrievers) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.rankConstant != null) { - generator.writeKey("rank_constant"); - generator.write(this.rankConstant); - - } - if (this.rankWindowSize != null) { - generator.writeKey("rank_window_size"); - generator.write(this.rankWindowSize); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link RRFRetriever}. - */ - - public static class Builder extends RetrieverBase.AbstractBuilder implements ObjectBuilder { - private List retrievers; - - @Nullable - private Integer rankConstant; - - @Nullable - private Integer rankWindowSize; - - /** - * Required - A list of child retrievers to specify which sets of returned top - * documents will have the RRF formula applied to them. - *

- * API name: {@code retrievers} - *

- * Adds all elements of list to retrievers. - */ - public final Builder retrievers(List list) { - this.retrievers = _listAddAll(this.retrievers, list); - return this; - } - - /** - * Required - A list of child retrievers to specify which sets of returned top - * documents will have the RRF formula applied to them. - *

- * API name: {@code retrievers} - *

- * Adds one or more values to retrievers. - */ - public final Builder retrievers(Retriever value, Retriever... values) { - this.retrievers = _listAdd(this.retrievers, value, values); - return this; - } - - /** - * Required - A list of child retrievers to specify which sets of returned top - * documents will have the RRF formula applied to them. - *

- * API name: {@code retrievers} - *

- * Adds a value to retrievers using a builder lambda. - */ - public final Builder retrievers(Function> fn) { - return retrievers(fn.apply(new Retriever.Builder()).build()); - } - - /** - * This value determines how much influence documents in individual result sets - * per query have over the final ranked result set. - *

- * API name: {@code rank_constant} - */ - public final Builder rankConstant(@Nullable Integer value) { - this.rankConstant = value; - return this; - } - - /** - * This value determines the size of the individual result sets per query. - *

- * API name: {@code rank_window_size} - */ - public final Builder rankWindowSize(@Nullable Integer value) { - this.rankWindowSize = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link RRFRetriever}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public RRFRetriever build() { - _checkSingleUse(); - - return new RRFRetriever(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link RRFRetriever} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - RRFRetriever::setupRRFRetrieverDeserializer); - - protected static void setupRRFRetrieverDeserializer(ObjectDeserializer op) { - RetrieverBase.setupRetrieverBaseDeserializer(op); - op.add(Builder::retrievers, JsonpDeserializer.arrayDeserializer(Retriever._DESERIALIZER), "retrievers"); - op.add(Builder::rankConstant, JsonpDeserializer.integerDeserializer(), "rank_constant"); - op.add(Builder::rankWindowSize, JsonpDeserializer.integerDeserializer(), "rank_window_size"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Refresh.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Refresh.java deleted file mode 100644 index 3543cfa5e..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Refresh.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import jakarta.json.stream.JsonGenerator; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum Refresh implements JsonEnum { - True("true"), - - False("false"), - - WaitFor("wait_for"), - - ; - - private final String jsonValue; - - Refresh(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - @Override - public void serialize(JsonGenerator generator, JsonpMapper params) { - if (this == Refresh.True) { - generator.write(true); - } else if (this == Refresh.False) { - generator.write(false); - } else { - generator.write(jsonValue()); - } - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer.AllowingBooleans<>( - Refresh.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RequestBase.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RequestBase.java deleted file mode 100644 index 81ae1f3f7..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RequestBase.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.util.Map; -import java.util.Objects; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.RequestBase - -/** - * - * @see API - * specification - */ - -public abstract class RequestBase { - public RequestBase() { - } - - public abstract static class AbstractBuilder> - extends - WithJsonObjectBuilderBase { - protected abstract BuilderT self(); - - } - - @Override - public String toString() { - - StringBuilder sb = new StringBuilder(this.getClass().getSimpleName()).append(": "); - - try { - @SuppressWarnings("unchecked") - Endpoint endpoint = (Endpoint) this.getClass() - .getDeclaredField("_ENDPOINT").get(null); - - sb.append(endpoint.method(this)).append(" ").append(endpoint.requestUrl(this)); - - Map params = endpoint.queryParameters(this); - String delim = "?"; - for (Map.Entry param : params.entrySet()) { - sb.append(delim); - delim = "&"; - sb.append(param.getKey()).append("=").append(URLEncoder.encode(param.getValue(), "UTF-8")); - } - - } catch (NoSuchFieldException | IllegalAccessException e) { - // No endpoint, ignore - } catch (UnsupportedEncodingException e) { - // Should not happen (UTF-8 is builtin) - } - - if (this instanceof JsonpSerializable) { - sb.append(' '); - JsonpUtils.toString((JsonpSerializable) this, sb); - } - - return sb.toString(); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Result.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Result.java deleted file mode 100644 index 04a2b6c32..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Result.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API specification - */ -@JsonpDeserializable -public enum Result implements JsonEnum { - Created("created"), - - Updated("updated"), - - Deleted("deleted"), - - NotFound("not_found"), - - NoOp("noop"), - - ; - - private final String jsonValue; - - Result(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(Result.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Retries.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Retries.java deleted file mode 100644 index d81d2dc77..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Retries.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.Retries - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class Retries implements JsonpSerializable { - private final long bulk; - - private final long search; - - // --------------------------------------------------------------------------------------------- - - private Retries(Builder builder) { - - this.bulk = ApiTypeHelper.requireNonNull(builder.bulk, this, "bulk"); - this.search = ApiTypeHelper.requireNonNull(builder.search, this, "search"); - - } - - public static Retries of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code bulk} - */ - public final long bulk() { - return this.bulk; - } - - /** - * Required - API name: {@code search} - */ - public final long search() { - return this.search; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("bulk"); - generator.write(this.bulk); - - generator.writeKey("search"); - generator.write(this.search); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link Retries}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Long bulk; - - private Long search; - - /** - * Required - API name: {@code bulk} - */ - public final Builder bulk(long value) { - this.bulk = value; - return this; - } - - /** - * Required - API name: {@code search} - */ - public final Builder search(long value) { - this.search = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link Retries}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public Retries build() { - _checkSingleUse(); - - return new Retries(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link Retries} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - Retries::setupRetriesDeserializer); - - protected static void setupRetriesDeserializer(ObjectDeserializer op) { - - op.add(Builder::bulk, JsonpDeserializer.longDeserializer(), "bulk"); - op.add(Builder::search, JsonpDeserializer.longDeserializer(), "search"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Retriever.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Retriever.java deleted file mode 100644 index 478fdc197..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Retriever.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.TaggedUnion; -import co.elastic.clients.util.TaggedUnionUtils; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Object; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.RetrieverContainer - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class Retriever implements TaggedUnion, JsonpSerializable { - - /** - * {@link Retriever} variant kinds. - * - * @see API - * specification - */ - - public enum Kind implements JsonEnum { - Standard("standard"), - - Knn("knn"), - - Rrf("rrf"), - - ; - - private final String jsonValue; - - Kind(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - } - - private final Kind _kind; - private final Object _value; - - @Override - public final Kind _kind() { - return _kind; - } - - @Override - public final Object _get() { - return _value; - } - - public Retriever(RetrieverVariant value) { - - this._kind = ApiTypeHelper.requireNonNull(value._retrieverKind(), this, ""); - this._value = ApiTypeHelper.requireNonNull(value, this, ""); - - } - - private Retriever(Builder builder) { - - this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); - this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); - - } - - public static Retriever of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Is this variant instance of kind {@code standard}? - */ - public boolean isStandard() { - return _kind == Kind.Standard; - } - - /** - * Get the {@code standard} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code standard} kind. - */ - public StandardRetriever standard() { - return TaggedUnionUtils.get(this, Kind.Standard); - } - - /** - * Is this variant instance of kind {@code knn}? - */ - public boolean isKnn() { - return _kind == Kind.Knn; - } - - /** - * Get the {@code knn} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code knn} kind. - */ - public KnnRetriever knn() { - return TaggedUnionUtils.get(this, Kind.Knn); - } - - /** - * Is this variant instance of kind {@code rrf}? - */ - public boolean isRrf() { - return _kind == Kind.Rrf; - } - - /** - * Get the {@code rrf} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code rrf} kind. - */ - public RRFRetriever rrf() { - return TaggedUnionUtils.get(this, Kind.Rrf); - } - - @Override - @SuppressWarnings("unchecked") - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeStartObject(); - - generator.writeKey(_kind.jsonValue()); - if (_value instanceof JsonpSerializable) { - ((JsonpSerializable) _value).serialize(generator, mapper); - } - - generator.writeEnd(); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Kind _kind; - private Object _value; - - @Override - protected Builder self() { - return this; - } - public ObjectBuilder standard(StandardRetriever v) { - this._kind = Kind.Standard; - this._value = v; - return this; - } - - public ObjectBuilder standard( - Function> fn) { - return this.standard(fn.apply(new StandardRetriever.Builder()).build()); - } - - public ObjectBuilder knn(KnnRetriever v) { - this._kind = Kind.Knn; - this._value = v; - return this; - } - - public ObjectBuilder knn(Function> fn) { - return this.knn(fn.apply(new KnnRetriever.Builder()).build()); - } - - public ObjectBuilder rrf(RRFRetriever v) { - this._kind = Kind.Rrf; - this._value = v; - return this; - } - - public ObjectBuilder rrf(Function> fn) { - return this.rrf(fn.apply(new RRFRetriever.Builder()).build()); - } - - public Retriever build() { - _checkSingleUse(); - return new Retriever(this); - } - - } - - protected static void setupRetrieverDeserializer(ObjectDeserializer op) { - - op.add(Builder::standard, StandardRetriever._DESERIALIZER, "standard"); - op.add(Builder::knn, KnnRetriever._DESERIALIZER, "knn"); - op.add(Builder::rrf, RRFRetriever._DESERIALIZER, "rrf"); - - } - - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - Retriever::setupRetrieverDeserializer, Builder::build); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RetrieverBase.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RetrieverBase.java deleted file mode 100644 index 6ceefd82f..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RetrieverBase.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.elasticsearch._types.query_dsl.Query; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.RetrieverBase - -/** - * - * @see API - * specification - */ - -public abstract class RetrieverBase implements JsonpSerializable { - private final List filter; - - // --------------------------------------------------------------------------------------------- - - protected RetrieverBase(AbstractBuilder builder) { - - this.filter = ApiTypeHelper.unmodifiable(builder.filter); - - } - - /** - * Query to filter the documents that can match. - *

- * API name: {@code filter} - */ - public final List filter() { - return this.filter; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.filter)) { - generator.writeKey("filter"); - generator.writeStartArray(); - for (Query item0 : this.filter) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - public abstract static class AbstractBuilder> - extends - WithJsonObjectBuilderBase { - @Nullable - private List filter; - - /** - * Query to filter the documents that can match. - *

- * API name: {@code filter} - *

- * Adds all elements of list to filter. - */ - public final BuilderT filter(List list) { - this.filter = _listAddAll(this.filter, list); - return self(); - } - - /** - * Query to filter the documents that can match. - *

- * API name: {@code filter} - *

- * Adds one or more values to filter. - */ - public final BuilderT filter(Query value, Query... values) { - this.filter = _listAdd(this.filter, value, values); - return self(); - } - - /** - * Query to filter the documents that can match. - *

- * API name: {@code filter} - *

- * Adds a value to filter using a builder lambda. - */ - public final BuilderT filter(Function> fn) { - return filter(fn.apply(new Query.Builder()).build()); - } - - protected abstract BuilderT self(); - - } - - // --------------------------------------------------------------------------------------------- - protected static > void setupRetrieverBaseDeserializer( - ObjectDeserializer op) { - - op.add(AbstractBuilder::filter, JsonpDeserializer.arrayDeserializer(Query._DESERIALIZER), "filter"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RetrieverBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RetrieverBuilders.java deleted file mode 100644 index 5a3625e40..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RetrieverBuilders.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.util.ObjectBuilder; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Builders for {@link Retriever} variants. - */ -public class RetrieverBuilders { - private RetrieverBuilders() { - } - - /** - * Creates a builder for the {@link StandardRetriever standard} - * {@code Retriever} variant. - */ - public static StandardRetriever.Builder standard() { - return new StandardRetriever.Builder(); - } - - /** - * Creates a Retriever of the {@link StandardRetriever standard} - * {@code Retriever} variant. - */ - public static Retriever standard(Function> fn) { - Retriever.Builder builder = new Retriever.Builder(); - builder.standard(fn.apply(new StandardRetriever.Builder()).build()); - return builder.build(); - } - - /** - * Creates a builder for the {@link KnnRetriever knn} {@code Retriever} variant. - */ - public static KnnRetriever.Builder knn() { - return new KnnRetriever.Builder(); - } - - /** - * Creates a Retriever of the {@link KnnRetriever knn} {@code Retriever} - * variant. - */ - public static Retriever knn(Function> fn) { - Retriever.Builder builder = new Retriever.Builder(); - builder.knn(fn.apply(new KnnRetriever.Builder()).build()); - return builder.build(); - } - - /** - * Creates a builder for the {@link RRFRetriever rrf} {@code Retriever} variant. - */ - public static RRFRetriever.Builder rrf() { - return new RRFRetriever.Builder(); - } - - /** - * Creates a Retriever of the {@link RRFRetriever rrf} {@code Retriever} - * variant. - */ - public static Retriever rrf(Function> fn) { - Retriever.Builder builder = new Retriever.Builder(); - builder.rrf(fn.apply(new RRFRetriever.Builder()).build()); - return builder.build(); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RetrieverVariant.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RetrieverVariant.java deleted file mode 100644 index d220f68c3..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RetrieverVariant.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Base interface for {@link Retriever} variants. - */ -public interface RetrieverVariant { - - Retriever.Kind _retrieverKind(); - - default Retriever _toRetriever() { - return new Retriever(this); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ScoreSort.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ScoreSort.java deleted file mode 100644 index d5f8567b9..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ScoreSort.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.ScoreSort - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ScoreSort implements SortOptionsVariant, JsonpSerializable { - @Nullable - private final SortOrder order; - - // --------------------------------------------------------------------------------------------- - - private ScoreSort(Builder builder) { - - this.order = builder.order; - - } - - public static ScoreSort of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * SortOptions variant kind. - */ - @Override - public SortOptions.Kind _sortOptionsKind() { - return SortOptions.Kind.Doc; - } - - /** - * API name: {@code order} - */ - @Nullable - public final SortOrder order() { - return this.order; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.order != null) { - generator.writeKey("order"); - this.order.serialize(generator, mapper); - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ScoreSort}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private SortOrder order; - - /** - * API name: {@code order} - */ - public final Builder order(@Nullable SortOrder value) { - this.order = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ScoreSort}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ScoreSort build() { - _checkSingleUse(); - - return new ScoreSort(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ScoreSort} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ScoreSort::setupScoreSortDeserializer); - - protected static void setupScoreSortDeserializer(ObjectDeserializer op) { - - op.add(Builder::order, SortOrder._DESERIALIZER, "order"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Script.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Script.java deleted file mode 100644 index 8bd09962b..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Script.java +++ /dev/null @@ -1,352 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.elasticsearch._types.query_dsl.IntervalsFilter; -import co.elastic.clients.elasticsearch._types.query_dsl.IntervalsFilterVariant; -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: _types.Script - -/** - * - * @see API specification - */ -@JsonpDeserializable -public class Script implements IntervalsFilterVariant, JsonpSerializable { - @Nullable - private final String source; - - @Nullable - private final String id; - - private final Map params; - - @Nullable - private final String lang; - - private final Map options; - - // --------------------------------------------------------------------------------------------- - - private Script(Builder builder) { - - this.source = builder.source; - this.id = builder.id; - this.params = ApiTypeHelper.unmodifiable(builder.params); - this.lang = builder.lang; - this.options = ApiTypeHelper.unmodifiable(builder.options); - - } - - public static Script of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * IntervalsFilter variant kind. - */ - @Override - public IntervalsFilter.Kind _intervalsFilterKind() { - return IntervalsFilter.Kind.Script; - } - - /** - * The script source. - *

- * API name: {@code source} - */ - @Nullable - public final String source() { - return this.source; - } - - /** - * The id for a stored script. - *

- * API name: {@code id} - */ - @Nullable - public final String id() { - return this.id; - } - - /** - * Specifies any named parameters that are passed into the script as variables. - * Use parameters instead of hard-coded values to decrease compile time. - *

- * API name: {@code params} - */ - public final Map params() { - return this.params; - } - - /** - * Specifies the language the script is written in. - *

- * API name: {@code lang} - */ - @Nullable - public final String lang() { - return this.lang; - } - - /** - * API name: {@code options} - */ - public final Map options() { - return this.options; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.source != null) { - generator.writeKey("source"); - generator.write(this.source); - - } - if (this.id != null) { - generator.writeKey("id"); - generator.write(this.id); - - } - if (ApiTypeHelper.isDefined(this.params)) { - generator.writeKey("params"); - generator.writeStartObject(); - for (Map.Entry item0 : this.params.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.lang != null) { - generator.writeKey("lang"); - generator.write(this.lang); - - } - if (ApiTypeHelper.isDefined(this.options)) { - generator.writeKey("options"); - generator.writeStartObject(); - for (Map.Entry item0 : this.options.entrySet()) { - generator.writeKey(item0.getKey()); - generator.write(item0.getValue()); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link Script}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder - - - Please see the Elasticsearch API specification. - - diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/DeletePolicyRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/DeletePolicyRequest.java deleted file mode 100644 index 28832bdab..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/DeletePolicyRequest.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: enrich.delete_policy.Request - -/** - * Delete an enrich policy. Deletes an existing enrich policy and its enrich - * index. - * - * @see API - * specification - */ - -public class DeletePolicyRequest extends RequestBase { - private final String name; - - // --------------------------------------------------------------------------------------------- - - private DeletePolicyRequest(Builder builder) { - - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - - } - - public static DeletePolicyRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Enrich policy to delete. - *

- * API name: {@code name} - */ - public final String name() { - return this.name; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DeletePolicyRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - private String name; - - /** - * Required - Enrich policy to delete. - *

- * API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DeletePolicyRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DeletePolicyRequest build() { - _checkSingleUse(); - - return new DeletePolicyRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code enrich.delete_policy}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/enrich.delete_policy", - - // Request method - request -> { - return "DELETE"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_enrich"); - buf.append("/policy"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - params.put("name", request.name); - } - return params; - }, - - // Request parameters - request -> { - return Collections.emptyMap(); - - }, SimpleEndpoint.emptyMap(), false, DeletePolicyResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/DeletePolicyResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/DeletePolicyResponse.java deleted file mode 100644 index 0f6dd91bd..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/DeletePolicyResponse.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: enrich.delete_policy.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DeletePolicyResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private DeletePolicyResponse(Builder builder) { - super(builder); - - } - - public static DeletePolicyResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DeletePolicyResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DeletePolicyResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DeletePolicyResponse build() { - _checkSingleUse(); - - return new DeletePolicyResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DeletePolicyResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DeletePolicyResponse::setupDeletePolicyResponseDeserializer); - - protected static void setupDeletePolicyResponseDeserializer(ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichAsyncClient.java deleted file mode 100644 index c624e1a58..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichAsyncClient.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich; - -import co.elastic.clients.ApiClient; -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.transport.ElasticsearchTransport; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.JsonEndpoint; -import co.elastic.clients.transport.Transport; -import co.elastic.clients.transport.TransportOptions; -import co.elastic.clients.util.ObjectBuilder; -import java.util.concurrent.CompletableFuture; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Client for the enrich namespace. - */ -public class ElasticsearchEnrichAsyncClient extends ApiClient { - - public ElasticsearchEnrichAsyncClient(ElasticsearchTransport transport) { - super(transport, null); - } - - public ElasticsearchEnrichAsyncClient(ElasticsearchTransport transport, - @Nullable TransportOptions transportOptions) { - super(transport, transportOptions); - } - - @Override - public ElasticsearchEnrichAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) { - return new ElasticsearchEnrichAsyncClient(this.transport, transportOptions); - } - - // ----- Endpoint: enrich.delete_policy - - /** - * Delete an enrich policy. Deletes an existing enrich policy and its enrich - * index. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture deletePolicy(DeletePolicyRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeletePolicyRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Delete an enrich policy. Deletes an existing enrich policy and its enrich - * index. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeletePolicyRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture deletePolicy( - Function> fn) { - return deletePolicy(fn.apply(new DeletePolicyRequest.Builder()).build()); - } - - // ----- Endpoint: enrich.execute_policy - - /** - * Creates the enrich index for an existing enrich policy. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture executePolicy(ExecutePolicyRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ExecutePolicyRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Creates the enrich index for an existing enrich policy. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExecutePolicyRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture executePolicy( - Function> fn) { - return executePolicy(fn.apply(new ExecutePolicyRequest.Builder()).build()); - } - - // ----- Endpoint: enrich.get_policy - - /** - * Get an enrich policy. Returns information about an enrich policy. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture getPolicy(GetPolicyRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetPolicyRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Get an enrich policy. Returns information about an enrich policy. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetPolicyRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture getPolicy( - Function> fn) { - return getPolicy(fn.apply(new GetPolicyRequest.Builder()).build()); - } - - /** - * Get an enrich policy. Returns information about an enrich policy. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture getPolicy() { - return this.transport.performRequestAsync(new GetPolicyRequest.Builder().build(), GetPolicyRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: enrich.put_policy - - /** - * Create an enrich policy. Creates an enrich policy. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture putPolicy(PutPolicyRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutPolicyRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Create an enrich policy. Creates an enrich policy. - * - * @param fn - * a function that initializes a builder to create the - * {@link PutPolicyRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture putPolicy( - Function> fn) { - return putPolicy(fn.apply(new PutPolicyRequest.Builder()).build()); - } - - // ----- Endpoint: enrich.stats - - /** - * Get enrich stats. Returns enrich coordinator statistics and information about - * enrich policies that are currently executing. - * - * @see Documentation - * on elastic.co - */ - public CompletableFuture stats() { - return this.transport.performRequestAsync(EnrichStatsRequest._INSTANCE, EnrichStatsRequest._ENDPOINT, - this.transportOptions); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichClient.java deleted file mode 100644 index 3201966b0..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichClient.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich; - -import co.elastic.clients.ApiClient; -import co.elastic.clients.elasticsearch._types.ElasticsearchException; -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.transport.ElasticsearchTransport; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.JsonEndpoint; -import co.elastic.clients.transport.Transport; -import co.elastic.clients.transport.TransportOptions; -import co.elastic.clients.util.ObjectBuilder; -import java.io.IOException; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Client for the enrich namespace. - */ -public class ElasticsearchEnrichClient extends ApiClient { - - public ElasticsearchEnrichClient(ElasticsearchTransport transport) { - super(transport, null); - } - - public ElasticsearchEnrichClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { - super(transport, transportOptions); - } - - @Override - public ElasticsearchEnrichClient withTransportOptions(@Nullable TransportOptions transportOptions) { - return new ElasticsearchEnrichClient(this.transport, transportOptions); - } - - // ----- Endpoint: enrich.delete_policy - - /** - * Delete an enrich policy. Deletes an existing enrich policy and its enrich - * index. - * - * @see Documentation - * on elastic.co - */ - - public DeletePolicyResponse deletePolicy(DeletePolicyRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeletePolicyRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Delete an enrich policy. Deletes an existing enrich policy and its enrich - * index. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeletePolicyRequest} - * @see Documentation - * on elastic.co - */ - - public final DeletePolicyResponse deletePolicy( - Function> fn) - throws IOException, ElasticsearchException { - return deletePolicy(fn.apply(new DeletePolicyRequest.Builder()).build()); - } - - // ----- Endpoint: enrich.execute_policy - - /** - * Creates the enrich index for an existing enrich policy. - * - * @see Documentation - * on elastic.co - */ - - public ExecutePolicyResponse executePolicy(ExecutePolicyRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ExecutePolicyRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Creates the enrich index for an existing enrich policy. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExecutePolicyRequest} - * @see Documentation - * on elastic.co - */ - - public final ExecutePolicyResponse executePolicy( - Function> fn) - throws IOException, ElasticsearchException { - return executePolicy(fn.apply(new ExecutePolicyRequest.Builder()).build()); - } - - // ----- Endpoint: enrich.get_policy - - /** - * Get an enrich policy. Returns information about an enrich policy. - * - * @see Documentation - * on elastic.co - */ - - public GetPolicyResponse getPolicy(GetPolicyRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetPolicyRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Get an enrich policy. Returns information about an enrich policy. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetPolicyRequest} - * @see Documentation - * on elastic.co - */ - - public final GetPolicyResponse getPolicy(Function> fn) - throws IOException, ElasticsearchException { - return getPolicy(fn.apply(new GetPolicyRequest.Builder()).build()); - } - - /** - * Get an enrich policy. Returns information about an enrich policy. - * - * @see Documentation - * on elastic.co - */ - - public GetPolicyResponse getPolicy() throws IOException, ElasticsearchException { - return this.transport.performRequest(new GetPolicyRequest.Builder().build(), GetPolicyRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: enrich.put_policy - - /** - * Create an enrich policy. Creates an enrich policy. - * - * @see Documentation - * on elastic.co - */ - - public PutPolicyResponse putPolicy(PutPolicyRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutPolicyRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Create an enrich policy. Creates an enrich policy. - * - * @param fn - * a function that initializes a builder to create the - * {@link PutPolicyRequest} - * @see Documentation - * on elastic.co - */ - - public final PutPolicyResponse putPolicy(Function> fn) - throws IOException, ElasticsearchException { - return putPolicy(fn.apply(new PutPolicyRequest.Builder()).build()); - } - - // ----- Endpoint: enrich.stats - - /** - * Get enrich stats. Returns enrich coordinator statistics and information about - * enrich policies that are currently executing. - * - * @see Documentation - * on elastic.co - */ - public EnrichStatsResponse stats() throws IOException, ElasticsearchException { - return this.transport.performRequest(EnrichStatsRequest._INSTANCE, EnrichStatsRequest._ENDPOINT, - this.transportOptions); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichPolicy.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichPolicy.java deleted file mode 100644 index 9030036ee..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichPolicy.java +++ /dev/null @@ -1,338 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich; - -import co.elastic.clients.elasticsearch._types.query_dsl.Query; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: enrich._types.Policy - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class EnrichPolicy implements JsonpSerializable { - private final List enrichFields; - - private final List indices; - - private final String matchField; - - @Nullable - private final Query query; - - @Nullable - private final String name; - - @Nullable - private final String elasticsearchVersion; - - // --------------------------------------------------------------------------------------------- - - private EnrichPolicy(Builder builder) { - - this.enrichFields = ApiTypeHelper.unmodifiableRequired(builder.enrichFields, this, "enrichFields"); - this.indices = ApiTypeHelper.unmodifiableRequired(builder.indices, this, "indices"); - this.matchField = ApiTypeHelper.requireNonNull(builder.matchField, this, "matchField"); - this.query = builder.query; - this.name = builder.name; - this.elasticsearchVersion = builder.elasticsearchVersion; - - } - - public static EnrichPolicy of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code enrich_fields} - */ - public final List enrichFields() { - return this.enrichFields; - } - - /** - * Required - API name: {@code indices} - */ - public final List indices() { - return this.indices; - } - - /** - * Required - API name: {@code match_field} - */ - public final String matchField() { - return this.matchField; - } - - /** - * API name: {@code query} - */ - @Nullable - public final Query query() { - return this.query; - } - - /** - * API name: {@code name} - */ - @Nullable - public final String name() { - return this.name; - } - - /** - * API name: {@code elasticsearch_version} - */ - @Nullable - public final String elasticsearchVersion() { - return this.elasticsearchVersion; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.enrichFields)) { - generator.writeKey("enrich_fields"); - generator.writeStartArray(); - for (String item0 : this.enrichFields) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.indices)) { - generator.writeKey("indices"); - generator.writeStartArray(); - for (String item0 : this.indices) { - generator.write(item0); - - } - generator.writeEnd(); - - } - generator.writeKey("match_field"); - generator.write(this.matchField); - - if (this.query != null) { - generator.writeKey("query"); - this.query.serialize(generator, mapper); - - } - if (this.name != null) { - generator.writeKey("name"); - generator.write(this.name); - - } - if (this.elasticsearchVersion != null) { - generator.writeKey("elasticsearch_version"); - generator.write(this.elasticsearchVersion); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link EnrichPolicy}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private List enrichFields; - - private List indices; - - private String matchField; - - @Nullable - private Query query; - - @Nullable - private String name; - - @Nullable - private String elasticsearchVersion; - - /** - * Required - API name: {@code enrich_fields} - *

- * Adds all elements of list to enrichFields. - */ - public final Builder enrichFields(List list) { - this.enrichFields = _listAddAll(this.enrichFields, list); - return this; - } - - /** - * Required - API name: {@code enrich_fields} - *

- * Adds one or more values to enrichFields. - */ - public final Builder enrichFields(String value, String... values) { - this.enrichFields = _listAdd(this.enrichFields, value, values); - return this; - } - - /** - * Required - API name: {@code indices} - *

- * Adds all elements of list to indices. - */ - public final Builder indices(List list) { - this.indices = _listAddAll(this.indices, list); - return this; - } - - /** - * Required - API name: {@code indices} - *

- * Adds one or more values to indices. - */ - public final Builder indices(String value, String... values) { - this.indices = _listAdd(this.indices, value, values); - return this; - } - - /** - * Required - API name: {@code match_field} - */ - public final Builder matchField(String value) { - this.matchField = value; - return this; - } - - /** - * API name: {@code query} - */ - public final Builder query(@Nullable Query value) { - this.query = value; - return this; - } - - /** - * API name: {@code query} - */ - public final Builder query(Function> fn) { - return this.query(fn.apply(new Query.Builder()).build()); - } - - /** - * API name: {@code name} - */ - public final Builder name(@Nullable String value) { - this.name = value; - return this; - } - - /** - * API name: {@code elasticsearch_version} - */ - public final Builder elasticsearchVersion(@Nullable String value) { - this.elasticsearchVersion = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link EnrichPolicy}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public EnrichPolicy build() { - _checkSingleUse(); - - return new EnrichPolicy(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link EnrichPolicy} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - EnrichPolicy::setupEnrichPolicyDeserializer); - - protected static void setupEnrichPolicyDeserializer(ObjectDeserializer op) { - - op.add(Builder::enrichFields, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "enrich_fields"); - op.add(Builder::indices, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "indices"); - op.add(Builder::matchField, JsonpDeserializer.stringDeserializer(), "match_field"); - op.add(Builder::query, Query._DESERIALIZER, "query"); - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - op.add(Builder::elasticsearchVersion, JsonpDeserializer.stringDeserializer(), "elasticsearch_version"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichPolicyType.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichPolicyType.java deleted file mode 100644 index 65510d96c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichPolicyType.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum EnrichPolicyType implements JsonEnum { - GeoMatch("geo_match"), - - Match("match"), - - Range("range"), - - ; - - private final String jsonValue; - - EnrichPolicyType(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - EnrichPolicyType.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichStatsRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichStatsRequest.java deleted file mode 100644 index 4415912ef..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichStatsRequest.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Collections; -import java.util.Objects; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: enrich.stats.Request - -/** - * Get enrich stats. Returns enrich coordinator statistics and information about - * enrich policies that are currently executing. - * - * @see API - * specification - */ - -public class EnrichStatsRequest extends RequestBase { - public EnrichStatsRequest() { - } - - /** - * Singleton instance for {@link EnrichStatsRequest}. - */ - public static final EnrichStatsRequest _INSTANCE = new EnrichStatsRequest(); - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code enrich.stats}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/enrich.stats", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - return "/_enrich/_stats"; - - }, - - // Path parameters - request -> { - return Collections.emptyMap(); - }, - - // Request parameters - request -> { - return Collections.emptyMap(); - - }, SimpleEndpoint.emptyMap(), false, EnrichStatsResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichStatsResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichStatsResponse.java deleted file mode 100644 index 5bb010144..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichStatsResponse.java +++ /dev/null @@ -1,331 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich; - -import co.elastic.clients.elasticsearch.enrich.stats.CacheStats; -import co.elastic.clients.elasticsearch.enrich.stats.CoordinatorStats; -import co.elastic.clients.elasticsearch.enrich.stats.ExecutingPolicy; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: enrich.stats.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class EnrichStatsResponse implements JsonpSerializable { - private final List coordinatorStats; - - private final List executingPolicies; - - private final List cacheStats; - - // --------------------------------------------------------------------------------------------- - - private EnrichStatsResponse(Builder builder) { - - this.coordinatorStats = ApiTypeHelper.unmodifiableRequired(builder.coordinatorStats, this, "coordinatorStats"); - this.executingPolicies = ApiTypeHelper.unmodifiableRequired(builder.executingPolicies, this, - "executingPolicies"); - this.cacheStats = ApiTypeHelper.unmodifiable(builder.cacheStats); - - } - - public static EnrichStatsResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Objects containing information about each coordinating ingest node - * for configured enrich processors. - *

- * API name: {@code coordinator_stats} - */ - public final List coordinatorStats() { - return this.coordinatorStats; - } - - /** - * Required - Objects containing information about each enrich policy that is - * currently executing. - *

- * API name: {@code executing_policies} - */ - public final List executingPolicies() { - return this.executingPolicies; - } - - /** - * Objects containing information about the enrich cache stats on each ingest - * node. - *

- * API name: {@code cache_stats} - */ - public final List cacheStats() { - return this.cacheStats; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.coordinatorStats)) { - generator.writeKey("coordinator_stats"); - generator.writeStartArray(); - for (CoordinatorStats item0 : this.coordinatorStats) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.executingPolicies)) { - generator.writeKey("executing_policies"); - generator.writeStartArray(); - for (ExecutingPolicy item0 : this.executingPolicies) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.cacheStats)) { - generator.writeKey("cache_stats"); - generator.writeStartArray(); - for (CacheStats item0 : this.cacheStats) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link EnrichStatsResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private List coordinatorStats; - - private List executingPolicies; - - @Nullable - private List cacheStats; - - /** - * Required - Objects containing information about each coordinating ingest node - * for configured enrich processors. - *

- * API name: {@code coordinator_stats} - *

- * Adds all elements of list to coordinatorStats. - */ - public final Builder coordinatorStats(List list) { - this.coordinatorStats = _listAddAll(this.coordinatorStats, list); - return this; - } - - /** - * Required - Objects containing information about each coordinating ingest node - * for configured enrich processors. - *

- * API name: {@code coordinator_stats} - *

- * Adds one or more values to coordinatorStats. - */ - public final Builder coordinatorStats(CoordinatorStats value, CoordinatorStats... values) { - this.coordinatorStats = _listAdd(this.coordinatorStats, value, values); - return this; - } - - /** - * Required - Objects containing information about each coordinating ingest node - * for configured enrich processors. - *

- * API name: {@code coordinator_stats} - *

- * Adds a value to coordinatorStats using a builder lambda. - */ - public final Builder coordinatorStats(Function> fn) { - return coordinatorStats(fn.apply(new CoordinatorStats.Builder()).build()); - } - - /** - * Required - Objects containing information about each enrich policy that is - * currently executing. - *

- * API name: {@code executing_policies} - *

- * Adds all elements of list to executingPolicies. - */ - public final Builder executingPolicies(List list) { - this.executingPolicies = _listAddAll(this.executingPolicies, list); - return this; - } - - /** - * Required - Objects containing information about each enrich policy that is - * currently executing. - *

- * API name: {@code executing_policies} - *

- * Adds one or more values to executingPolicies. - */ - public final Builder executingPolicies(ExecutingPolicy value, ExecutingPolicy... values) { - this.executingPolicies = _listAdd(this.executingPolicies, value, values); - return this; - } - - /** - * Required - Objects containing information about each enrich policy that is - * currently executing. - *

- * API name: {@code executing_policies} - *

- * Adds a value to executingPolicies using a builder lambda. - */ - public final Builder executingPolicies(Function> fn) { - return executingPolicies(fn.apply(new ExecutingPolicy.Builder()).build()); - } - - /** - * Objects containing information about the enrich cache stats on each ingest - * node. - *

- * API name: {@code cache_stats} - *

- * Adds all elements of list to cacheStats. - */ - public final Builder cacheStats(List list) { - this.cacheStats = _listAddAll(this.cacheStats, list); - return this; - } - - /** - * Objects containing information about the enrich cache stats on each ingest - * node. - *

- * API name: {@code cache_stats} - *

- * Adds one or more values to cacheStats. - */ - public final Builder cacheStats(CacheStats value, CacheStats... values) { - this.cacheStats = _listAdd(this.cacheStats, value, values); - return this; - } - - /** - * Objects containing information about the enrich cache stats on each ingest - * node. - *

- * API name: {@code cache_stats} - *

- * Adds a value to cacheStats using a builder lambda. - */ - public final Builder cacheStats(Function> fn) { - return cacheStats(fn.apply(new CacheStats.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link EnrichStatsResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public EnrichStatsResponse build() { - _checkSingleUse(); - - return new EnrichStatsResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link EnrichStatsResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, EnrichStatsResponse::setupEnrichStatsResponseDeserializer); - - protected static void setupEnrichStatsResponseDeserializer(ObjectDeserializer op) { - - op.add(Builder::coordinatorStats, JsonpDeserializer.arrayDeserializer(CoordinatorStats._DESERIALIZER), - "coordinator_stats"); - op.add(Builder::executingPolicies, JsonpDeserializer.arrayDeserializer(ExecutingPolicy._DESERIALIZER), - "executing_policies"); - op.add(Builder::cacheStats, JsonpDeserializer.arrayDeserializer(CacheStats._DESERIALIZER), "cache_stats"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichSummary.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichSummary.java deleted file mode 100644 index d87db06e6..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichSummary.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.Pair; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: enrich._types.Summary - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class EnrichSummary implements JsonpSerializable { - private final Pair config; - - // --------------------------------------------------------------------------------------------- - - private EnrichSummary(Builder builder) { - - this.config = ApiTypeHelper.requireNonNull(builder.config, this, "config"); - - } - - public static EnrichSummary of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code config} - */ - public final Pair config() { - return this.config; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("config"); - generator.writeStartObject(); - generator.writeKey(this.config.key().jsonValue()); - this.config.value().serialize(generator, mapper); - - generator.writeEnd(); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link EnrichSummary}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Pair config; - - /** - * Required - API name: {@code config} - */ - public final Builder config(Pair value) { - this.config = value; - return this; - } - - /** - * Required - API name: {@code config} - */ - public Builder config(EnrichPolicyType key, EnrichPolicy value) { - this.config = new Pair(key, value); - return this; - } - - /** - * Required - API name: {@code config} - */ - public Builder config(EnrichPolicyType key, Function> fn) { - return this.config(key, fn.apply(new EnrichPolicy.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link EnrichSummary}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public EnrichSummary build() { - _checkSingleUse(); - - return new EnrichSummary(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link EnrichSummary} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - EnrichSummary::setupEnrichSummaryDeserializer); - - protected static void setupEnrichSummaryDeserializer(ObjectDeserializer op) { - - op.add(Builder::config, - Pair.deserializer((k) -> EnrichPolicyType._DESERIALIZER.parse(k), EnrichPolicy._DESERIALIZER), - "config"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ExecutePolicyRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ExecutePolicyRequest.java deleted file mode 100644 index 1623ad63c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ExecutePolicyRequest.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: enrich.execute_policy.Request - -/** - * Creates the enrich index for an existing enrich policy. - * - * @see API - * specification - */ - -public class ExecutePolicyRequest extends RequestBase { - private final String name; - - @Nullable - private final Boolean waitForCompletion; - - // --------------------------------------------------------------------------------------------- - - private ExecutePolicyRequest(Builder builder) { - - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.waitForCompletion = builder.waitForCompletion; - - } - - public static ExecutePolicyRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Enrich policy to execute. - *

- * API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * If true, the request blocks other enrich policy execution - * requests until complete. - *

- * API name: {@code wait_for_completion} - */ - @Nullable - public final Boolean waitForCompletion() { - return this.waitForCompletion; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ExecutePolicyRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - private String name; - - @Nullable - private Boolean waitForCompletion; - - /** - * Required - Enrich policy to execute. - *

- * API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * If true, the request blocks other enrich policy execution - * requests until complete. - *

- * API name: {@code wait_for_completion} - */ - public final Builder waitForCompletion(@Nullable Boolean value) { - this.waitForCompletion = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ExecutePolicyRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ExecutePolicyRequest build() { - _checkSingleUse(); - - return new ExecutePolicyRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code enrich.execute_policy}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/enrich.execute_policy", - - // Request method - request -> { - return "PUT"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_enrich"); - buf.append("/policy"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name, buf); - buf.append("/_execute"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - params.put("name", request.name); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.waitForCompletion != null) { - params.put("wait_for_completion", String.valueOf(request.waitForCompletion)); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, ExecutePolicyResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ExecutePolicyResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ExecutePolicyResponse.java deleted file mode 100644 index f489217df..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ExecutePolicyResponse.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich; - -import co.elastic.clients.elasticsearch.enrich.execute_policy.ExecuteEnrichPolicyStatus; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: enrich.execute_policy.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ExecutePolicyResponse implements JsonpSerializable { - @Nullable - private final ExecuteEnrichPolicyStatus status; - - @Nullable - private final String taskId; - - // --------------------------------------------------------------------------------------------- - - private ExecutePolicyResponse(Builder builder) { - - this.status = builder.status; - this.taskId = builder.taskId; - - } - - public static ExecutePolicyResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code status} - */ - @Nullable - public final ExecuteEnrichPolicyStatus status() { - return this.status; - } - - /** - * API name: {@code task_id} - */ - @Nullable - public final String taskId() { - return this.taskId; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.status != null) { - generator.writeKey("status"); - this.status.serialize(generator, mapper); - - } - if (this.taskId != null) { - generator.writeKey("task_id"); - generator.write(this.taskId); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ExecutePolicyResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private ExecuteEnrichPolicyStatus status; - - @Nullable - private String taskId; - - /** - * API name: {@code status} - */ - public final Builder status(@Nullable ExecuteEnrichPolicyStatus value) { - this.status = value; - return this; - } - - /** - * API name: {@code status} - */ - public final Builder status( - Function> fn) { - return this.status(fn.apply(new ExecuteEnrichPolicyStatus.Builder()).build()); - } - - /** - * API name: {@code task_id} - */ - public final Builder taskId(@Nullable String value) { - this.taskId = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ExecutePolicyResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ExecutePolicyResponse build() { - _checkSingleUse(); - - return new ExecutePolicyResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ExecutePolicyResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ExecutePolicyResponse::setupExecutePolicyResponseDeserializer); - - protected static void setupExecutePolicyResponseDeserializer(ObjectDeserializer op) { - - op.add(Builder::status, ExecuteEnrichPolicyStatus._DESERIALIZER, "status"); - op.add(Builder::taskId, JsonpDeserializer.stringDeserializer(), "task_id"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/GetPolicyRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/GetPolicyRequest.java deleted file mode 100644 index c7f0bc30a..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/GetPolicyRequest.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: enrich.get_policy.Request - -/** - * Get an enrich policy. Returns information about an enrich policy. - * - * @see API - * specification - */ - -public class GetPolicyRequest extends RequestBase { - private final List name; - - // --------------------------------------------------------------------------------------------- - - private GetPolicyRequest(Builder builder) { - - this.name = ApiTypeHelper.unmodifiable(builder.name); - - } - - public static GetPolicyRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Comma-separated list of enrich policy names used to limit the request. To - * return information for all enrich policies, omit this parameter. - *

- * API name: {@code name} - */ - public final List name() { - return this.name; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetPolicyRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private List name; - - /** - * Comma-separated list of enrich policy names used to limit the request. To - * return information for all enrich policies, omit this parameter. - *

- * API name: {@code name} - *

- * Adds all elements of list to name. - */ - public final Builder name(List list) { - this.name = _listAddAll(this.name, list); - return this; - } - - /** - * Comma-separated list of enrich policy names used to limit the request. To - * return information for all enrich policies, omit this parameter. - *

- * API name: {@code name} - *

- * Adds one or more values to name. - */ - public final Builder name(String value, String... values) { - this.name = _listAdd(this.name, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetPolicyRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetPolicyRequest build() { - _checkSingleUse(); - - return new GetPolicyRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code enrich.get_policy}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/enrich.get_policy", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.name())) - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_enrich"); - buf.append("/policy"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_enrich"); - buf.append("/policy"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.name())) - propsSet |= _name; - - if (propsSet == (_name)) { - params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); - } - if (propsSet == 0) { - } - return params; - }, - - // Request parameters - request -> { - return Collections.emptyMap(); - - }, SimpleEndpoint.emptyMap(), false, GetPolicyResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/GetPolicyResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/GetPolicyResponse.java deleted file mode 100644 index 1f87d2cc0..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/GetPolicyResponse.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: enrich.get_policy.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class GetPolicyResponse implements JsonpSerializable { - private final List policies; - - // --------------------------------------------------------------------------------------------- - - private GetPolicyResponse(Builder builder) { - - this.policies = ApiTypeHelper.unmodifiableRequired(builder.policies, this, "policies"); - - } - - public static GetPolicyResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code policies} - */ - public final List policies() { - return this.policies; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.policies)) { - generator.writeKey("policies"); - generator.writeStartArray(); - for (EnrichSummary item0 : this.policies) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetPolicyResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private List policies; - - /** - * Required - API name: {@code policies} - *

- * Adds all elements of list to policies. - */ - public final Builder policies(List list) { - this.policies = _listAddAll(this.policies, list); - return this; - } - - /** - * Required - API name: {@code policies} - *

- * Adds one or more values to policies. - */ - public final Builder policies(EnrichSummary value, EnrichSummary... values) { - this.policies = _listAdd(this.policies, value, values); - return this; - } - - /** - * Required - API name: {@code policies} - *

- * Adds a value to policies using a builder lambda. - */ - public final Builder policies(Function> fn) { - return policies(fn.apply(new EnrichSummary.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetPolicyResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetPolicyResponse build() { - _checkSingleUse(); - - return new GetPolicyResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link GetPolicyResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, GetPolicyResponse::setupGetPolicyResponseDeserializer); - - protected static void setupGetPolicyResponseDeserializer(ObjectDeserializer op) { - - op.add(Builder::policies, JsonpDeserializer.arrayDeserializer(EnrichSummary._DESERIALIZER), "policies"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/PutPolicyRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/PutPolicyRequest.java deleted file mode 100644 index c7382272b..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/PutPolicyRequest.java +++ /dev/null @@ -1,343 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: enrich.put_policy.Request - -/** - * Create an enrich policy. Creates an enrich policy. - * - * @see API - * specification - */ -@JsonpDeserializable -public class PutPolicyRequest extends RequestBase implements JsonpSerializable { - @Nullable - private final EnrichPolicy geoMatch; - - @Nullable - private final EnrichPolicy match; - - private final String name; - - @Nullable - private final EnrichPolicy range; - - // --------------------------------------------------------------------------------------------- - - private PutPolicyRequest(Builder builder) { - - this.geoMatch = builder.geoMatch; - this.match = builder.match; - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.range = builder.range; - - } - - public static PutPolicyRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Matches enrich data to incoming documents based on a geo_shape - * query. - *

- * API name: {@code geo_match} - */ - @Nullable - public final EnrichPolicy geoMatch() { - return this.geoMatch; - } - - /** - * Matches enrich data to incoming documents based on a term query. - *

- * API name: {@code match} - */ - @Nullable - public final EnrichPolicy match() { - return this.match; - } - - /** - * Required - Name of the enrich policy to create or update. - *

- * API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Matches a number, date, or IP address in incoming documents to a range in the - * enrich index based on a term query. - *

- * API name: {@code range} - */ - @Nullable - public final EnrichPolicy range() { - return this.range; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.geoMatch != null) { - generator.writeKey("geo_match"); - this.geoMatch.serialize(generator, mapper); - - } - if (this.match != null) { - generator.writeKey("match"); - this.match.serialize(generator, mapper); - - } - if (this.range != null) { - generator.writeKey("range"); - this.range.serialize(generator, mapper); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PutPolicyRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private EnrichPolicy geoMatch; - - @Nullable - private EnrichPolicy match; - - private String name; - - @Nullable - private EnrichPolicy range; - - /** - * Matches enrich data to incoming documents based on a geo_shape - * query. - *

- * API name: {@code geo_match} - */ - public final Builder geoMatch(@Nullable EnrichPolicy value) { - this.geoMatch = value; - return this; - } - - /** - * Matches enrich data to incoming documents based on a geo_shape - * query. - *

- * API name: {@code geo_match} - */ - public final Builder geoMatch(Function> fn) { - return this.geoMatch(fn.apply(new EnrichPolicy.Builder()).build()); - } - - /** - * Matches enrich data to incoming documents based on a term query. - *

- * API name: {@code match} - */ - public final Builder match(@Nullable EnrichPolicy value) { - this.match = value; - return this; - } - - /** - * Matches enrich data to incoming documents based on a term query. - *

- * API name: {@code match} - */ - public final Builder match(Function> fn) { - return this.match(fn.apply(new EnrichPolicy.Builder()).build()); - } - - /** - * Required - Name of the enrich policy to create or update. - *

- * API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Matches a number, date, or IP address in incoming documents to a range in the - * enrich index based on a term query. - *

- * API name: {@code range} - */ - public final Builder range(@Nullable EnrichPolicy value) { - this.range = value; - return this; - } - - /** - * Matches a number, date, or IP address in incoming documents to a range in the - * enrich index based on a term query. - *

- * API name: {@code range} - */ - public final Builder range(Function> fn) { - return this.range(fn.apply(new EnrichPolicy.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PutPolicyRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PutPolicyRequest build() { - _checkSingleUse(); - - return new PutPolicyRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PutPolicyRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - PutPolicyRequest::setupPutPolicyRequestDeserializer); - - protected static void setupPutPolicyRequestDeserializer(ObjectDeserializer op) { - - op.add(Builder::geoMatch, EnrichPolicy._DESERIALIZER, "geo_match"); - op.add(Builder::match, EnrichPolicy._DESERIALIZER, "match"); - op.add(Builder::range, EnrichPolicy._DESERIALIZER, "range"); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code enrich.put_policy}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/enrich.put_policy", - - // Request method - request -> { - return "PUT"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_enrich"); - buf.append("/policy"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - params.put("name", request.name); - } - return params; - }, - - // Request parameters - request -> { - return Collections.emptyMap(); - - }, SimpleEndpoint.emptyMap(), true, PutPolicyResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/PutPolicyResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/PutPolicyResponse.java deleted file mode 100644 index dc1f57db4..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/PutPolicyResponse.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: enrich.put_policy.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class PutPolicyResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private PutPolicyResponse(Builder builder) { - super(builder); - - } - - public static PutPolicyResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PutPolicyResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PutPolicyResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PutPolicyResponse build() { - _checkSingleUse(); - - return new PutPolicyResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PutPolicyResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, PutPolicyResponse::setupPutPolicyResponseDeserializer); - - protected static void setupPutPolicyResponseDeserializer(ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/execute_policy/EnrichPolicyPhase.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/execute_policy/EnrichPolicyPhase.java deleted file mode 100644 index afe15042b..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/execute_policy/EnrichPolicyPhase.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich.execute_policy; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum EnrichPolicyPhase implements JsonEnum { - Scheduled("SCHEDULED"), - - Running("RUNNING"), - - Complete("COMPLETE"), - - Failed("FAILED"), - - ; - - private final String jsonValue; - - EnrichPolicyPhase(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - EnrichPolicyPhase.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/execute_policy/ExecuteEnrichPolicyStatus.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/execute_policy/ExecuteEnrichPolicyStatus.java deleted file mode 100644 index 189a538f6..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/execute_policy/ExecuteEnrichPolicyStatus.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich.execute_policy; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: enrich.execute_policy.ExecuteEnrichPolicyStatus - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ExecuteEnrichPolicyStatus implements JsonpSerializable { - private final EnrichPolicyPhase phase; - - // --------------------------------------------------------------------------------------------- - - private ExecuteEnrichPolicyStatus(Builder builder) { - - this.phase = ApiTypeHelper.requireNonNull(builder.phase, this, "phase"); - - } - - public static ExecuteEnrichPolicyStatus of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code phase} - */ - public final EnrichPolicyPhase phase() { - return this.phase; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("phase"); - this.phase.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ExecuteEnrichPolicyStatus}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private EnrichPolicyPhase phase; - - /** - * Required - API name: {@code phase} - */ - public final Builder phase(EnrichPolicyPhase value) { - this.phase = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ExecuteEnrichPolicyStatus}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ExecuteEnrichPolicyStatus build() { - _checkSingleUse(); - - return new ExecuteEnrichPolicyStatus(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ExecuteEnrichPolicyStatus} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ExecuteEnrichPolicyStatus::setupExecuteEnrichPolicyStatusDeserializer); - - protected static void setupExecuteEnrichPolicyStatusDeserializer( - ObjectDeserializer op) { - - op.add(Builder::phase, EnrichPolicyPhase._DESERIALIZER, "phase"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/CacheStats.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/CacheStats.java deleted file mode 100644 index 37723bd0e..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/CacheStats.java +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: enrich.stats.CacheStats - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class CacheStats implements JsonpSerializable { - private final String nodeId; - - private final int count; - - private final int hits; - - private final long hitsTimeInMillis; - - private final int misses; - - private final long missesTimeInMillis; - - private final int evictions; - - private final long sizeInBytes; - - // --------------------------------------------------------------------------------------------- - - private CacheStats(Builder builder) { - - this.nodeId = ApiTypeHelper.requireNonNull(builder.nodeId, this, "nodeId"); - this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); - this.hits = ApiTypeHelper.requireNonNull(builder.hits, this, "hits"); - this.hitsTimeInMillis = ApiTypeHelper.requireNonNull(builder.hitsTimeInMillis, this, "hitsTimeInMillis"); - this.misses = ApiTypeHelper.requireNonNull(builder.misses, this, "misses"); - this.missesTimeInMillis = ApiTypeHelper.requireNonNull(builder.missesTimeInMillis, this, "missesTimeInMillis"); - this.evictions = ApiTypeHelper.requireNonNull(builder.evictions, this, "evictions"); - this.sizeInBytes = ApiTypeHelper.requireNonNull(builder.sizeInBytes, this, "sizeInBytes"); - - } - - public static CacheStats of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code node_id} - */ - public final String nodeId() { - return this.nodeId; - } - - /** - * Required - API name: {@code count} - */ - public final int count() { - return this.count; - } - - /** - * Required - API name: {@code hits} - */ - public final int hits() { - return this.hits; - } - - /** - * Required - API name: {@code hits_time_in_millis} - */ - public final long hitsTimeInMillis() { - return this.hitsTimeInMillis; - } - - /** - * Required - API name: {@code misses} - */ - public final int misses() { - return this.misses; - } - - /** - * Required - API name: {@code misses_time_in_millis} - */ - public final long missesTimeInMillis() { - return this.missesTimeInMillis; - } - - /** - * Required - API name: {@code evictions} - */ - public final int evictions() { - return this.evictions; - } - - /** - * Required - API name: {@code size_in_bytes} - */ - public final long sizeInBytes() { - return this.sizeInBytes; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("node_id"); - generator.write(this.nodeId); - - generator.writeKey("count"); - generator.write(this.count); - - generator.writeKey("hits"); - generator.write(this.hits); - - generator.writeKey("hits_time_in_millis"); - generator.write(this.hitsTimeInMillis); - - generator.writeKey("misses"); - generator.write(this.misses); - - generator.writeKey("misses_time_in_millis"); - generator.write(this.missesTimeInMillis); - - generator.writeKey("evictions"); - generator.write(this.evictions); - - generator.writeKey("size_in_bytes"); - generator.write(this.sizeInBytes); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link CacheStats}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String nodeId; - - private Integer count; - - private Integer hits; - - private Long hitsTimeInMillis; - - private Integer misses; - - private Long missesTimeInMillis; - - private Integer evictions; - - private Long sizeInBytes; - - /** - * Required - API name: {@code node_id} - */ - public final Builder nodeId(String value) { - this.nodeId = value; - return this; - } - - /** - * Required - API name: {@code count} - */ - public final Builder count(int value) { - this.count = value; - return this; - } - - /** - * Required - API name: {@code hits} - */ - public final Builder hits(int value) { - this.hits = value; - return this; - } - - /** - * Required - API name: {@code hits_time_in_millis} - */ - public final Builder hitsTimeInMillis(long value) { - this.hitsTimeInMillis = value; - return this; - } - - /** - * Required - API name: {@code misses} - */ - public final Builder misses(int value) { - this.misses = value; - return this; - } - - /** - * Required - API name: {@code misses_time_in_millis} - */ - public final Builder missesTimeInMillis(long value) { - this.missesTimeInMillis = value; - return this; - } - - /** - * Required - API name: {@code evictions} - */ - public final Builder evictions(int value) { - this.evictions = value; - return this; - } - - /** - * Required - API name: {@code size_in_bytes} - */ - public final Builder sizeInBytes(long value) { - this.sizeInBytes = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link CacheStats}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public CacheStats build() { - _checkSingleUse(); - - return new CacheStats(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link CacheStats} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - CacheStats::setupCacheStatsDeserializer); - - protected static void setupCacheStatsDeserializer(ObjectDeserializer op) { - - op.add(Builder::nodeId, JsonpDeserializer.stringDeserializer(), "node_id"); - op.add(Builder::count, JsonpDeserializer.integerDeserializer(), "count"); - op.add(Builder::hits, JsonpDeserializer.integerDeserializer(), "hits"); - op.add(Builder::hitsTimeInMillis, JsonpDeserializer.longDeserializer(), "hits_time_in_millis"); - op.add(Builder::misses, JsonpDeserializer.integerDeserializer(), "misses"); - op.add(Builder::missesTimeInMillis, JsonpDeserializer.longDeserializer(), "misses_time_in_millis"); - op.add(Builder::evictions, JsonpDeserializer.integerDeserializer(), "evictions"); - op.add(Builder::sizeInBytes, JsonpDeserializer.longDeserializer(), "size_in_bytes"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/CoordinatorStats.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/CoordinatorStats.java deleted file mode 100644 index f6df3a720..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/CoordinatorStats.java +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: enrich.stats.CoordinatorStats - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class CoordinatorStats implements JsonpSerializable { - private final long executedSearchesTotal; - - private final String nodeId; - - private final int queueSize; - - private final int remoteRequestsCurrent; - - private final long remoteRequestsTotal; - - // --------------------------------------------------------------------------------------------- - - private CoordinatorStats(Builder builder) { - - this.executedSearchesTotal = ApiTypeHelper.requireNonNull(builder.executedSearchesTotal, this, - "executedSearchesTotal"); - this.nodeId = ApiTypeHelper.requireNonNull(builder.nodeId, this, "nodeId"); - this.queueSize = ApiTypeHelper.requireNonNull(builder.queueSize, this, "queueSize"); - this.remoteRequestsCurrent = ApiTypeHelper.requireNonNull(builder.remoteRequestsCurrent, this, - "remoteRequestsCurrent"); - this.remoteRequestsTotal = ApiTypeHelper.requireNonNull(builder.remoteRequestsTotal, this, - "remoteRequestsTotal"); - - } - - public static CoordinatorStats of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code executed_searches_total} - */ - public final long executedSearchesTotal() { - return this.executedSearchesTotal; - } - - /** - * Required - API name: {@code node_id} - */ - public final String nodeId() { - return this.nodeId; - } - - /** - * Required - API name: {@code queue_size} - */ - public final int queueSize() { - return this.queueSize; - } - - /** - * Required - API name: {@code remote_requests_current} - */ - public final int remoteRequestsCurrent() { - return this.remoteRequestsCurrent; - } - - /** - * Required - API name: {@code remote_requests_total} - */ - public final long remoteRequestsTotal() { - return this.remoteRequestsTotal; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("executed_searches_total"); - generator.write(this.executedSearchesTotal); - - generator.writeKey("node_id"); - generator.write(this.nodeId); - - generator.writeKey("queue_size"); - generator.write(this.queueSize); - - generator.writeKey("remote_requests_current"); - generator.write(this.remoteRequestsCurrent); - - generator.writeKey("remote_requests_total"); - generator.write(this.remoteRequestsTotal); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link CoordinatorStats}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Long executedSearchesTotal; - - private String nodeId; - - private Integer queueSize; - - private Integer remoteRequestsCurrent; - - private Long remoteRequestsTotal; - - /** - * Required - API name: {@code executed_searches_total} - */ - public final Builder executedSearchesTotal(long value) { - this.executedSearchesTotal = value; - return this; - } - - /** - * Required - API name: {@code node_id} - */ - public final Builder nodeId(String value) { - this.nodeId = value; - return this; - } - - /** - * Required - API name: {@code queue_size} - */ - public final Builder queueSize(int value) { - this.queueSize = value; - return this; - } - - /** - * Required - API name: {@code remote_requests_current} - */ - public final Builder remoteRequestsCurrent(int value) { - this.remoteRequestsCurrent = value; - return this; - } - - /** - * Required - API name: {@code remote_requests_total} - */ - public final Builder remoteRequestsTotal(long value) { - this.remoteRequestsTotal = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link CoordinatorStats}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public CoordinatorStats build() { - _checkSingleUse(); - - return new CoordinatorStats(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link CoordinatorStats} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - CoordinatorStats::setupCoordinatorStatsDeserializer); - - protected static void setupCoordinatorStatsDeserializer(ObjectDeserializer op) { - - op.add(Builder::executedSearchesTotal, JsonpDeserializer.longDeserializer(), "executed_searches_total"); - op.add(Builder::nodeId, JsonpDeserializer.stringDeserializer(), "node_id"); - op.add(Builder::queueSize, JsonpDeserializer.integerDeserializer(), "queue_size"); - op.add(Builder::remoteRequestsCurrent, JsonpDeserializer.integerDeserializer(), "remote_requests_current"); - op.add(Builder::remoteRequestsTotal, JsonpDeserializer.longDeserializer(), "remote_requests_total"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/ExecutingPolicy.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/ExecutingPolicy.java deleted file mode 100644 index 78efa6763..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/ExecutingPolicy.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.enrich.stats; - -import co.elastic.clients.elasticsearch.tasks.TaskInfo; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: enrich.stats.ExecutingPolicy - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ExecutingPolicy implements JsonpSerializable { - private final String name; - - private final TaskInfo task; - - // --------------------------------------------------------------------------------------------- - - private ExecutingPolicy(Builder builder) { - - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.task = ApiTypeHelper.requireNonNull(builder.task, this, "task"); - - } - - public static ExecutingPolicy of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Required - API name: {@code task} - */ - public final TaskInfo task() { - return this.task; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("name"); - generator.write(this.name); - - generator.writeKey("task"); - this.task.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ExecutingPolicy}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String name; - - private TaskInfo task; - - /** - * Required - API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Required - API name: {@code task} - */ - public final Builder task(TaskInfo value) { - this.task = value; - return this; - } - - /** - * Required - API name: {@code task} - */ - public final Builder task(Function> fn) { - return this.task(fn.apply(new TaskInfo.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ExecutingPolicy}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ExecutingPolicy build() { - _checkSingleUse(); - - return new ExecutingPolicy(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ExecutingPolicy} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ExecutingPolicy::setupExecutingPolicyDeserializer); - - protected static void setupExecutingPolicyDeserializer(ObjectDeserializer op) { - - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - op.add(Builder::task, TaskInfo._DESERIALIZER, "task"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/ElasticsearchEqlAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/ElasticsearchEqlAsyncClient.java deleted file mode 100644 index 9af457c16..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/ElasticsearchEqlAsyncClient.java +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.eql; - -import co.elastic.clients.ApiClient; -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.transport.ElasticsearchTransport; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.JsonEndpoint; -import co.elastic.clients.transport.Transport; -import co.elastic.clients.transport.TransportOptions; -import co.elastic.clients.transport.endpoints.EndpointWithResponseMapperAttr; -import co.elastic.clients.util.ObjectBuilder; -import java.lang.reflect.Type; -import java.util.concurrent.CompletableFuture; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Client for the eql namespace. - */ -public class ElasticsearchEqlAsyncClient extends ApiClient { - - public ElasticsearchEqlAsyncClient(ElasticsearchTransport transport) { - super(transport, null); - } - - public ElasticsearchEqlAsyncClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { - super(transport, transportOptions); - } - - @Override - public ElasticsearchEqlAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) { - return new ElasticsearchEqlAsyncClient(this.transport, transportOptions); - } - - // ----- Endpoint: eql.delete - - /** - * Deletes an async EQL search or a stored synchronous EQL search. The API also - * deletes results for the search. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture delete(EqlDeleteRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) EqlDeleteRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Deletes an async EQL search or a stored synchronous EQL search. The API also - * deletes results for the search. - * - * @param fn - * a function that initializes a builder to create the - * {@link EqlDeleteRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture delete( - Function> fn) { - return delete(fn.apply(new EqlDeleteRequest.Builder()).build()); - } - - // ----- Endpoint: eql.get - - /** - * Returns the current status and available results for an async EQL search or a - * stored synchronous EQL search. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> get(EqlGetRequest request, Class tEventClass) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) EqlGetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:eql.get.Response.TEvent", getDeserializer(tEventClass)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Returns the current status and available results for an async EQL search or a - * stored synchronous EQL search. - * - * @param fn - * a function that initializes a builder to create the - * {@link EqlGetRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> get( - Function> fn, Class tEventClass) { - return get(fn.apply(new EqlGetRequest.Builder()).build(), tEventClass); - } - - /** - * Returns the current status and available results for an async EQL search or a - * stored synchronous EQL search. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> get(EqlGetRequest request, Type tEventType) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) EqlGetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:eql.get.Response.TEvent", getDeserializer(tEventType)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Returns the current status and available results for an async EQL search or a - * stored synchronous EQL search. - * - * @param fn - * a function that initializes a builder to create the - * {@link EqlGetRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> get( - Function> fn, Type tEventType) { - return get(fn.apply(new EqlGetRequest.Builder()).build(), tEventType); - } - - // ----- Endpoint: eql.get_status - - /** - * Returns the current status for an async EQL search or a stored synchronous - * EQL search without returning results. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture getStatus(GetEqlStatusRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetEqlStatusRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Returns the current status for an async EQL search or a stored synchronous - * EQL search without returning results. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetEqlStatusRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture getStatus( - Function> fn) { - return getStatus(fn.apply(new GetEqlStatusRequest.Builder()).build()); - } - - // ----- Endpoint: eql.search - - /** - * Returns results matching a query expressed in Event Query Language (EQL) - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> search(EqlSearchRequest request, - Class tEventClass) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) EqlSearchRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:eql.search.Response.TEvent", getDeserializer(tEventClass)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Returns results matching a query expressed in Event Query Language (EQL) - * - * @param fn - * a function that initializes a builder to create the - * {@link EqlSearchRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> search( - Function> fn, Class tEventClass) { - return search(fn.apply(new EqlSearchRequest.Builder()).build(), tEventClass); - } - - /** - * Returns results matching a query expressed in Event Query Language (EQL) - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture> search(EqlSearchRequest request, Type tEventType) { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) EqlSearchRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:eql.search.Response.TEvent", getDeserializer(tEventType)); - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Returns results matching a query expressed in Event Query Language (EQL) - * - * @param fn - * a function that initializes a builder to create the - * {@link EqlSearchRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture> search( - Function> fn, Type tEventType) { - return search(fn.apply(new EqlSearchRequest.Builder()).build(), tEventType); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/ElasticsearchEqlClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/ElasticsearchEqlClient.java deleted file mode 100644 index 5de6aa5b6..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/ElasticsearchEqlClient.java +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.eql; - -import co.elastic.clients.ApiClient; -import co.elastic.clients.elasticsearch._types.ElasticsearchException; -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.transport.ElasticsearchTransport; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.JsonEndpoint; -import co.elastic.clients.transport.Transport; -import co.elastic.clients.transport.TransportOptions; -import co.elastic.clients.transport.endpoints.EndpointWithResponseMapperAttr; -import co.elastic.clients.util.ObjectBuilder; -import java.io.IOException; -import java.lang.reflect.Type; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Client for the eql namespace. - */ -public class ElasticsearchEqlClient extends ApiClient { - - public ElasticsearchEqlClient(ElasticsearchTransport transport) { - super(transport, null); - } - - public ElasticsearchEqlClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { - super(transport, transportOptions); - } - - @Override - public ElasticsearchEqlClient withTransportOptions(@Nullable TransportOptions transportOptions) { - return new ElasticsearchEqlClient(this.transport, transportOptions); - } - - // ----- Endpoint: eql.delete - - /** - * Deletes an async EQL search or a stored synchronous EQL search. The API also - * deletes results for the search. - * - * @see Documentation - * on elastic.co - */ - - public EqlDeleteResponse delete(EqlDeleteRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) EqlDeleteRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Deletes an async EQL search or a stored synchronous EQL search. The API also - * deletes results for the search. - * - * @param fn - * a function that initializes a builder to create the - * {@link EqlDeleteRequest} - * @see Documentation - * on elastic.co - */ - - public final EqlDeleteResponse delete(Function> fn) - throws IOException, ElasticsearchException { - return delete(fn.apply(new EqlDeleteRequest.Builder()).build()); - } - - // ----- Endpoint: eql.get - - /** - * Returns the current status and available results for an async EQL search or a - * stored synchronous EQL search. - * - * @see Documentation - * on elastic.co - */ - - public EqlGetResponse get(EqlGetRequest request, Class tEventClass) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) EqlGetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:eql.get.Response.TEvent", getDeserializer(tEventClass)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Returns the current status and available results for an async EQL search or a - * stored synchronous EQL search. - * - * @param fn - * a function that initializes a builder to create the - * {@link EqlGetRequest} - * @see Documentation - * on elastic.co - */ - - public final EqlGetResponse get(Function> fn, - Class tEventClass) throws IOException, ElasticsearchException { - return get(fn.apply(new EqlGetRequest.Builder()).build(), tEventClass); - } - - /** - * Returns the current status and available results for an async EQL search or a - * stored synchronous EQL search. - * - * @see Documentation - * on elastic.co - */ - - public EqlGetResponse get(EqlGetRequest request, Type tEventType) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) EqlGetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:eql.get.Response.TEvent", getDeserializer(tEventType)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Returns the current status and available results for an async EQL search or a - * stored synchronous EQL search. - * - * @param fn - * a function that initializes a builder to create the - * {@link EqlGetRequest} - * @see Documentation - * on elastic.co - */ - - public final EqlGetResponse get(Function> fn, - Type tEventType) throws IOException, ElasticsearchException { - return get(fn.apply(new EqlGetRequest.Builder()).build(), tEventType); - } - - // ----- Endpoint: eql.get_status - - /** - * Returns the current status for an async EQL search or a stored synchronous - * EQL search without returning results. - * - * @see Documentation - * on elastic.co - */ - - public GetEqlStatusResponse getStatus(GetEqlStatusRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetEqlStatusRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Returns the current status for an async EQL search or a stored synchronous - * EQL search without returning results. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetEqlStatusRequest} - * @see Documentation - * on elastic.co - */ - - public final GetEqlStatusResponse getStatus( - Function> fn) - throws IOException, ElasticsearchException { - return getStatus(fn.apply(new GetEqlStatusRequest.Builder()).build()); - } - - // ----- Endpoint: eql.search - - /** - * Returns results matching a query expressed in Event Query Language (EQL) - * - * @see Documentation - * on elastic.co - */ - - public EqlSearchResponse search(EqlSearchRequest request, Class tEventClass) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) EqlSearchRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:eql.search.Response.TEvent", getDeserializer(tEventClass)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Returns results matching a query expressed in Event Query Language (EQL) - * - * @param fn - * a function that initializes a builder to create the - * {@link EqlSearchRequest} - * @see Documentation - * on elastic.co - */ - - public final EqlSearchResponse search( - Function> fn, Class tEventClass) - throws IOException, ElasticsearchException { - return search(fn.apply(new EqlSearchRequest.Builder()).build(), tEventClass); - } - - /** - * Returns results matching a query expressed in Event Query Language (EQL) - * - * @see Documentation - * on elastic.co - */ - - public EqlSearchResponse search(EqlSearchRequest request, Type tEventType) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) EqlSearchRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:eql.search.Response.TEvent", getDeserializer(tEventType)); - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Returns results matching a query expressed in Event Query Language (EQL) - * - * @param fn - * a function that initializes a builder to create the - * {@link EqlSearchRequest} - * @see Documentation - * on elastic.co - */ - - public final EqlSearchResponse search( - Function> fn, Type tEventType) - throws IOException, ElasticsearchException { - return search(fn.apply(new EqlSearchRequest.Builder()).build(), tEventType); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlDeleteRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlDeleteRequest.java deleted file mode 100644 index 79d4e352a..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlDeleteRequest.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.eql; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: eql.delete.Request - -/** - * Deletes an async EQL search or a stored synchronous EQL search. The API also - * deletes results for the search. - * - * @see API - * specification - */ - -public class EqlDeleteRequest extends RequestBase { - private final String id; - - // --------------------------------------------------------------------------------------------- - - private EqlDeleteRequest(Builder builder) { - - this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); - - } - - public static EqlDeleteRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Identifier for the search to delete. A search ID is provided in - * the EQL search API's response for an async search. A search ID is also - * provided if the request’s keep_on_completion parameter is - * true. - *

- * API name: {@code id} - */ - public final String id() { - return this.id; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link EqlDeleteRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - private String id; - - /** - * Required - Identifier for the search to delete. A search ID is provided in - * the EQL search API's response for an async search. A search ID is also - * provided if the request’s keep_on_completion parameter is - * true. - *

- * API name: {@code id} - */ - public final Builder id(String value) { - this.id = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link EqlDeleteRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public EqlDeleteRequest build() { - _checkSingleUse(); - - return new EqlDeleteRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code eql.delete}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/eql.delete", - - // Request method - request -> { - return "DELETE"; - - }, - - // Request path - request -> { - final int _id = 1 << 0; - - int propsSet = 0; - - propsSet |= _id; - - if (propsSet == (_id)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_eql"); - buf.append("/search"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.id, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _id = 1 << 0; - - int propsSet = 0; - - propsSet |= _id; - - if (propsSet == (_id)) { - params.put("id", request.id); - } - return params; - }, - - // Request parameters - request -> { - return Collections.emptyMap(); - - }, SimpleEndpoint.emptyMap(), false, EqlDeleteResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlDeleteResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlDeleteResponse.java deleted file mode 100644 index 21106c574..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlDeleteResponse.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.eql; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: eql.delete.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class EqlDeleteResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private EqlDeleteResponse(Builder builder) { - super(builder); - - } - - public static EqlDeleteResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link EqlDeleteResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link EqlDeleteResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public EqlDeleteResponse build() { - _checkSingleUse(); - - return new EqlDeleteResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link EqlDeleteResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, EqlDeleteResponse::setupEqlDeleteResponseDeserializer); - - protected static void setupEqlDeleteResponseDeserializer(ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlGetRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlGetRequest.java deleted file mode 100644 index dfb379ee1..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlGetRequest.java +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.eql; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: eql.get.Request - -/** - * Returns the current status and available results for an async EQL search or a - * stored synchronous EQL search. - * - * @see API - * specification - */ - -public class EqlGetRequest extends RequestBase { - private final String id; - - @Nullable - private final Time keepAlive; - - @Nullable - private final Time waitForCompletionTimeout; - - // --------------------------------------------------------------------------------------------- - - private EqlGetRequest(Builder builder) { - - this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); - this.keepAlive = builder.keepAlive; - this.waitForCompletionTimeout = builder.waitForCompletionTimeout; - - } - - public static EqlGetRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Identifier for the search. - *

- * API name: {@code id} - */ - public final String id() { - return this.id; - } - - /** - * Period for which the search and its results are stored on the cluster. - * Defaults to the keep_alive value set by the search’s EQL search API request. - *

- * API name: {@code keep_alive} - */ - @Nullable - public final Time keepAlive() { - return this.keepAlive; - } - - /** - * Timeout duration to wait for the request to finish. Defaults to no timeout, - * meaning the request waits for complete search results. - *

- * API name: {@code wait_for_completion_timeout} - */ - @Nullable - public final Time waitForCompletionTimeout() { - return this.waitForCompletionTimeout; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link EqlGetRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { - private String id; - - @Nullable - private Time keepAlive; - - @Nullable - private Time waitForCompletionTimeout; - - /** - * Required - Identifier for the search. - *

- * API name: {@code id} - */ - public final Builder id(String value) { - this.id = value; - return this; - } - - /** - * Period for which the search and its results are stored on the cluster. - * Defaults to the keep_alive value set by the search’s EQL search API request. - *

- * API name: {@code keep_alive} - */ - public final Builder keepAlive(@Nullable Time value) { - this.keepAlive = value; - return this; - } - - /** - * Period for which the search and its results are stored on the cluster. - * Defaults to the keep_alive value set by the search’s EQL search API request. - *

- * API name: {@code keep_alive} - */ - public final Builder keepAlive(Function> fn) { - return this.keepAlive(fn.apply(new Time.Builder()).build()); - } - - /** - * Timeout duration to wait for the request to finish. Defaults to no timeout, - * meaning the request waits for complete search results. - *

- * API name: {@code wait_for_completion_timeout} - */ - public final Builder waitForCompletionTimeout(@Nullable Time value) { - this.waitForCompletionTimeout = value; - return this; - } - - /** - * Timeout duration to wait for the request to finish. Defaults to no timeout, - * meaning the request waits for complete search results. - *

- * API name: {@code wait_for_completion_timeout} - */ - public final Builder waitForCompletionTimeout(Function> fn) { - return this.waitForCompletionTimeout(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link EqlGetRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public EqlGetRequest build() { - _checkSingleUse(); - - return new EqlGetRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code eql.get}". - */ - public static final SimpleEndpoint _ENDPOINT = new SimpleEndpoint<>("es/eql.get", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _id = 1 << 0; - - int propsSet = 0; - - propsSet |= _id; - - if (propsSet == (_id)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_eql"); - buf.append("/search"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.id, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _id = 1 << 0; - - int propsSet = 0; - - propsSet |= _id; - - if (propsSet == (_id)) { - params.put("id", request.id); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.keepAlive != null) { - params.put("keep_alive", request.keepAlive._toJsonString()); - } - if (request.waitForCompletionTimeout != null) { - params.put("wait_for_completion_timeout", request.waitForCompletionTimeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, EqlGetResponse._DESERIALIZER); - - /** - * Create an "{@code eql.get}" endpoint. - */ - public static Endpoint, ErrorResponse> createGetEndpoint( - JsonpDeserializer tEventDeserializer) { - return _ENDPOINT.withResponseDeserializer(EqlGetResponse.createEqlGetResponseDeserializer(tEventDeserializer)); - } -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlGetResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlGetResponse.java deleted file mode 100644 index e06025629..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlGetResponse.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.eql; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.NamedDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import java.util.function.Supplier; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: eql.get.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class EqlGetResponse extends EqlSearchResponseBase { - // --------------------------------------------------------------------------------------------- - - private EqlGetResponse(Builder builder) { - super(builder); - - } - - public static EqlGetResponse of( - Function, ObjectBuilder>> fn) { - return fn.apply(new Builder<>()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link EqlGetResponse}. - */ - - public static class Builder extends EqlSearchResponseBase.AbstractBuilder> - implements - ObjectBuilder> { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link EqlGetResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public EqlGetResponse build() { - _checkSingleUse(); - - return new EqlGetResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Create a JSON deserializer for EqlGetResponse - */ - public static JsonpDeserializer> createEqlGetResponseDeserializer( - JsonpDeserializer tEventDeserializer) { - return ObjectBuilderDeserializer.createForObject((Supplier>) Builder::new, - op -> EqlGetResponse.setupEqlGetResponseDeserializer(op, tEventDeserializer)); - }; - - /** - * Json deserializer for {@link EqlGetResponse} based on named deserializers - * provided by the calling {@code JsonMapper}. - */ - public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer - .lazy(() -> createEqlGetResponseDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:eql.get.Response.TEvent"))); - - protected static void setupEqlGetResponseDeserializer( - ObjectDeserializer> op, JsonpDeserializer tEventDeserializer) { - EqlSearchResponseBase.setupEqlSearchResponseBaseDeserializer(op, tEventDeserializer); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlHits.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlHits.java deleted file mode 100644 index b1731fb74..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlHits.java +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.eql; - -import co.elastic.clients.elasticsearch.core.search.TotalHits; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpSerializer; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.NamedDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import java.util.function.Supplier; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: eql._types.EqlHits - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class EqlHits implements JsonpSerializable { - @Nullable - private final TotalHits total; - - private final List> events; - - private final List> sequences; - - @Nullable - private final JsonpSerializer tEventSerializer; - - // --------------------------------------------------------------------------------------------- - - private EqlHits(Builder builder) { - - this.total = builder.total; - this.events = ApiTypeHelper.unmodifiable(builder.events); - this.sequences = ApiTypeHelper.unmodifiable(builder.sequences); - this.tEventSerializer = builder.tEventSerializer; - - } - - public static EqlHits of(Function, ObjectBuilder>> fn) { - return fn.apply(new Builder<>()).build(); - } - - /** - * Metadata about the number of matching events or sequences. - *

- * API name: {@code total} - */ - @Nullable - public final TotalHits total() { - return this.total; - } - - /** - * Contains events matching the query. Each object represents a matching event. - *

- * API name: {@code events} - */ - public final List> events() { - return this.events; - } - - /** - * Contains event sequences matching the query. Each object represents a - * matching sequence. This parameter is only returned for EQL queries containing - * a sequence. - *

- * API name: {@code sequences} - */ - public final List> sequences() { - return this.sequences; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.total != null) { - generator.writeKey("total"); - this.total.serialize(generator, mapper); - - } - if (ApiTypeHelper.isDefined(this.events)) { - generator.writeKey("events"); - generator.writeStartArray(); - for (HitsEvent item0 : this.events) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.sequences)) { - generator.writeKey("sequences"); - generator.writeStartArray(); - for (HitsSequence item0 : this.sequences) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link EqlHits}. - */ - - public static class Builder extends WithJsonObjectBuilderBase> - implements - ObjectBuilder> { - @Nullable - private TotalHits total; - - @Nullable - private List> events; - - @Nullable - private List> sequences; - - @Nullable - private JsonpSerializer tEventSerializer; - - /** - * Metadata about the number of matching events or sequences. - *

- * API name: {@code total} - */ - public final Builder total(@Nullable TotalHits value) { - this.total = value; - return this; - } - - /** - * Metadata about the number of matching events or sequences. - *

- * API name: {@code total} - */ - public final Builder total(Function> fn) { - return this.total(fn.apply(new TotalHits.Builder()).build()); - } - - /** - * Contains events matching the query. Each object represents a matching event. - *

- * API name: {@code events} - *

- * Adds all elements of list to events. - */ - public final Builder events(List> list) { - this.events = _listAddAll(this.events, list); - return this; - } - - /** - * Contains events matching the query. Each object represents a matching event. - *

- * API name: {@code events} - *

- * Adds one or more values to events. - */ - public final Builder events(HitsEvent value, HitsEvent... values) { - this.events = _listAdd(this.events, value, values); - return this; - } - - /** - * Contains events matching the query. Each object represents a matching event. - *

- * API name: {@code events} - *

- * Adds a value to events using a builder lambda. - */ - public final Builder events(Function, ObjectBuilder>> fn) { - return events(fn.apply(new HitsEvent.Builder()).build()); - } - - /** - * Contains event sequences matching the query. Each object represents a - * matching sequence. This parameter is only returned for EQL queries containing - * a sequence. - *

- * API name: {@code sequences} - *

- * Adds all elements of list to sequences. - */ - public final Builder sequences(List> list) { - this.sequences = _listAddAll(this.sequences, list); - return this; - } - - /** - * Contains event sequences matching the query. Each object represents a - * matching sequence. This parameter is only returned for EQL queries containing - * a sequence. - *

- * API name: {@code sequences} - *

- * Adds one or more values to sequences. - */ - public final Builder sequences(HitsSequence value, HitsSequence... values) { - this.sequences = _listAdd(this.sequences, value, values); - return this; - } - - /** - * Contains event sequences matching the query. Each object represents a - * matching sequence. This parameter is only returned for EQL queries containing - * a sequence. - *

- * API name: {@code sequences} - *

- * Adds a value to sequences using a builder lambda. - */ - public final Builder sequences( - Function, ObjectBuilder>> fn) { - return sequences(fn.apply(new HitsSequence.Builder()).build()); - } - - /** - * Serializer for TEvent. If not set, an attempt will be made to find a - * serializer from the JSON context. - */ - public final Builder tEventSerializer(@Nullable JsonpSerializer value) { - this.tEventSerializer = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link EqlHits}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public EqlHits build() { - _checkSingleUse(); - - return new EqlHits(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Create a JSON deserializer for EqlHits - */ - public static JsonpDeserializer> createEqlHitsDeserializer( - JsonpDeserializer tEventDeserializer) { - return ObjectBuilderDeserializer.createForObject((Supplier>) Builder::new, - op -> EqlHits.setupEqlHitsDeserializer(op, tEventDeserializer)); - }; - - /** - * Json deserializer for {@link EqlHits} based on named deserializers provided - * by the calling {@code JsonMapper}. - */ - public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer - .lazy(() -> createEqlHitsDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:eql._types.EqlHits.TEvent"))); - - protected static void setupEqlHitsDeserializer(ObjectDeserializer> op, - JsonpDeserializer tEventDeserializer) { - - op.add(Builder::total, TotalHits._DESERIALIZER, "total"); - op.add(Builder::events, - JsonpDeserializer.arrayDeserializer(HitsEvent.createHitsEventDeserializer(tEventDeserializer)), - "events"); - op.add(Builder::sequences, - JsonpDeserializer.arrayDeserializer(HitsSequence.createHitsSequenceDeserializer(tEventDeserializer)), - "sequences"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlSearchRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlSearchRequest.java deleted file mode 100644 index 4002a1336..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlSearchRequest.java +++ /dev/null @@ -1,875 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.eql; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.elasticsearch._types.mapping.RuntimeField; -import co.elastic.clients.elasticsearch._types.query_dsl.FieldAndFormat; -import co.elastic.clients.elasticsearch._types.query_dsl.Query; -import co.elastic.clients.elasticsearch.eql.search.ResultPosition; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Number; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: eql.search.Request - -/** - * Returns results matching a query expressed in Event Query Language (EQL) - * - * @see API - * specification - */ -@JsonpDeserializable -public class EqlSearchRequest extends RequestBase implements JsonpSerializable { - @Nullable - private final Boolean allowNoIndices; - - @Nullable - private final Boolean caseSensitive; - - @Nullable - private final String eventCategoryField; - - private final List expandWildcards; - - @Nullable - private final Number fetchSize; - - private final List fields; - - private final List filter; - - @Nullable - private final Boolean ignoreUnavailable; - - private final List index; - - @Nullable - private final Time keepAlive; - - @Nullable - private final Boolean keepOnCompletion; - - private final String query; - - @Nullable - private final ResultPosition resultPosition; - - private final Map runtimeMappings; - - @Nullable - private final Number size; - - @Nullable - private final String tiebreakerField; - - @Nullable - private final String timestampField; - - @Nullable - private final Time waitForCompletionTimeout; - - // --------------------------------------------------------------------------------------------- - - private EqlSearchRequest(Builder builder) { - - this.allowNoIndices = builder.allowNoIndices; - this.caseSensitive = builder.caseSensitive; - this.eventCategoryField = builder.eventCategoryField; - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.fetchSize = builder.fetchSize; - this.fields = ApiTypeHelper.unmodifiable(builder.fields); - this.filter = ApiTypeHelper.unmodifiable(builder.filter); - this.ignoreUnavailable = builder.ignoreUnavailable; - this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); - this.keepAlive = builder.keepAlive; - this.keepOnCompletion = builder.keepOnCompletion; - this.query = ApiTypeHelper.requireNonNull(builder.query, this, "query"); - this.resultPosition = builder.resultPosition; - this.runtimeMappings = ApiTypeHelper.unmodifiable(builder.runtimeMappings); - this.size = builder.size; - this.tiebreakerField = builder.tiebreakerField; - this.timestampField = builder.timestampField; - this.waitForCompletionTimeout = builder.waitForCompletionTimeout; - - } - - public static EqlSearchRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code allow_no_indices} - */ - @Nullable - public final Boolean allowNoIndices() { - return this.allowNoIndices; - } - - /** - * API name: {@code case_sensitive} - */ - @Nullable - public final Boolean caseSensitive() { - return this.caseSensitive; - } - - /** - * Field containing the event classification, such as process, file, or network. - *

- * API name: {@code event_category_field} - */ - @Nullable - public final String eventCategoryField() { - return this.eventCategoryField; - } - - /** - * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * Maximum number of events to search at a time for sequence queries. - *

- * API name: {@code fetch_size} - */ - @Nullable - public final Number fetchSize() { - return this.fetchSize; - } - - /** - * Array of wildcard (*) patterns. The response returns values for field names - * matching these patterns in the fields property of each hit. - *

- * API name: {@code fields} - */ - public final List fields() { - return this.fields; - } - - /** - * Query, written in Query DSL, used to filter the events on which the EQL query - * runs. - *

- * API name: {@code filter} - */ - public final List filter() { - return this.filter; - } - - /** - * If true, missing or closed indices are not included in the response. - *

- * API name: {@code ignore_unavailable} - */ - @Nullable - public final Boolean ignoreUnavailable() { - return this.ignoreUnavailable; - } - - /** - * Required - The name of the index to scope the operation - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - /** - * API name: {@code keep_alive} - */ - @Nullable - public final Time keepAlive() { - return this.keepAlive; - } - - /** - * API name: {@code keep_on_completion} - */ - @Nullable - public final Boolean keepOnCompletion() { - return this.keepOnCompletion; - } - - /** - * Required - EQL query you wish to run. - *

- * API name: {@code query} - */ - public final String query() { - return this.query; - } - - /** - * API name: {@code result_position} - */ - @Nullable - public final ResultPosition resultPosition() { - return this.resultPosition; - } - - /** - * API name: {@code runtime_mappings} - */ - public final Map runtimeMappings() { - return this.runtimeMappings; - } - - /** - * For basic queries, the maximum number of matching events to return. Defaults - * to 10 - *

- * API name: {@code size} - */ - @Nullable - public final Number size() { - return this.size; - } - - /** - * Field used to sort hits with the same timestamp in ascending order - *

- * API name: {@code tiebreaker_field} - */ - @Nullable - public final String tiebreakerField() { - return this.tiebreakerField; - } - - /** - * Field containing event timestamp. Default "@timestamp" - *

- * API name: {@code timestamp_field} - */ - @Nullable - public final String timestampField() { - return this.timestampField; - } - - /** - * API name: {@code wait_for_completion_timeout} - */ - @Nullable - public final Time waitForCompletionTimeout() { - return this.waitForCompletionTimeout; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.caseSensitive != null) { - generator.writeKey("case_sensitive"); - generator.write(this.caseSensitive); - - } - if (this.eventCategoryField != null) { - generator.writeKey("event_category_field"); - generator.write(this.eventCategoryField); - - } - if (this.fetchSize != null) { - generator.writeKey("fetch_size"); - generator.write(this.fetchSize.doubleValue()); - - } - if (ApiTypeHelper.isDefined(this.fields)) { - generator.writeKey("fields"); - generator.writeStartArray(); - for (FieldAndFormat item0 : this.fields) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.filter)) { - generator.writeKey("filter"); - generator.writeStartArray(); - for (Query item0 : this.filter) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.keepAlive != null) { - generator.writeKey("keep_alive"); - this.keepAlive.serialize(generator, mapper); - - } - if (this.keepOnCompletion != null) { - generator.writeKey("keep_on_completion"); - generator.write(this.keepOnCompletion); - - } - generator.writeKey("query"); - generator.write(this.query); - - if (this.resultPosition != null) { - generator.writeKey("result_position"); - this.resultPosition.serialize(generator, mapper); - } - if (ApiTypeHelper.isDefined(this.runtimeMappings)) { - generator.writeKey("runtime_mappings"); - generator.writeStartObject(); - for (Map.Entry item0 : this.runtimeMappings.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.size != null) { - generator.writeKey("size"); - generator.write(this.size.doubleValue()); - - } - if (this.tiebreakerField != null) { - generator.writeKey("tiebreaker_field"); - generator.write(this.tiebreakerField); - - } - if (this.timestampField != null) { - generator.writeKey("timestamp_field"); - generator.write(this.timestampField); - - } - if (this.waitForCompletionTimeout != null) { - generator.writeKey("wait_for_completion_timeout"); - this.waitForCompletionTimeout.serialize(generator, mapper); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link EqlSearchRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Boolean allowNoIndices; - - @Nullable - private Boolean caseSensitive; - - @Nullable - private String eventCategoryField; - - @Nullable - private List expandWildcards; - - @Nullable - private Number fetchSize; - - @Nullable - private List fields; - - @Nullable - private List filter; - - @Nullable - private Boolean ignoreUnavailable; - - private List index; - - @Nullable - private Time keepAlive; - - @Nullable - private Boolean keepOnCompletion; - - private String query; - - @Nullable - private ResultPosition resultPosition; - - @Nullable - private Map runtimeMappings; - - @Nullable - private Number size; - - @Nullable - private String tiebreakerField; - - @Nullable - private String timestampField; - - @Nullable - private Time waitForCompletionTimeout; - - /** - * API name: {@code allow_no_indices} - */ - public final Builder allowNoIndices(@Nullable Boolean value) { - this.allowNoIndices = value; - return this; - } - - /** - * API name: {@code case_sensitive} - */ - public final Builder caseSensitive(@Nullable Boolean value) { - this.caseSensitive = value; - return this; - } - - /** - * Field containing the event classification, such as process, file, or network. - *

- * API name: {@code event_category_field} - */ - public final Builder eventCategoryField(@Nullable String value) { - this.eventCategoryField = value; - return this; - } - - /** - * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * Maximum number of events to search at a time for sequence queries. - *

- * API name: {@code fetch_size} - */ - public final Builder fetchSize(@Nullable Number value) { - this.fetchSize = value; - return this; - } - - /** - * Array of wildcard (*) patterns. The response returns values for field names - * matching these patterns in the fields property of each hit. - *

- * API name: {@code fields} - *

- * Adds all elements of list to fields. - */ - public final Builder fields(List list) { - this.fields = _listAddAll(this.fields, list); - return this; - } - - /** - * Array of wildcard (*) patterns. The response returns values for field names - * matching these patterns in the fields property of each hit. - *

- * API name: {@code fields} - *

- * Adds one or more values to fields. - */ - public final Builder fields(FieldAndFormat value, FieldAndFormat... values) { - this.fields = _listAdd(this.fields, value, values); - return this; - } - - /** - * Array of wildcard (*) patterns. The response returns values for field names - * matching these patterns in the fields property of each hit. - *

- * API name: {@code fields} - *

- * Adds a value to fields using a builder lambda. - */ - public final Builder fields(Function> fn) { - return fields(fn.apply(new FieldAndFormat.Builder()).build()); - } - - /** - * Query, written in Query DSL, used to filter the events on which the EQL query - * runs. - *

- * API name: {@code filter} - *

- * Adds all elements of list to filter. - */ - public final Builder filter(List list) { - this.filter = _listAddAll(this.filter, list); - return this; - } - - /** - * Query, written in Query DSL, used to filter the events on which the EQL query - * runs. - *

- * API name: {@code filter} - *

- * Adds one or more values to filter. - */ - public final Builder filter(Query value, Query... values) { - this.filter = _listAdd(this.filter, value, values); - return this; - } - - /** - * Query, written in Query DSL, used to filter the events on which the EQL query - * runs. - *

- * API name: {@code filter} - *

- * Adds a value to filter using a builder lambda. - */ - public final Builder filter(Function> fn) { - return filter(fn.apply(new Query.Builder()).build()); - } - - /** - * If true, missing or closed indices are not included in the response. - *

- * API name: {@code ignore_unavailable} - */ - public final Builder ignoreUnavailable(@Nullable Boolean value) { - this.ignoreUnavailable = value; - return this; - } - - /** - * Required - The name of the index to scope the operation - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * Required - The name of the index to scope the operation - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - /** - * API name: {@code keep_alive} - */ - public final Builder keepAlive(@Nullable Time value) { - this.keepAlive = value; - return this; - } - - /** - * API name: {@code keep_alive} - */ - public final Builder keepAlive(Function> fn) { - return this.keepAlive(fn.apply(new Time.Builder()).build()); - } - - /** - * API name: {@code keep_on_completion} - */ - public final Builder keepOnCompletion(@Nullable Boolean value) { - this.keepOnCompletion = value; - return this; - } - - /** - * Required - EQL query you wish to run. - *

- * API name: {@code query} - */ - public final Builder query(String value) { - this.query = value; - return this; - } - - /** - * API name: {@code result_position} - */ - public final Builder resultPosition(@Nullable ResultPosition value) { - this.resultPosition = value; - return this; - } - - /** - * API name: {@code runtime_mappings} - *

- * Adds all entries of map to runtimeMappings. - */ - public final Builder runtimeMappings(Map map) { - this.runtimeMappings = _mapPutAll(this.runtimeMappings, map); - return this; - } - - /** - * API name: {@code runtime_mappings} - *

- * Adds an entry to runtimeMappings. - */ - public final Builder runtimeMappings(String key, RuntimeField value) { - this.runtimeMappings = _mapPut(this.runtimeMappings, key, value); - return this; - } - - /** - * API name: {@code runtime_mappings} - *

- * Adds an entry to runtimeMappings using a builder lambda. - */ - public final Builder runtimeMappings(String key, - Function> fn) { - return runtimeMappings(key, fn.apply(new RuntimeField.Builder()).build()); - } - - /** - * For basic queries, the maximum number of matching events to return. Defaults - * to 10 - *

- * API name: {@code size} - */ - public final Builder size(@Nullable Number value) { - this.size = value; - return this; - } - - /** - * Field used to sort hits with the same timestamp in ascending order - *

- * API name: {@code tiebreaker_field} - */ - public final Builder tiebreakerField(@Nullable String value) { - this.tiebreakerField = value; - return this; - } - - /** - * Field containing event timestamp. Default "@timestamp" - *

- * API name: {@code timestamp_field} - */ - public final Builder timestampField(@Nullable String value) { - this.timestampField = value; - return this; - } - - /** - * API name: {@code wait_for_completion_timeout} - */ - public final Builder waitForCompletionTimeout(@Nullable Time value) { - this.waitForCompletionTimeout = value; - return this; - } - - /** - * API name: {@code wait_for_completion_timeout} - */ - public final Builder waitForCompletionTimeout(Function> fn) { - return this.waitForCompletionTimeout(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link EqlSearchRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public EqlSearchRequest build() { - _checkSingleUse(); - - return new EqlSearchRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link EqlSearchRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - EqlSearchRequest::setupEqlSearchRequestDeserializer); - - protected static void setupEqlSearchRequestDeserializer(ObjectDeserializer op) { - - op.add(Builder::caseSensitive, JsonpDeserializer.booleanDeserializer(), "case_sensitive"); - op.add(Builder::eventCategoryField, JsonpDeserializer.stringDeserializer(), "event_category_field"); - op.add(Builder::fetchSize, JsonpDeserializer.numberDeserializer(), "fetch_size"); - op.add(Builder::fields, JsonpDeserializer.arrayDeserializer(FieldAndFormat._DESERIALIZER), "fields"); - op.add(Builder::filter, JsonpDeserializer.arrayDeserializer(Query._DESERIALIZER), "filter"); - op.add(Builder::keepAlive, Time._DESERIALIZER, "keep_alive"); - op.add(Builder::keepOnCompletion, JsonpDeserializer.booleanDeserializer(), "keep_on_completion"); - op.add(Builder::query, JsonpDeserializer.stringDeserializer(), "query"); - op.add(Builder::resultPosition, ResultPosition._DESERIALIZER, "result_position"); - op.add(Builder::runtimeMappings, JsonpDeserializer.stringMapDeserializer(RuntimeField._DESERIALIZER), - "runtime_mappings"); - op.add(Builder::size, JsonpDeserializer.numberDeserializer(), "size"); - op.add(Builder::tiebreakerField, JsonpDeserializer.stringDeserializer(), "tiebreaker_field"); - op.add(Builder::timestampField, JsonpDeserializer.stringDeserializer(), "timestamp_field"); - op.add(Builder::waitForCompletionTimeout, Time._DESERIALIZER, "wait_for_completion_timeout"); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code eql.search}". - */ - public static final SimpleEndpoint _ENDPOINT = new SimpleEndpoint<>("es/eql.search", - - // Request method - request -> { - return "POST"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_eql"); - buf.append("/search"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - return params; - - }, SimpleEndpoint.emptyMap(), true, EqlSearchResponse._DESERIALIZER); - - /** - * Create an "{@code eql.search}" endpoint. - */ - public static Endpoint, ErrorResponse> createSearchEndpoint( - JsonpDeserializer tEventDeserializer) { - return _ENDPOINT - .withResponseDeserializer(EqlSearchResponse.createEqlSearchResponseDeserializer(tEventDeserializer)); - } -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlSearchResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlSearchResponse.java deleted file mode 100644 index 0ad7f4b8d..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlSearchResponse.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.eql; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.NamedDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import java.util.function.Supplier; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: eql.search.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class EqlSearchResponse extends EqlSearchResponseBase { - // --------------------------------------------------------------------------------------------- - - private EqlSearchResponse(Builder builder) { - super(builder); - - } - - public static EqlSearchResponse of( - Function, ObjectBuilder>> fn) { - return fn.apply(new Builder<>()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link EqlSearchResponse}. - */ - - public static class Builder extends EqlSearchResponseBase.AbstractBuilder> - implements - ObjectBuilder> { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link EqlSearchResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public EqlSearchResponse build() { - _checkSingleUse(); - - return new EqlSearchResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Create a JSON deserializer for EqlSearchResponse - */ - public static JsonpDeserializer> createEqlSearchResponseDeserializer( - JsonpDeserializer tEventDeserializer) { - return ObjectBuilderDeserializer.createForObject((Supplier>) Builder::new, - op -> EqlSearchResponse.setupEqlSearchResponseDeserializer(op, tEventDeserializer)); - }; - - /** - * Json deserializer for {@link EqlSearchResponse} based on named deserializers - * provided by the calling {@code JsonMapper}. - */ - public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer - .lazy(() -> createEqlSearchResponseDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:eql.search.Response.TEvent"))); - - protected static void setupEqlSearchResponseDeserializer( - ObjectDeserializer> op, JsonpDeserializer tEventDeserializer) { - EqlSearchResponseBase.setupEqlSearchResponseBaseDeserializer(op, tEventDeserializer); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlSearchResponseBase.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlSearchResponseBase.java deleted file mode 100644 index 558bd99fd..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlSearchResponseBase.java +++ /dev/null @@ -1,326 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.eql; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpSerializer; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: eql._types.EqlSearchResponseBase - -/** - * - * @see API - * specification - */ - -public abstract class EqlSearchResponseBase implements JsonpSerializable { - @Nullable - private final String id; - - @Nullable - private final Boolean isPartial; - - @Nullable - private final Boolean isRunning; - - @Nullable - private final Long took; - - @Nullable - private final Boolean timedOut; - - private final EqlHits hits; - - @Nullable - private final JsonpSerializer tEventSerializer; - - // --------------------------------------------------------------------------------------------- - - protected EqlSearchResponseBase(AbstractBuilder builder) { - - this.id = builder.id; - this.isPartial = builder.isPartial; - this.isRunning = builder.isRunning; - this.took = builder.took; - this.timedOut = builder.timedOut; - this.hits = ApiTypeHelper.requireNonNull(builder.hits, this, "hits"); - this.tEventSerializer = builder.tEventSerializer; - - } - - /** - * Identifier for the search. - *

- * API name: {@code id} - */ - @Nullable - public final String id() { - return this.id; - } - - /** - * If true, the response does not contain complete search results. - *

- * API name: {@code is_partial} - */ - @Nullable - public final Boolean isPartial() { - return this.isPartial; - } - - /** - * If true, the search request is still executing. - *

- * API name: {@code is_running} - */ - @Nullable - public final Boolean isRunning() { - return this.isRunning; - } - - /** - * Milliseconds it took Elasticsearch to execute the request. - *

- * API name: {@code took} - */ - @Nullable - public final Long took() { - return this.took; - } - - /** - * If true, the request timed out before completion. - *

- * API name: {@code timed_out} - */ - @Nullable - public final Boolean timedOut() { - return this.timedOut; - } - - /** - * Required - Contains matching events and sequences. Also contains related - * metadata. - *

- * API name: {@code hits} - */ - public final EqlHits hits() { - return this.hits; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.id != null) { - generator.writeKey("id"); - generator.write(this.id); - - } - if (this.isPartial != null) { - generator.writeKey("is_partial"); - generator.write(this.isPartial); - - } - if (this.isRunning != null) { - generator.writeKey("is_running"); - generator.write(this.isRunning); - - } - if (this.took != null) { - generator.writeKey("took"); - generator.write(this.took); - - } - if (this.timedOut != null) { - generator.writeKey("timed_out"); - generator.write(this.timedOut); - - } - generator.writeKey("hits"); - this.hits.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - public abstract static class AbstractBuilder> - extends - WithJsonObjectBuilderBase { - @Nullable - private String id; - - @Nullable - private Boolean isPartial; - - @Nullable - private Boolean isRunning; - - @Nullable - private Long took; - - @Nullable - private Boolean timedOut; - - private EqlHits hits; - - @Nullable - private JsonpSerializer tEventSerializer; - - /** - * Identifier for the search. - *

- * API name: {@code id} - */ - public final BuilderT id(@Nullable String value) { - this.id = value; - return self(); - } - - /** - * If true, the response does not contain complete search results. - *

- * API name: {@code is_partial} - */ - public final BuilderT isPartial(@Nullable Boolean value) { - this.isPartial = value; - return self(); - } - - /** - * If true, the search request is still executing. - *

- * API name: {@code is_running} - */ - public final BuilderT isRunning(@Nullable Boolean value) { - this.isRunning = value; - return self(); - } - - /** - * Milliseconds it took Elasticsearch to execute the request. - *

- * API name: {@code took} - */ - public final BuilderT took(@Nullable Long value) { - this.took = value; - return self(); - } - - /** - * If true, the request timed out before completion. - *

- * API name: {@code timed_out} - */ - public final BuilderT timedOut(@Nullable Boolean value) { - this.timedOut = value; - return self(); - } - - /** - * Required - Contains matching events and sequences. Also contains related - * metadata. - *

- * API name: {@code hits} - */ - public final BuilderT hits(EqlHits value) { - this.hits = value; - return self(); - } - - /** - * Required - Contains matching events and sequences. Also contains related - * metadata. - *

- * API name: {@code hits} - */ - public final BuilderT hits(Function, ObjectBuilder>> fn) { - return this.hits(fn.apply(new EqlHits.Builder()).build()); - } - - /** - * Serializer for TEvent. If not set, an attempt will be made to find a - * serializer from the JSON context. - */ - public final BuilderT tEventSerializer(@Nullable JsonpSerializer value) { - this.tEventSerializer = value; - return self(); - } - - protected abstract BuilderT self(); - - } - - // --------------------------------------------------------------------------------------------- - protected static > void setupEqlSearchResponseBaseDeserializer( - ObjectDeserializer op, JsonpDeserializer tEventDeserializer) { - - op.add(AbstractBuilder::id, JsonpDeserializer.stringDeserializer(), "id"); - op.add(AbstractBuilder::isPartial, JsonpDeserializer.booleanDeserializer(), "is_partial"); - op.add(AbstractBuilder::isRunning, JsonpDeserializer.booleanDeserializer(), "is_running"); - op.add(AbstractBuilder::took, JsonpDeserializer.longDeserializer(), "took"); - op.add(AbstractBuilder::timedOut, JsonpDeserializer.booleanDeserializer(), "timed_out"); - op.add(AbstractBuilder::hits, EqlHits.createEqlHitsDeserializer(tEventDeserializer), "hits"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/GetEqlStatusRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/GetEqlStatusRequest.java deleted file mode 100644 index 2d6aeec92..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/GetEqlStatusRequest.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.eql; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: eql.get_status.Request - -/** - * Returns the current status for an async EQL search or a stored synchronous - * EQL search without returning results. - * - * @see API - * specification - */ - -public class GetEqlStatusRequest extends RequestBase { - private final String id; - - // --------------------------------------------------------------------------------------------- - - private GetEqlStatusRequest(Builder builder) { - - this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); - - } - - public static GetEqlStatusRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Identifier for the search. - *

- * API name: {@code id} - */ - public final String id() { - return this.id; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetEqlStatusRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - private String id; - - /** - * Required - Identifier for the search. - *

- * API name: {@code id} - */ - public final Builder id(String value) { - this.id = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetEqlStatusRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetEqlStatusRequest build() { - _checkSingleUse(); - - return new GetEqlStatusRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code eql.get_status}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/eql.get_status", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _id = 1 << 0; - - int propsSet = 0; - - propsSet |= _id; - - if (propsSet == (_id)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_eql"); - buf.append("/search"); - buf.append("/status"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.id, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _id = 1 << 0; - - int propsSet = 0; - - propsSet |= _id; - - if (propsSet == (_id)) { - params.put("id", request.id); - } - return params; - }, - - // Request parameters - request -> { - return Collections.emptyMap(); - - }, SimpleEndpoint.emptyMap(), false, GetEqlStatusResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/GetEqlStatusResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/GetEqlStatusResponse.java deleted file mode 100644 index 470814175..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/GetEqlStatusResponse.java +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.eql; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Integer; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: eql.get_status.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class GetEqlStatusResponse implements JsonpSerializable { - private final String id; - - private final boolean isPartial; - - private final boolean isRunning; - - @Nullable - private final Long startTimeInMillis; - - @Nullable - private final Long expirationTimeInMillis; - - @Nullable - private final Integer completionStatus; - - // --------------------------------------------------------------------------------------------- - - private GetEqlStatusResponse(Builder builder) { - - this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); - this.isPartial = ApiTypeHelper.requireNonNull(builder.isPartial, this, "isPartial"); - this.isRunning = ApiTypeHelper.requireNonNull(builder.isRunning, this, "isRunning"); - this.startTimeInMillis = builder.startTimeInMillis; - this.expirationTimeInMillis = builder.expirationTimeInMillis; - this.completionStatus = builder.completionStatus; - - } - - public static GetEqlStatusResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Identifier for the search. - *

- * API name: {@code id} - */ - public final String id() { - return this.id; - } - - /** - * Required - If true, the search request is still executing. If false, the - * search is completed. - *

- * API name: {@code is_partial} - */ - public final boolean isPartial() { - return this.isPartial; - } - - /** - * Required - If true, the response does not contain complete search results. - * This could be because either the search is still running (is_running status - * is false), or because it is already completed (is_running status is true) and - * results are partial due to failures or timeouts. - *

- * API name: {@code is_running} - */ - public final boolean isRunning() { - return this.isRunning; - } - - /** - * For a running search shows a timestamp when the eql search started, in - * milliseconds since the Unix epoch. - *

- * API name: {@code start_time_in_millis} - */ - @Nullable - public final Long startTimeInMillis() { - return this.startTimeInMillis; - } - - /** - * Shows a timestamp when the eql search will be expired, in milliseconds since - * the Unix epoch. When this time is reached, the search and its results are - * deleted, even if the search is still ongoing. - *

- * API name: {@code expiration_time_in_millis} - */ - @Nullable - public final Long expirationTimeInMillis() { - return this.expirationTimeInMillis; - } - - /** - * For a completed search shows the http status code of the completed search. - *

- * API name: {@code completion_status} - */ - @Nullable - public final Integer completionStatus() { - return this.completionStatus; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("id"); - generator.write(this.id); - - generator.writeKey("is_partial"); - generator.write(this.isPartial); - - generator.writeKey("is_running"); - generator.write(this.isRunning); - - if (this.startTimeInMillis != null) { - generator.writeKey("start_time_in_millis"); - generator.write(this.startTimeInMillis); - - } - if (this.expirationTimeInMillis != null) { - generator.writeKey("expiration_time_in_millis"); - generator.write(this.expirationTimeInMillis); - - } - if (this.completionStatus != null) { - generator.writeKey("completion_status"); - generator.write(this.completionStatus); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetEqlStatusResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private String id; - - private Boolean isPartial; - - private Boolean isRunning; - - @Nullable - private Long startTimeInMillis; - - @Nullable - private Long expirationTimeInMillis; - - @Nullable - private Integer completionStatus; - - /** - * Required - Identifier for the search. - *

- * API name: {@code id} - */ - public final Builder id(String value) { - this.id = value; - return this; - } - - /** - * Required - If true, the search request is still executing. If false, the - * search is completed. - *

- * API name: {@code is_partial} - */ - public final Builder isPartial(boolean value) { - this.isPartial = value; - return this; - } - - /** - * Required - If true, the response does not contain complete search results. - * This could be because either the search is still running (is_running status - * is false), or because it is already completed (is_running status is true) and - * results are partial due to failures or timeouts. - *

- * API name: {@code is_running} - */ - public final Builder isRunning(boolean value) { - this.isRunning = value; - return this; - } - - /** - * For a running search shows a timestamp when the eql search started, in - * milliseconds since the Unix epoch. - *

- * API name: {@code start_time_in_millis} - */ - public final Builder startTimeInMillis(@Nullable Long value) { - this.startTimeInMillis = value; - return this; - } - - /** - * Shows a timestamp when the eql search will be expired, in milliseconds since - * the Unix epoch. When this time is reached, the search and its results are - * deleted, even if the search is still ongoing. - *

- * API name: {@code expiration_time_in_millis} - */ - public final Builder expirationTimeInMillis(@Nullable Long value) { - this.expirationTimeInMillis = value; - return this; - } - - /** - * For a completed search shows the http status code of the completed search. - *

- * API name: {@code completion_status} - */ - public final Builder completionStatus(@Nullable Integer value) { - this.completionStatus = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetEqlStatusResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetEqlStatusResponse build() { - _checkSingleUse(); - - return new GetEqlStatusResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link GetEqlStatusResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, GetEqlStatusResponse::setupGetEqlStatusResponseDeserializer); - - protected static void setupGetEqlStatusResponseDeserializer(ObjectDeserializer op) { - - op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id"); - op.add(Builder::isPartial, JsonpDeserializer.booleanDeserializer(), "is_partial"); - op.add(Builder::isRunning, JsonpDeserializer.booleanDeserializer(), "is_running"); - op.add(Builder::startTimeInMillis, JsonpDeserializer.longDeserializer(), "start_time_in_millis"); - op.add(Builder::expirationTimeInMillis, JsonpDeserializer.longDeserializer(), "expiration_time_in_millis"); - op.add(Builder::completionStatus, JsonpDeserializer.integerDeserializer(), "completion_status"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/HitsEvent.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/HitsEvent.java deleted file mode 100644 index cc2b5bf01..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/HitsEvent.java +++ /dev/null @@ -1,342 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.eql; - -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpSerializer; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.NamedDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.function.Supplier; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: eql._types.HitsEvent - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class HitsEvent implements JsonpSerializable { - private final String index; - - private final String id; - - private final TEvent source; - - @Nullable - private final Boolean missing; - - private final Map> fields; - - @Nullable - private final JsonpSerializer tEventSerializer; - - // --------------------------------------------------------------------------------------------- - - private HitsEvent(Builder builder) { - - this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); - this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); - this.source = ApiTypeHelper.requireNonNull(builder.source, this, "source"); - this.missing = builder.missing; - this.fields = ApiTypeHelper.unmodifiable(builder.fields); - this.tEventSerializer = builder.tEventSerializer; - - } - - public static HitsEvent of(Function, ObjectBuilder>> fn) { - return fn.apply(new Builder<>()).build(); - } - - /** - * Required - Name of the index containing the event. - *

- * API name: {@code _index} - */ - public final String index() { - return this.index; - } - - /** - * Required - Unique identifier for the event. This ID is only unique within the - * index. - *

- * API name: {@code _id} - */ - public final String id() { - return this.id; - } - - /** - * Required - Original JSON body passed for the event at index time. - *

- * API name: {@code _source} - */ - public final TEvent source() { - return this.source; - } - - /** - * Set to true for events in a timespan-constrained sequence that - * do not meet a given condition. - *

- * API name: {@code missing} - */ - @Nullable - public final Boolean missing() { - return this.missing; - } - - /** - * API name: {@code fields} - */ - public final Map> fields() { - return this.fields; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("_index"); - generator.write(this.index); - - generator.writeKey("_id"); - generator.write(this.id); - - generator.writeKey("_source"); - JsonpUtils.serialize(this.source, generator, tEventSerializer, mapper); - - if (this.missing != null) { - generator.writeKey("missing"); - generator.write(this.missing); - - } - if (ApiTypeHelper.isDefined(this.fields)) { - generator.writeKey("fields"); - generator.writeStartObject(); - for (Map.Entry> item0 : this.fields.entrySet()) { - generator.writeKey(item0.getKey()); - generator.writeStartArray(); - if (item0.getValue() != null) { - for (JsonData item1 : item0.getValue()) { - item1.serialize(generator, mapper); - - } - } - generator.writeEnd(); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link HitsEvent}. - */ - - public static class Builder extends WithJsonObjectBuilderBase> - implements - ObjectBuilder> { - private String index; - - private String id; - - private TEvent source; - - @Nullable - private Boolean missing; - - @Nullable - private Map> fields; - - @Nullable - private JsonpSerializer tEventSerializer; - - /** - * Required - Name of the index containing the event. - *

- * API name: {@code _index} - */ - public final Builder index(String value) { - this.index = value; - return this; - } - - /** - * Required - Unique identifier for the event. This ID is only unique within the - * index. - *

- * API name: {@code _id} - */ - public final Builder id(String value) { - this.id = value; - return this; - } - - /** - * Required - Original JSON body passed for the event at index time. - *

- * API name: {@code _source} - */ - public final Builder source(TEvent value) { - this.source = value; - return this; - } - - /** - * Set to true for events in a timespan-constrained sequence that - * do not meet a given condition. - *

- * API name: {@code missing} - */ - public final Builder missing(@Nullable Boolean value) { - this.missing = value; - return this; - } - - /** - * API name: {@code fields} - *

- * Adds all entries of map to fields. - */ - public final Builder fields(Map> map) { - this.fields = _mapPutAll(this.fields, map); - return this; - } - - /** - * API name: {@code fields} - *

- * Adds an entry to fields. - */ - public final Builder fields(String key, List value) { - this.fields = _mapPut(this.fields, key, value); - return this; - } - - /** - * Serializer for TEvent. If not set, an attempt will be made to find a - * serializer from the JSON context. - */ - public final Builder tEventSerializer(@Nullable JsonpSerializer value) { - this.tEventSerializer = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link HitsEvent}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public HitsEvent build() { - _checkSingleUse(); - - return new HitsEvent(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Create a JSON deserializer for HitsEvent - */ - public static JsonpDeserializer> createHitsEventDeserializer( - JsonpDeserializer tEventDeserializer) { - return ObjectBuilderDeserializer.createForObject((Supplier>) Builder::new, - op -> HitsEvent.setupHitsEventDeserializer(op, tEventDeserializer)); - }; - - /** - * Json deserializer for {@link HitsEvent} based on named deserializers provided - * by the calling {@code JsonMapper}. - */ - public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer - .lazy(() -> createHitsEventDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:eql._types.HitsEvent.TEvent"))); - - protected static void setupHitsEventDeserializer(ObjectDeserializer> op, - JsonpDeserializer tEventDeserializer) { - - op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "_index"); - op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "_id"); - op.add(Builder::source, tEventDeserializer, "_source"); - op.add(Builder::missing, JsonpDeserializer.booleanDeserializer(), "missing"); - op.add(Builder::fields, - JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.arrayDeserializer(JsonData._DESERIALIZER)), - "fields"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/HitsSequence.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/HitsSequence.java deleted file mode 100644 index a5fc9e355..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/HitsSequence.java +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.eql; - -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpSerializer; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.NamedDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import java.util.function.Supplier; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: eql._types.HitsSequence - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class HitsSequence implements JsonpSerializable { - private final List> events; - - private final List joinKeys; - - @Nullable - private final JsonpSerializer tEventSerializer; - - // --------------------------------------------------------------------------------------------- - - private HitsSequence(Builder builder) { - - this.events = ApiTypeHelper.unmodifiableRequired(builder.events, this, "events"); - this.joinKeys = ApiTypeHelper.unmodifiable(builder.joinKeys); - this.tEventSerializer = builder.tEventSerializer; - - } - - public static HitsSequence of(Function, ObjectBuilder>> fn) { - return fn.apply(new Builder<>()).build(); - } - - /** - * Required - Contains events matching the query. Each object represents a - * matching event. - *

- * API name: {@code events} - */ - public final List> events() { - return this.events; - } - - /** - * Shared field values used to constrain matches in the sequence. These are - * defined using the by keyword in the EQL query syntax. - *

- * API name: {@code join_keys} - */ - public final List joinKeys() { - return this.joinKeys; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.events)) { - generator.writeKey("events"); - generator.writeStartArray(); - for (HitsEvent item0 : this.events) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.joinKeys)) { - generator.writeKey("join_keys"); - generator.writeStartArray(); - for (JsonData item0 : this.joinKeys) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link HitsSequence}. - */ - - public static class Builder extends WithJsonObjectBuilderBase> - implements - ObjectBuilder> { - private List> events; - - @Nullable - private List joinKeys; - - @Nullable - private JsonpSerializer tEventSerializer; - - /** - * Required - Contains events matching the query. Each object represents a - * matching event. - *

- * API name: {@code events} - *

- * Adds all elements of list to events. - */ - public final Builder events(List> list) { - this.events = _listAddAll(this.events, list); - return this; - } - - /** - * Required - Contains events matching the query. Each object represents a - * matching event. - *

- * API name: {@code events} - *

- * Adds one or more values to events. - */ - public final Builder events(HitsEvent value, HitsEvent... values) { - this.events = _listAdd(this.events, value, values); - return this; - } - - /** - * Required - Contains events matching the query. Each object represents a - * matching event. - *

- * API name: {@code events} - *

- * Adds a value to events using a builder lambda. - */ - public final Builder events(Function, ObjectBuilder>> fn) { - return events(fn.apply(new HitsEvent.Builder()).build()); - } - - /** - * Shared field values used to constrain matches in the sequence. These are - * defined using the by keyword in the EQL query syntax. - *

- * API name: {@code join_keys} - *

- * Adds all elements of list to joinKeys. - */ - public final Builder joinKeys(List list) { - this.joinKeys = _listAddAll(this.joinKeys, list); - return this; - } - - /** - * Shared field values used to constrain matches in the sequence. These are - * defined using the by keyword in the EQL query syntax. - *

- * API name: {@code join_keys} - *

- * Adds one or more values to joinKeys. - */ - public final Builder joinKeys(JsonData value, JsonData... values) { - this.joinKeys = _listAdd(this.joinKeys, value, values); - return this; - } - - /** - * Serializer for TEvent. If not set, an attempt will be made to find a - * serializer from the JSON context. - */ - public final Builder tEventSerializer(@Nullable JsonpSerializer value) { - this.tEventSerializer = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link HitsSequence}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public HitsSequence build() { - _checkSingleUse(); - - return new HitsSequence(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Create a JSON deserializer for HitsSequence - */ - public static JsonpDeserializer> createHitsSequenceDeserializer( - JsonpDeserializer tEventDeserializer) { - return ObjectBuilderDeserializer.createForObject((Supplier>) Builder::new, - op -> HitsSequence.setupHitsSequenceDeserializer(op, tEventDeserializer)); - }; - - /** - * Json deserializer for {@link HitsSequence} based on named deserializers - * provided by the calling {@code JsonMapper}. - */ - public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer - .lazy(() -> createHitsSequenceDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:eql._types.HitsSequence.TEvent"))); - - protected static void setupHitsSequenceDeserializer(ObjectDeserializer> op, - JsonpDeserializer tEventDeserializer) { - - op.add(Builder::events, - JsonpDeserializer.arrayDeserializer(HitsEvent.createHitsEventDeserializer(tEventDeserializer)), - "events"); - op.add(Builder::joinKeys, JsonpDeserializer.arrayDeserializer(JsonData._DESERIALIZER), "join_keys"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/search/ResultPosition.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/search/ResultPosition.java deleted file mode 100644 index c67531c4e..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/search/ResultPosition.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.eql.search; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum ResultPosition implements JsonEnum { - /** - * Return the most recent matches, similar to the Unix tail command. - */ - Tail("tail"), - - /** - * Return the earliest matches, similar to the Unix head command. - */ - Head("head"), - - ; - - private final String jsonValue; - - ResultPosition(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - ResultPosition.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/ElasticsearchEsqlAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/ElasticsearchEsqlAsyncClient.java deleted file mode 100644 index dac958485..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/ElasticsearchEsqlAsyncClient.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.esql; - -import co.elastic.clients.ApiClient; -import co.elastic.clients.elasticsearch._helpers.esql.EsqlAdapter; -import co.elastic.clients.elasticsearch._helpers.esql.EsqlHelper; -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.transport.ElasticsearchTransport; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.JsonEndpoint; -import co.elastic.clients.transport.Transport; -import co.elastic.clients.transport.TransportOptions; -import co.elastic.clients.transport.endpoints.BinaryResponse; -import co.elastic.clients.util.ObjectBuilder; -import java.util.concurrent.CompletableFuture; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Client for the esql namespace. - */ -public class ElasticsearchEsqlAsyncClient extends ApiClient { - - public ElasticsearchEsqlAsyncClient(ElasticsearchTransport transport) { - super(transport, null); - } - - public ElasticsearchEsqlAsyncClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { - super(transport, transportOptions); - } - - @Override - public ElasticsearchEsqlAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) { - return new ElasticsearchEsqlAsyncClient(this.transport, transportOptions); - } - - // ----- Endpoint: esql.query - - /** - * Executes an ES|QL request - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture query(QueryRequest request) { - @SuppressWarnings("unchecked") - Endpoint endpoint = (Endpoint) QueryRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Executes an ES|QL request - * - * @param fn - * a function that initializes a builder to create the - * {@link QueryRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture query( - Function> fn) { - return query(fn.apply(new QueryRequest.Builder()).build()); - } - - /** - * Executes an ES|QL request and adapts its result to a target type. - * - * @param adapter - * the ES|QL response adapter - * @param query - * the ES|QL query - * @param parameters - * values for query parameters, if any - */ - public final CompletableFuture query(EsqlAdapter adapter, String query, Object... parameters) { - return EsqlHelper.queryAsync(this, adapter, query, parameters); - } - - /** - * Executes an ES|QL request and adapts its result to a target type. - * - * @param adapter - * the ES|QL response adapter - * @param request - * the ES|QL request - */ - public final CompletableFuture query(EsqlAdapter adapter, QueryRequest request) { - return EsqlHelper.queryAsync(this, adapter, request); - } - - /** - * Executes an ES|QL request and adapts its result to a target type. - * - * @param adapter - * the ES|QL response adapter - * @param fn - * the ES|QL request builder - */ - public final CompletableFuture query(EsqlAdapter adapter, - Function> fn) { - return EsqlHelper.queryAsync(this, adapter, fn.apply(new QueryRequest.Builder()).build()); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/ElasticsearchEsqlClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/ElasticsearchEsqlClient.java deleted file mode 100644 index 434231f81..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/ElasticsearchEsqlClient.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.esql; - -import co.elastic.clients.ApiClient; -import co.elastic.clients.elasticsearch._helpers.esql.EsqlAdapter; -import co.elastic.clients.elasticsearch._helpers.esql.EsqlHelper; -import co.elastic.clients.elasticsearch._types.ElasticsearchException; -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.transport.ElasticsearchTransport; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.JsonEndpoint; -import co.elastic.clients.transport.Transport; -import co.elastic.clients.transport.TransportOptions; -import co.elastic.clients.transport.endpoints.BinaryResponse; -import co.elastic.clients.util.ObjectBuilder; -import java.io.IOException; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Client for the esql namespace. - */ -public class ElasticsearchEsqlClient extends ApiClient { - - public ElasticsearchEsqlClient(ElasticsearchTransport transport) { - super(transport, null); - } - - public ElasticsearchEsqlClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { - super(transport, transportOptions); - } - - @Override - public ElasticsearchEsqlClient withTransportOptions(@Nullable TransportOptions transportOptions) { - return new ElasticsearchEsqlClient(this.transport, transportOptions); - } - - // ----- Endpoint: esql.query - - /** - * Executes an ES|QL request - * - * @see Documentation - * on elastic.co - */ - - public BinaryResponse query(QueryRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - Endpoint endpoint = (Endpoint) QueryRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Executes an ES|QL request - * - * @param fn - * a function that initializes a builder to create the - * {@link QueryRequest} - * @see Documentation - * on elastic.co - */ - - public final BinaryResponse query(Function> fn) - throws IOException, ElasticsearchException { - return query(fn.apply(new QueryRequest.Builder()).build()); - } - - /** - * Executes an ES|QL request and adapts its result to a target type. - * - * @param adapter - * the ES|QL response adapter - * @param query - * the ES|QL query - * @param parameters - * values for query parameters, if any - */ - public final T query(EsqlAdapter adapter, String query, Object... parameters) - throws IOException, ElasticsearchException { - return EsqlHelper.query(this, adapter, query, parameters); - } - - /** - * Executes an ES|QL request and adapts its result to a target type. - * - * @param adapter - * the ES|QL response adapter - * @param request - * the ES|QL request - */ - public final T query(EsqlAdapter adapter, QueryRequest request) throws IOException, ElasticsearchException { - return EsqlHelper.query(this, adapter, request); - } - - /** - * Executes an ES|QL request and adapts its result to a target type. - * - * @param adapter - * the ES|QL response adapter - * @param fn - * the ES|QL request builder - */ - public final T query(EsqlAdapter adapter, Function> fn) - throws IOException, ElasticsearchException { - return query(adapter, fn.apply(new QueryRequest.Builder()).build()); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/QueryRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/QueryRequest.java deleted file mode 100644 index 70aa0079b..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/QueryRequest.java +++ /dev/null @@ -1,660 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.esql; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.FieldValue; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.query_dsl.Query; -import co.elastic.clients.elasticsearch.esql.query.EsqlFormat; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.BinaryEndpoint; -import co.elastic.clients.transport.endpoints.BinaryResponse; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: esql.query.Request - -/** - * Executes an ES|QL request - * - * @see API - * specification - */ -@JsonpDeserializable -public class QueryRequest extends RequestBase implements JsonpSerializable { - @Nullable - private final Boolean columnar; - - @Nullable - private final String delimiter; - - @Nullable - private final Boolean dropNullColumns; - - @Nullable - private final Query filter; - - @Nullable - private final EsqlFormat format; - - @Nullable - private final String locale; - - private final List params; - - @Nullable - private final Boolean profile; - - private final String query; - - private final Map> tables; - - // --------------------------------------------------------------------------------------------- - - private QueryRequest(Builder builder) { - - this.columnar = builder.columnar; - this.delimiter = builder.delimiter; - this.dropNullColumns = builder.dropNullColumns; - this.filter = builder.filter; - this.format = builder.format; - this.locale = builder.locale; - this.params = ApiTypeHelper.unmodifiable(builder.params); - this.profile = builder.profile; - this.query = ApiTypeHelper.requireNonNull(builder.query, this, "query"); - this.tables = ApiTypeHelper.unmodifiable(builder.tables); - - } - - public static QueryRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * By default, ES|QL returns results as rows. For example, FROM returns each - * individual document as one row. For the JSON, YAML, CBOR and smile formats, - * ES|QL can return the results in a columnar fashion where one row represents - * all the values of a certain column in the results. - *

- * API name: {@code columnar} - */ - @Nullable - public final Boolean columnar() { - return this.columnar; - } - - /** - * The character to use between values within a CSV row. Only valid for the CSV - * format. - *

- * API name: {@code delimiter} - */ - @Nullable - public final String delimiter() { - return this.delimiter; - } - - /** - * Should columns that are entirely null be removed from the - * columns and values portion of the results? Defaults - * to false. If true then the response will include an - * extra section under the name all_columns which has the name of - * all columns. - *

- * API name: {@code drop_null_columns} - */ - @Nullable - public final Boolean dropNullColumns() { - return this.dropNullColumns; - } - - /** - * Specify a Query DSL query in the filter parameter to filter the set of - * documents that an ES|QL query runs on. - *

- * API name: {@code filter} - */ - @Nullable - public final Query filter() { - return this.filter; - } - - /** - * A short version of the Accept header, e.g. json, yaml. - *

- * API name: {@code format} - */ - @Nullable - public final EsqlFormat format() { - return this.format; - } - - /** - * API name: {@code locale} - */ - @Nullable - public final String locale() { - return this.locale; - } - - /** - * To avoid any attempts of hacking or code injection, extract the values in a - * separate list of parameters. Use question mark placeholders (?) in the query - * string for each of the parameters. - *

- * API name: {@code params} - */ - public final List params() { - return this.params; - } - - /** - * If provided and true the response will include an extra - * profile object with information on how the query was executed. - * This information is for human debugging and its format can change at any time - * but it can give some insight into the performance of each part of the query. - *

- * API name: {@code profile} - */ - @Nullable - public final Boolean profile() { - return this.profile; - } - - /** - * Required - The ES|QL query API accepts an ES|QL query string in the query - * parameter, runs it, and returns the results. - *

- * API name: {@code query} - */ - public final String query() { - return this.query; - } - - /** - * Tables to use with the LOOKUP operation. The top level key is the table name - * and the next level key is the column name. - *

- * API name: {@code tables} - */ - public final Map> tables() { - return this.tables; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.columnar != null) { - generator.writeKey("columnar"); - generator.write(this.columnar); - - } - if (this.filter != null) { - generator.writeKey("filter"); - this.filter.serialize(generator, mapper); - - } - if (this.locale != null) { - generator.writeKey("locale"); - generator.write(this.locale); - - } - if (ApiTypeHelper.isDefined(this.params)) { - generator.writeKey("params"); - generator.writeStartArray(); - for (FieldValue item0 : this.params) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.profile != null) { - generator.writeKey("profile"); - generator.write(this.profile); - - } - generator.writeKey("query"); - generator.write(this.query); - - if (ApiTypeHelper.isDefined(this.tables)) { - generator.writeKey("tables"); - generator.writeStartObject(); - for (Map.Entry> item0 : this.tables.entrySet()) { - generator.writeKey(item0.getKey()); - generator.writeStartObject(); - if (item0.getValue() != null) { - for (Map.Entry item1 : item0.getValue().entrySet()) { - generator.writeKey(item1.getKey()); - item1.getValue().serialize(generator, mapper); - - } - } - generator.writeEnd(); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link QueryRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { - @Nullable - private Boolean columnar; - - @Nullable - private String delimiter; - - @Nullable - private Boolean dropNullColumns; - - @Nullable - private Query filter; - - @Nullable - private EsqlFormat format; - - @Nullable - private String locale; - - @Nullable - private List params; - - @Nullable - private Boolean profile; - - private String query; - - @Nullable - private Map> tables; - - /** - * By default, ES|QL returns results as rows. For example, FROM returns each - * individual document as one row. For the JSON, YAML, CBOR and smile formats, - * ES|QL can return the results in a columnar fashion where one row represents - * all the values of a certain column in the results. - *

- * API name: {@code columnar} - */ - public final Builder columnar(@Nullable Boolean value) { - this.columnar = value; - return this; - } - - /** - * The character to use between values within a CSV row. Only valid for the CSV - * format. - *

- * API name: {@code delimiter} - */ - public final Builder delimiter(@Nullable String value) { - this.delimiter = value; - return this; - } - - /** - * Should columns that are entirely null be removed from the - * columns and values portion of the results? Defaults - * to false. If true then the response will include an - * extra section under the name all_columns which has the name of - * all columns. - *

- * API name: {@code drop_null_columns} - */ - public final Builder dropNullColumns(@Nullable Boolean value) { - this.dropNullColumns = value; - return this; - } - - /** - * Specify a Query DSL query in the filter parameter to filter the set of - * documents that an ES|QL query runs on. - *

- * API name: {@code filter} - */ - public final Builder filter(@Nullable Query value) { - this.filter = value; - return this; - } - - /** - * Specify a Query DSL query in the filter parameter to filter the set of - * documents that an ES|QL query runs on. - *

- * API name: {@code filter} - */ - public final Builder filter(Function> fn) { - return this.filter(fn.apply(new Query.Builder()).build()); - } - - /** - * A short version of the Accept header, e.g. json, yaml. - *

- * API name: {@code format} - */ - public final Builder format(@Nullable EsqlFormat value) { - this.format = value; - return this; - } - - /** - * API name: {@code locale} - */ - public final Builder locale(@Nullable String value) { - this.locale = value; - return this; - } - - /** - * To avoid any attempts of hacking or code injection, extract the values in a - * separate list of parameters. Use question mark placeholders (?) in the query - * string for each of the parameters. - *

- * API name: {@code params} - *

- * Adds all elements of list to params. - */ - public final Builder params(List list) { - this.params = _listAddAll(this.params, list); - return this; - } - - /** - * To avoid any attempts of hacking or code injection, extract the values in a - * separate list of parameters. Use question mark placeholders (?) in the query - * string for each of the parameters. - *

- * API name: {@code params} - *

- * Adds one or more values to params. - */ - public final Builder params(FieldValue value, FieldValue... values) { - this.params = _listAdd(this.params, value, values); - return this; - } - - /** - * To avoid any attempts of hacking or code injection, extract the values in a - * separate list of parameters. Use question mark placeholders (?) in the query - * string for each of the parameters. - *

- * API name: {@code params} - *

- * Adds all passed values to params. - */ - public final Builder params(String value, String... values) { - this.params = _listAdd(this.params, FieldValue.of(value)); - List fieldValues = new ArrayList<>(); - for (String v : values) { - fieldValues.add(FieldValue.of(v)); - } - this.params = _listAddAll(this.params, fieldValues); - return this; - } - - /** - * To avoid any attempts of hacking or code injection, extract the values in a - * separate list of parameters. Use question mark placeholders (?) in the query - * string for each of the parameters. - *

- * API name: {@code params} - *

- * Adds all passed values to params. - */ - public final Builder params(long value, long... values) { - this.params = _listAdd(this.params, FieldValue.of(value)); - List fieldValues = new ArrayList<>(); - for (long v : values) { - fieldValues.add(FieldValue.of(v)); - } - this.params = _listAddAll(this.params, fieldValues); - return this; - } - - /** - * To avoid any attempts of hacking or code injection, extract the values in a - * separate list of parameters. Use question mark placeholders (?) in the query - * string for each of the parameters. - *

- * API name: {@code params} - *

- * Adds all passed values to params. - */ - public final Builder params(double value, double... values) { - this.params = _listAdd(this.params, FieldValue.of(value)); - List fieldValues = new ArrayList<>(); - for (double v : values) { - fieldValues.add(FieldValue.of(v)); - } - this.params = _listAddAll(this.params, fieldValues); - return this; - } - - /** - * To avoid any attempts of hacking or code injection, extract the values in a - * separate list of parameters. Use question mark placeholders (?) in the query - * string for each of the parameters. - *

- * API name: {@code params} - *

- * Adds all passed values to params. - */ - public final Builder params(boolean value, boolean... values) { - this.params = _listAdd(this.params, FieldValue.of(value)); - List fieldValues = new ArrayList<>(); - for (boolean v : values) { - fieldValues.add(FieldValue.of(v)); - } - this.params = _listAddAll(this.params, fieldValues); - return this; - } - - /** - * To avoid any attempts of hacking or code injection, extract the values in a - * separate list of parameters. Use question mark placeholders (?) in the query - * string for each of the parameters. - *

- * API name: {@code params} - *

- * Adds a value to params using a builder lambda. - */ - public final Builder params(Function> fn) { - return params(fn.apply(new FieldValue.Builder()).build()); - } - - /** - * If provided and true the response will include an extra - * profile object with information on how the query was executed. - * This information is for human debugging and its format can change at any time - * but it can give some insight into the performance of each part of the query. - *

- * API name: {@code profile} - */ - public final Builder profile(@Nullable Boolean value) { - this.profile = value; - return this; - } - - /** - * Required - The ES|QL query API accepts an ES|QL query string in the query - * parameter, runs it, and returns the results. - *

- * API name: {@code query} - */ - public final Builder query(String value) { - this.query = value; - return this; - } - - /** - * Tables to use with the LOOKUP operation. The top level key is the table name - * and the next level key is the column name. - *

- * API name: {@code tables} - *

- * Adds all entries of map to tables. - */ - public final Builder tables(Map> map) { - this.tables = _mapPutAll(this.tables, map); - return this; - } - - /** - * Tables to use with the LOOKUP operation. The top level key is the table name - * and the next level key is the column name. - *

- * API name: {@code tables} - *

- * Adds an entry to tables. - */ - public final Builder tables(String key, Map value) { - this.tables = _mapPut(this.tables, key, value); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link QueryRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public QueryRequest build() { - _checkSingleUse(); - - return new QueryRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link QueryRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - QueryRequest::setupQueryRequestDeserializer); - - protected static void setupQueryRequestDeserializer(ObjectDeserializer op) { - - op.add(Builder::columnar, JsonpDeserializer.booleanDeserializer(), "columnar"); - op.add(Builder::filter, Query._DESERIALIZER, "filter"); - op.add(Builder::locale, JsonpDeserializer.stringDeserializer(), "locale"); - op.add(Builder::params, JsonpDeserializer.arrayDeserializer(FieldValue._DESERIALIZER), "params"); - op.add(Builder::profile, JsonpDeserializer.booleanDeserializer(), "profile"); - op.add(Builder::query, JsonpDeserializer.stringDeserializer(), "query"); - op.add(Builder::tables, JsonpDeserializer - .stringMapDeserializer(JsonpDeserializer.stringMapDeserializer(TableValues._DESERIALIZER)), "tables"); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code esql.query}". - */ - public static final Endpoint _ENDPOINT = new BinaryEndpoint<>( - "es/esql.query", - - // Request method - request -> { - return "POST"; - - }, - - // Request path - request -> { - return "/_query"; - - }, - - // Path parameters - request -> { - return Collections.emptyMap(); - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.delimiter != null) { - params.put("delimiter", request.delimiter); - } - if (request.format != null) { - params.put("format", request.format.jsonValue()); - } - if (request.dropNullColumns != null) { - params.put("drop_null_columns", String.valueOf(request.dropNullColumns)); - } - return params; - - }, SimpleEndpoint.emptyMap(), true, null); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/TableValues.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/TableValues.java deleted file mode 100644 index 78c10bca9..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/TableValues.java +++ /dev/null @@ -1,343 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.esql; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.TaggedUnion; -import co.elastic.clients.util.TaggedUnionUtils; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Double; -import java.lang.Integer; -import java.lang.Long; -import java.lang.Object; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: esql._types.TableValuesContainer - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class TableValues implements TaggedUnion, JsonpSerializable { - - /** - * {@link TableValues} variant kinds. - * - * @see API - * specification - */ - - public enum Kind implements JsonEnum { - Integer("integer"), - - Keyword("keyword"), - - Long("long"), - - Double("double"), - - ; - - private final String jsonValue; - - Kind(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - } - - private final Kind _kind; - private final Object _value; - - @Override - public final Kind _kind() { - return _kind; - } - - @Override - public final Object _get() { - return _value; - } - - public TableValues(TableValuesVariant value) { - - this._kind = ApiTypeHelper.requireNonNull(value._tableValuesKind(), this, ""); - this._value = ApiTypeHelper.requireNonNull(value, this, ""); - - } - - private TableValues(Builder builder) { - - this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); - this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); - - } - - public static TableValues of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Is this variant instance of kind {@code integer}? - */ - public boolean isInteger() { - return _kind == Kind.Integer; - } - - /** - * Get the {@code integer} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code integer} kind. - */ - public List> integer() { - return TaggedUnionUtils.get(this, Kind.Integer); - } - - /** - * Is this variant instance of kind {@code keyword}? - */ - public boolean isKeyword() { - return _kind == Kind.Keyword; - } - - /** - * Get the {@code keyword} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code keyword} kind. - */ - public List> keyword() { - return TaggedUnionUtils.get(this, Kind.Keyword); - } - - /** - * Is this variant instance of kind {@code long}? - */ - public boolean isLong() { - return _kind == Kind.Long; - } - - /** - * Get the {@code long} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code long} kind. - */ - public List> long_() { - return TaggedUnionUtils.get(this, Kind.Long); - } - - /** - * Is this variant instance of kind {@code double}? - */ - public boolean isDouble() { - return _kind == Kind.Double; - } - - /** - * Get the {@code double} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code double} kind. - */ - public List> double_() { - return TaggedUnionUtils.get(this, Kind.Double); - } - - @Override - @SuppressWarnings("unchecked") - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeStartObject(); - - generator.writeKey(_kind.jsonValue()); - if (_value instanceof JsonpSerializable) { - ((JsonpSerializable) _value).serialize(generator, mapper); - } else { - switch (_kind) { - case Integer : - generator.writeStartArray(); - for (List item0 : ((List>) this._value)) { - generator.writeStartArray(); - if (item0 != null) { - for (Integer item1 : item0) { - generator.write(item1); - - } - } - generator.writeEnd(); - - } - generator.writeEnd(); - - break; - case Keyword : - generator.writeStartArray(); - for (List item0 : ((List>) this._value)) { - generator.writeStartArray(); - if (item0 != null) { - for (String item1 : item0) { - generator.write(item1); - - } - } - generator.writeEnd(); - - } - generator.writeEnd(); - - break; - case Long : - generator.writeStartArray(); - for (List item0 : ((List>) this._value)) { - generator.writeStartArray(); - if (item0 != null) { - for (Long item1 : item0) { - generator.write(item1); - - } - } - generator.writeEnd(); - - } - generator.writeEnd(); - - break; - case Double : - generator.writeStartArray(); - for (List item0 : ((List>) this._value)) { - generator.writeStartArray(); - if (item0 != null) { - for (Double item1 : item0) { - generator.write(item1); - - } - } - generator.writeEnd(); - - } - generator.writeEnd(); - - break; - } - } - - generator.writeEnd(); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Kind _kind; - private Object _value; - - @Override - protected Builder self() { - return this; - } - public ObjectBuilder integer(List> v) { - this._kind = Kind.Integer; - this._value = v; - return this; - } - - public ObjectBuilder keyword(List> v) { - this._kind = Kind.Keyword; - this._value = v; - return this; - } - - public ObjectBuilder long_(List> v) { - this._kind = Kind.Long; - this._value = v; - return this; - } - - public ObjectBuilder double_(List> v) { - this._kind = Kind.Double; - this._value = v; - return this; - } - - public TableValues build() { - _checkSingleUse(); - return new TableValues(this); - } - - } - - protected static void setupTableValuesDeserializer(ObjectDeserializer op) { - - op.add(Builder::integer, JsonpDeserializer.arrayDeserializer( - JsonpDeserializer.arrayDeserializer(JsonpDeserializer.integerDeserializer())), "integer"); - op.add(Builder::keyword, JsonpDeserializer.arrayDeserializer( - JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer())), "keyword"); - op.add(Builder::long_, JsonpDeserializer - .arrayDeserializer(JsonpDeserializer.arrayDeserializer(JsonpDeserializer.longDeserializer())), "long"); - op.add(Builder::double_, JsonpDeserializer.arrayDeserializer( - JsonpDeserializer.arrayDeserializer(JsonpDeserializer.doubleDeserializer())), "double"); - - } - - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - TableValues::setupTableValuesDeserializer, Builder::build); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/TableValuesBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/TableValuesBuilders.java deleted file mode 100644 index 54f740e44..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/TableValuesBuilders.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.esql; - -import co.elastic.clients.util.ObjectBuilder; -import java.lang.Double; -import java.lang.Integer; -import java.lang.Long; -import java.lang.String; -import java.util.List; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Builders for {@link TableValues} variants. - *

- * Variants integer, keyword, long, - * double are not available here as they don't have a dedicated - * class. Use {@link TableValues}'s builder for these. - * - */ -public class TableValuesBuilders { - private TableValuesBuilders() { - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/TableValuesVariant.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/TableValuesVariant.java deleted file mode 100644 index 7fc6bbd29..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/TableValuesVariant.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.esql; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Base interface for {@link TableValues} variants. - */ -public interface TableValuesVariant { - - TableValues.Kind _tableValuesKind(); - - default TableValues _toTableValues() { - return new TableValues(this); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/query/EsqlFormat.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/query/EsqlFormat.java deleted file mode 100644 index f8870ad48..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/query/EsqlFormat.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.esql.query; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum EsqlFormat implements JsonEnum { - Csv("csv"), - - Json("json"), - - Tsv("tsv"), - - Txt("txt"), - - Yaml("yaml"), - - Cbor("cbor"), - - Smile("smile"), - - Arrow("arrow"), - - ; - - private final String jsonValue; - - EsqlFormat(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - EsqlFormat.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Connection.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Connection.java deleted file mode 100644 index 91c1fda17..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Connection.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.graph; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Double; -import java.lang.Long; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: graph._types.Connection - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class Connection implements JsonpSerializable { - private final long docCount; - - private final long source; - - private final long target; - - private final double weight; - - // --------------------------------------------------------------------------------------------- - - private Connection(Builder builder) { - - this.docCount = ApiTypeHelper.requireNonNull(builder.docCount, this, "docCount"); - this.source = ApiTypeHelper.requireNonNull(builder.source, this, "source"); - this.target = ApiTypeHelper.requireNonNull(builder.target, this, "target"); - this.weight = ApiTypeHelper.requireNonNull(builder.weight, this, "weight"); - - } - - public static Connection of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code doc_count} - */ - public final long docCount() { - return this.docCount; - } - - /** - * Required - API name: {@code source} - */ - public final long source() { - return this.source; - } - - /** - * Required - API name: {@code target} - */ - public final long target() { - return this.target; - } - - /** - * Required - API name: {@code weight} - */ - public final double weight() { - return this.weight; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("doc_count"); - generator.write(this.docCount); - - generator.writeKey("source"); - generator.write(this.source); - - generator.writeKey("target"); - generator.write(this.target); - - generator.writeKey("weight"); - generator.write(this.weight); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link Connection}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Long docCount; - - private Long source; - - private Long target; - - private Double weight; - - /** - * Required - API name: {@code doc_count} - */ - public final Builder docCount(long value) { - this.docCount = value; - return this; - } - - /** - * Required - API name: {@code source} - */ - public final Builder source(long value) { - this.source = value; - return this; - } - - /** - * Required - API name: {@code target} - */ - public final Builder target(long value) { - this.target = value; - return this; - } - - /** - * Required - API name: {@code weight} - */ - public final Builder weight(double value) { - this.weight = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link Connection}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public Connection build() { - _checkSingleUse(); - - return new Connection(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link Connection} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - Connection::setupConnectionDeserializer); - - protected static void setupConnectionDeserializer(ObjectDeserializer op) { - - op.add(Builder::docCount, JsonpDeserializer.longDeserializer(), "doc_count"); - op.add(Builder::source, JsonpDeserializer.longDeserializer(), "source"); - op.add(Builder::target, JsonpDeserializer.longDeserializer(), "target"); - op.add(Builder::weight, JsonpDeserializer.doubleDeserializer(), "weight"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphAsyncClient.java deleted file mode 100644 index 77b0c4230..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphAsyncClient.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.graph; - -import co.elastic.clients.ApiClient; -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.transport.ElasticsearchTransport; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.JsonEndpoint; -import co.elastic.clients.transport.Transport; -import co.elastic.clients.transport.TransportOptions; -import co.elastic.clients.util.ObjectBuilder; -import java.util.concurrent.CompletableFuture; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Client for the graph namespace. - */ -public class ElasticsearchGraphAsyncClient extends ApiClient { - - public ElasticsearchGraphAsyncClient(ElasticsearchTransport transport) { - super(transport, null); - } - - public ElasticsearchGraphAsyncClient(ElasticsearchTransport transport, - @Nullable TransportOptions transportOptions) { - super(transport, transportOptions); - } - - @Override - public ElasticsearchGraphAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) { - return new ElasticsearchGraphAsyncClient(this.transport, transportOptions); - } - - // ----- Endpoint: graph.explore - - /** - * Extracts and summarizes information about the documents and terms in an - * Elasticsearch data stream or index. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture explore(ExploreRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ExploreRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Extracts and summarizes information about the documents and terms in an - * Elasticsearch data stream or index. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExploreRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture explore( - Function> fn) { - return explore(fn.apply(new ExploreRequest.Builder()).build()); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphClient.java deleted file mode 100644 index af2acaf93..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphClient.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.graph; - -import co.elastic.clients.ApiClient; -import co.elastic.clients.elasticsearch._types.ElasticsearchException; -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.transport.ElasticsearchTransport; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.JsonEndpoint; -import co.elastic.clients.transport.Transport; -import co.elastic.clients.transport.TransportOptions; -import co.elastic.clients.util.ObjectBuilder; -import java.io.IOException; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Client for the graph namespace. - */ -public class ElasticsearchGraphClient extends ApiClient { - - public ElasticsearchGraphClient(ElasticsearchTransport transport) { - super(transport, null); - } - - public ElasticsearchGraphClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { - super(transport, transportOptions); - } - - @Override - public ElasticsearchGraphClient withTransportOptions(@Nullable TransportOptions transportOptions) { - return new ElasticsearchGraphClient(this.transport, transportOptions); - } - - // ----- Endpoint: graph.explore - - /** - * Extracts and summarizes information about the documents and terms in an - * Elasticsearch data stream or index. - * - * @see Documentation - * on elastic.co - */ - - public ExploreResponse explore(ExploreRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ExploreRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Extracts and summarizes information about the documents and terms in an - * Elasticsearch data stream or index. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExploreRequest} - * @see Documentation - * on elastic.co - */ - - public final ExploreResponse explore(Function> fn) - throws IOException, ElasticsearchException { - return explore(fn.apply(new ExploreRequest.Builder()).build()); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreControls.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreControls.java deleted file mode 100644 index 80534cc9d..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreControls.java +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.graph; - -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Integer; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: graph._types.ExploreControls - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ExploreControls implements JsonpSerializable { - @Nullable - private final SampleDiversity sampleDiversity; - - @Nullable - private final Integer sampleSize; - - @Nullable - private final Time timeout; - - private final boolean useSignificance; - - // --------------------------------------------------------------------------------------------- - - private ExploreControls(Builder builder) { - - this.sampleDiversity = builder.sampleDiversity; - this.sampleSize = builder.sampleSize; - this.timeout = builder.timeout; - this.useSignificance = ApiTypeHelper.requireNonNull(builder.useSignificance, this, "useSignificance"); - - } - - public static ExploreControls of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * To avoid the top-matching documents sample being dominated by a single source - * of results, it is sometimes necessary to request diversity in the sample. You - * can do this by selecting a single-value field and setting a maximum number of - * documents per value for that field. - *

- * API name: {@code sample_diversity} - */ - @Nullable - public final SampleDiversity sampleDiversity() { - return this.sampleDiversity; - } - - /** - * Each hop considers a sample of the best-matching documents on each shard. - * Using samples improves the speed of execution and keeps exploration focused - * on meaningfully-connected terms. Very small values (less than 50) might not - * provide sufficient weight-of-evidence to identify significant connections - * between terms. Very large sample sizes can dilute the quality of the results - * and increase execution times. - *

- * API name: {@code sample_size} - */ - @Nullable - public final Integer sampleSize() { - return this.sampleSize; - } - - /** - * The length of time in milliseconds after which exploration will be halted and - * the results gathered so far are returned. This timeout is honored on a - * best-effort basis. Execution might overrun this timeout if, for example, a - * long pause is encountered while FieldData is loaded for a field. - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - /** - * Required - Filters associated terms so only those that are significantly - * associated with your query are included. - *

- * API name: {@code use_significance} - */ - public final boolean useSignificance() { - return this.useSignificance; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.sampleDiversity != null) { - generator.writeKey("sample_diversity"); - this.sampleDiversity.serialize(generator, mapper); - - } - if (this.sampleSize != null) { - generator.writeKey("sample_size"); - generator.write(this.sampleSize); - - } - if (this.timeout != null) { - generator.writeKey("timeout"); - this.timeout.serialize(generator, mapper); - - } - generator.writeKey("use_significance"); - generator.write(this.useSignificance); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ExploreControls}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private SampleDiversity sampleDiversity; - - @Nullable - private Integer sampleSize; - - @Nullable - private Time timeout; - - private Boolean useSignificance; - - /** - * To avoid the top-matching documents sample being dominated by a single source - * of results, it is sometimes necessary to request diversity in the sample. You - * can do this by selecting a single-value field and setting a maximum number of - * documents per value for that field. - *

- * API name: {@code sample_diversity} - */ - public final Builder sampleDiversity(@Nullable SampleDiversity value) { - this.sampleDiversity = value; - return this; - } - - /** - * To avoid the top-matching documents sample being dominated by a single source - * of results, it is sometimes necessary to request diversity in the sample. You - * can do this by selecting a single-value field and setting a maximum number of - * documents per value for that field. - *

- * API name: {@code sample_diversity} - */ - public final Builder sampleDiversity(Function> fn) { - return this.sampleDiversity(fn.apply(new SampleDiversity.Builder()).build()); - } - - /** - * Each hop considers a sample of the best-matching documents on each shard. - * Using samples improves the speed of execution and keeps exploration focused - * on meaningfully-connected terms. Very small values (less than 50) might not - * provide sufficient weight-of-evidence to identify significant connections - * between terms. Very large sample sizes can dilute the quality of the results - * and increase execution times. - *

- * API name: {@code sample_size} - */ - public final Builder sampleSize(@Nullable Integer value) { - this.sampleSize = value; - return this; - } - - /** - * The length of time in milliseconds after which exploration will be halted and - * the results gathered so far are returned. This timeout is honored on a - * best-effort basis. Execution might overrun this timeout if, for example, a - * long pause is encountered while FieldData is loaded for a field. - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * The length of time in milliseconds after which exploration will be halted and - * the results gathered so far are returned. This timeout is honored on a - * best-effort basis. Execution might overrun this timeout if, for example, a - * long pause is encountered while FieldData is loaded for a field. - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - Filters associated terms so only those that are significantly - * associated with your query are included. - *

- * API name: {@code use_significance} - */ - public final Builder useSignificance(boolean value) { - this.useSignificance = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ExploreControls}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ExploreControls build() { - _checkSingleUse(); - - return new ExploreControls(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ExploreControls} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ExploreControls::setupExploreControlsDeserializer); - - protected static void setupExploreControlsDeserializer(ObjectDeserializer op) { - - op.add(Builder::sampleDiversity, SampleDiversity._DESERIALIZER, "sample_diversity"); - op.add(Builder::sampleSize, JsonpDeserializer.integerDeserializer(), "sample_size"); - op.add(Builder::timeout, Time._DESERIALIZER, "timeout"); - op.add(Builder::useSignificance, JsonpDeserializer.booleanDeserializer(), "use_significance"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreRequest.java deleted file mode 100644 index 601f88927..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreRequest.java +++ /dev/null @@ -1,500 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.graph; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.elasticsearch._types.query_dsl.Query; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: graph.explore.Request - -/** - * Extracts and summarizes information about the documents and terms in an - * Elasticsearch data stream or index. - * - * @see API - * specification - */ -@JsonpDeserializable -public class ExploreRequest extends RequestBase implements JsonpSerializable { - @Nullable - private final Hop connections; - - @Nullable - private final ExploreControls controls; - - private final List index; - - @Nullable - private final Query query; - - @Nullable - private final String routing; - - @Nullable - private final Time timeout; - - private final List vertices; - - // --------------------------------------------------------------------------------------------- - - private ExploreRequest(Builder builder) { - - this.connections = builder.connections; - this.controls = builder.controls; - this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); - this.query = builder.query; - this.routing = builder.routing; - this.timeout = builder.timeout; - this.vertices = ApiTypeHelper.unmodifiable(builder.vertices); - - } - - public static ExploreRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Specifies or more fields from which you want to extract terms that are - * associated with the specified vertices. - *

- * API name: {@code connections} - */ - @Nullable - public final Hop connections() { - return this.connections; - } - - /** - * Direct the Graph API how to build the graph. - *

- * API name: {@code controls} - */ - @Nullable - public final ExploreControls controls() { - return this.controls; - } - - /** - * Required - Name of the index. - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - /** - * A seed query that identifies the documents of interest. Can be any valid - * Elasticsearch query. - *

- * API name: {@code query} - */ - @Nullable - public final Query query() { - return this.query; - } - - /** - * Custom value used to route operations to a specific shard. - *

- * API name: {@code routing} - */ - @Nullable - public final String routing() { - return this.routing; - } - - /** - * Specifies the period of time to wait for a response from each shard. If no - * response is received before the timeout expires, the request fails and - * returns an error. Defaults to no timeout. - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - /** - * Specifies one or more fields that contain the terms you want to include in - * the graph as vertices. - *

- * API name: {@code vertices} - */ - public final List vertices() { - return this.vertices; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.connections != null) { - generator.writeKey("connections"); - this.connections.serialize(generator, mapper); - - } - if (this.controls != null) { - generator.writeKey("controls"); - this.controls.serialize(generator, mapper); - - } - if (this.query != null) { - generator.writeKey("query"); - this.query.serialize(generator, mapper); - - } - if (ApiTypeHelper.isDefined(this.vertices)) { - generator.writeKey("vertices"); - generator.writeStartArray(); - for (VertexDefinition item0 : this.vertices) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ExploreRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { - @Nullable - private Hop connections; - - @Nullable - private ExploreControls controls; - - private List index; - - @Nullable - private Query query; - - @Nullable - private String routing; - - @Nullable - private Time timeout; - - @Nullable - private List vertices; - - /** - * Specifies or more fields from which you want to extract terms that are - * associated with the specified vertices. - *

- * API name: {@code connections} - */ - public final Builder connections(@Nullable Hop value) { - this.connections = value; - return this; - } - - /** - * Specifies or more fields from which you want to extract terms that are - * associated with the specified vertices. - *

- * API name: {@code connections} - */ - public final Builder connections(Function> fn) { - return this.connections(fn.apply(new Hop.Builder()).build()); - } - - /** - * Direct the Graph API how to build the graph. - *

- * API name: {@code controls} - */ - public final Builder controls(@Nullable ExploreControls value) { - this.controls = value; - return this; - } - - /** - * Direct the Graph API how to build the graph. - *

- * API name: {@code controls} - */ - public final Builder controls(Function> fn) { - return this.controls(fn.apply(new ExploreControls.Builder()).build()); - } - - /** - * Required - Name of the index. - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * Required - Name of the index. - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - /** - * A seed query that identifies the documents of interest. Can be any valid - * Elasticsearch query. - *

- * API name: {@code query} - */ - public final Builder query(@Nullable Query value) { - this.query = value; - return this; - } - - /** - * A seed query that identifies the documents of interest. Can be any valid - * Elasticsearch query. - *

- * API name: {@code query} - */ - public final Builder query(Function> fn) { - return this.query(fn.apply(new Query.Builder()).build()); - } - - /** - * Custom value used to route operations to a specific shard. - *

- * API name: {@code routing} - */ - public final Builder routing(@Nullable String value) { - this.routing = value; - return this; - } - - /** - * Specifies the period of time to wait for a response from each shard. If no - * response is received before the timeout expires, the request fails and - * returns an error. Defaults to no timeout. - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Specifies the period of time to wait for a response from each shard. If no - * response is received before the timeout expires, the request fails and - * returns an error. Defaults to no timeout. - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Specifies one or more fields that contain the terms you want to include in - * the graph as vertices. - *

- * API name: {@code vertices} - *

- * Adds all elements of list to vertices. - */ - public final Builder vertices(List list) { - this.vertices = _listAddAll(this.vertices, list); - return this; - } - - /** - * Specifies one or more fields that contain the terms you want to include in - * the graph as vertices. - *

- * API name: {@code vertices} - *

- * Adds one or more values to vertices. - */ - public final Builder vertices(VertexDefinition value, VertexDefinition... values) { - this.vertices = _listAdd(this.vertices, value, values); - return this; - } - - /** - * Specifies one or more fields that contain the terms you want to include in - * the graph as vertices. - *

- * API name: {@code vertices} - *

- * Adds a value to vertices using a builder lambda. - */ - public final Builder vertices(Function> fn) { - return vertices(fn.apply(new VertexDefinition.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ExploreRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ExploreRequest build() { - _checkSingleUse(); - - return new ExploreRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ExploreRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ExploreRequest::setupExploreRequestDeserializer); - - protected static void setupExploreRequestDeserializer(ObjectDeserializer op) { - - op.add(Builder::connections, Hop._DESERIALIZER, "connections"); - op.add(Builder::controls, ExploreControls._DESERIALIZER, "controls"); - op.add(Builder::query, Query._DESERIALIZER, "query"); - op.add(Builder::vertices, JsonpDeserializer.arrayDeserializer(VertexDefinition._DESERIALIZER), "vertices"); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code graph.explore}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/graph.explore", - - // Request method - request -> { - return "POST"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_graph"); - buf.append("/explore"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.routing != null) { - params.put("routing", request.routing); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), true, ExploreResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreResponse.java deleted file mode 100644 index 0631b2350..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreResponse.java +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.graph; - -import co.elastic.clients.elasticsearch._types.ShardFailure; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Long; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: graph.explore.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ExploreResponse implements JsonpSerializable { - private final List connections; - - private final List failures; - - private final boolean timedOut; - - private final long took; - - private final List vertices; - - // --------------------------------------------------------------------------------------------- - - private ExploreResponse(Builder builder) { - - this.connections = ApiTypeHelper.unmodifiableRequired(builder.connections, this, "connections"); - this.failures = ApiTypeHelper.unmodifiableRequired(builder.failures, this, "failures"); - this.timedOut = ApiTypeHelper.requireNonNull(builder.timedOut, this, "timedOut"); - this.took = ApiTypeHelper.requireNonNull(builder.took, this, "took"); - this.vertices = ApiTypeHelper.unmodifiableRequired(builder.vertices, this, "vertices"); - - } - - public static ExploreResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code connections} - */ - public final List connections() { - return this.connections; - } - - /** - * Required - API name: {@code failures} - */ - public final List failures() { - return this.failures; - } - - /** - * Required - API name: {@code timed_out} - */ - public final boolean timedOut() { - return this.timedOut; - } - - /** - * Required - API name: {@code took} - */ - public final long took() { - return this.took; - } - - /** - * Required - API name: {@code vertices} - */ - public final List vertices() { - return this.vertices; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.connections)) { - generator.writeKey("connections"); - generator.writeStartArray(); - for (Connection item0 : this.connections) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.failures)) { - generator.writeKey("failures"); - generator.writeStartArray(); - for (ShardFailure item0 : this.failures) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - generator.writeKey("timed_out"); - generator.write(this.timedOut); - - generator.writeKey("took"); - generator.write(this.took); - - if (ApiTypeHelper.isDefined(this.vertices)) { - generator.writeKey("vertices"); - generator.writeStartArray(); - for (Vertex item0 : this.vertices) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ExploreResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private List connections; - - private List failures; - - private Boolean timedOut; - - private Long took; - - private List vertices; - - /** - * Required - API name: {@code connections} - *

- * Adds all elements of list to connections. - */ - public final Builder connections(List list) { - this.connections = _listAddAll(this.connections, list); - return this; - } - - /** - * Required - API name: {@code connections} - *

- * Adds one or more values to connections. - */ - public final Builder connections(Connection value, Connection... values) { - this.connections = _listAdd(this.connections, value, values); - return this; - } - - /** - * Required - API name: {@code connections} - *

- * Adds a value to connections using a builder lambda. - */ - public final Builder connections(Function> fn) { - return connections(fn.apply(new Connection.Builder()).build()); - } - - /** - * Required - API name: {@code failures} - *

- * Adds all elements of list to failures. - */ - public final Builder failures(List list) { - this.failures = _listAddAll(this.failures, list); - return this; - } - - /** - * Required - API name: {@code failures} - *

- * Adds one or more values to failures. - */ - public final Builder failures(ShardFailure value, ShardFailure... values) { - this.failures = _listAdd(this.failures, value, values); - return this; - } - - /** - * Required - API name: {@code failures} - *

- * Adds a value to failures using a builder lambda. - */ - public final Builder failures(Function> fn) { - return failures(fn.apply(new ShardFailure.Builder()).build()); - } - - /** - * Required - API name: {@code timed_out} - */ - public final Builder timedOut(boolean value) { - this.timedOut = value; - return this; - } - - /** - * Required - API name: {@code took} - */ - public final Builder took(long value) { - this.took = value; - return this; - } - - /** - * Required - API name: {@code vertices} - *

- * Adds all elements of list to vertices. - */ - public final Builder vertices(List list) { - this.vertices = _listAddAll(this.vertices, list); - return this; - } - - /** - * Required - API name: {@code vertices} - *

- * Adds one or more values to vertices. - */ - public final Builder vertices(Vertex value, Vertex... values) { - this.vertices = _listAdd(this.vertices, value, values); - return this; - } - - /** - * Required - API name: {@code vertices} - *

- * Adds a value to vertices using a builder lambda. - */ - public final Builder vertices(Function> fn) { - return vertices(fn.apply(new Vertex.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ExploreResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ExploreResponse build() { - _checkSingleUse(); - - return new ExploreResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ExploreResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ExploreResponse::setupExploreResponseDeserializer); - - protected static void setupExploreResponseDeserializer(ObjectDeserializer op) { - - op.add(Builder::connections, JsonpDeserializer.arrayDeserializer(Connection._DESERIALIZER), "connections"); - op.add(Builder::failures, JsonpDeserializer.arrayDeserializer(ShardFailure._DESERIALIZER), "failures"); - op.add(Builder::timedOut, JsonpDeserializer.booleanDeserializer(), "timed_out"); - op.add(Builder::took, JsonpDeserializer.longDeserializer(), "took"); - op.add(Builder::vertices, JsonpDeserializer.arrayDeserializer(Vertex._DESERIALIZER), "vertices"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Hop.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Hop.java deleted file mode 100644 index 8429c193a..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Hop.java +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.graph; - -import co.elastic.clients.elasticsearch._types.query_dsl.Query; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: graph._types.Hop - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class Hop implements JsonpSerializable { - @Nullable - private final Hop connections; - - private final Query query; - - private final List vertices; - - // --------------------------------------------------------------------------------------------- - - private Hop(Builder builder) { - - this.connections = builder.connections; - this.query = ApiTypeHelper.requireNonNull(builder.query, this, "query"); - this.vertices = ApiTypeHelper.unmodifiableRequired(builder.vertices, this, "vertices"); - - } - - public static Hop of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Specifies one or more fields from which you want to extract terms that are - * associated with the specified vertices. - *

- * API name: {@code connections} - */ - @Nullable - public final Hop connections() { - return this.connections; - } - - /** - * Required - An optional guiding query that constrains the Graph API as it - * explores connected terms. - *

- * API name: {@code query} - */ - public final Query query() { - return this.query; - } - - /** - * Required - Contains the fields you are interested in. - *

- * API name: {@code vertices} - */ - public final List vertices() { - return this.vertices; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.connections != null) { - generator.writeKey("connections"); - this.connections.serialize(generator, mapper); - - } - generator.writeKey("query"); - this.query.serialize(generator, mapper); - - if (ApiTypeHelper.isDefined(this.vertices)) { - generator.writeKey("vertices"); - generator.writeStartArray(); - for (VertexDefinition item0 : this.vertices) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link Hop}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private Hop connections; - - private Query query; - - private List vertices; - - /** - * Specifies one or more fields from which you want to extract terms that are - * associated with the specified vertices. - *

- * API name: {@code connections} - */ - public final Builder connections(@Nullable Hop value) { - this.connections = value; - return this; - } - - /** - * Specifies one or more fields from which you want to extract terms that are - * associated with the specified vertices. - *

- * API name: {@code connections} - */ - public final Builder connections(Function> fn) { - return this.connections(fn.apply(new Hop.Builder()).build()); - } - - /** - * Required - An optional guiding query that constrains the Graph API as it - * explores connected terms. - *

- * API name: {@code query} - */ - public final Builder query(Query value) { - this.query = value; - return this; - } - - /** - * Required - An optional guiding query that constrains the Graph API as it - * explores connected terms. - *

- * API name: {@code query} - */ - public final Builder query(Function> fn) { - return this.query(fn.apply(new Query.Builder()).build()); - } - - /** - * Required - Contains the fields you are interested in. - *

- * API name: {@code vertices} - *

- * Adds all elements of list to vertices. - */ - public final Builder vertices(List list) { - this.vertices = _listAddAll(this.vertices, list); - return this; - } - - /** - * Required - Contains the fields you are interested in. - *

- * API name: {@code vertices} - *

- * Adds one or more values to vertices. - */ - public final Builder vertices(VertexDefinition value, VertexDefinition... values) { - this.vertices = _listAdd(this.vertices, value, values); - return this; - } - - /** - * Required - Contains the fields you are interested in. - *

- * API name: {@code vertices} - *

- * Adds a value to vertices using a builder lambda. - */ - public final Builder vertices(Function> fn) { - return vertices(fn.apply(new VertexDefinition.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link Hop}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public Hop build() { - _checkSingleUse(); - - return new Hop(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link Hop} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - Hop::setupHopDeserializer); - - protected static void setupHopDeserializer(ObjectDeserializer op) { - - op.add(Builder::connections, Hop._DESERIALIZER, "connections"); - op.add(Builder::query, Query._DESERIALIZER, "query"); - op.add(Builder::vertices, JsonpDeserializer.arrayDeserializer(VertexDefinition._DESERIALIZER), "vertices"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/SampleDiversity.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/SampleDiversity.java deleted file mode 100644 index f4f61e711..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/SampleDiversity.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.graph; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: graph._types.SampleDiversity - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SampleDiversity implements JsonpSerializable { - private final String field; - - private final int maxDocsPerValue; - - // --------------------------------------------------------------------------------------------- - - private SampleDiversity(Builder builder) { - - this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); - this.maxDocsPerValue = ApiTypeHelper.requireNonNull(builder.maxDocsPerValue, this, "maxDocsPerValue"); - - } - - public static SampleDiversity of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code field} - */ - public final String field() { - return this.field; - } - - /** - * Required - API name: {@code max_docs_per_value} - */ - public final int maxDocsPerValue() { - return this.maxDocsPerValue; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("field"); - generator.write(this.field); - - generator.writeKey("max_docs_per_value"); - generator.write(this.maxDocsPerValue); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SampleDiversity}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String field; - - private Integer maxDocsPerValue; - - /** - * Required - API name: {@code field} - */ - public final Builder field(String value) { - this.field = value; - return this; - } - - /** - * Required - API name: {@code max_docs_per_value} - */ - public final Builder maxDocsPerValue(int value) { - this.maxDocsPerValue = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SampleDiversity}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SampleDiversity build() { - _checkSingleUse(); - - return new SampleDiversity(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SampleDiversity} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - SampleDiversity::setupSampleDiversityDeserializer); - - protected static void setupSampleDiversityDeserializer(ObjectDeserializer op) { - - op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); - op.add(Builder::maxDocsPerValue, JsonpDeserializer.integerDeserializer(), "max_docs_per_value"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Vertex.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Vertex.java deleted file mode 100644 index 6322fcd31..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Vertex.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.graph; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Double; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: graph._types.Vertex - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class Vertex implements JsonpSerializable { - private final long depth; - - private final String field; - - private final String term; - - private final double weight; - - // --------------------------------------------------------------------------------------------- - - private Vertex(Builder builder) { - - this.depth = ApiTypeHelper.requireNonNull(builder.depth, this, "depth"); - this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); - this.term = ApiTypeHelper.requireNonNull(builder.term, this, "term"); - this.weight = ApiTypeHelper.requireNonNull(builder.weight, this, "weight"); - - } - - public static Vertex of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code depth} - */ - public final long depth() { - return this.depth; - } - - /** - * Required - API name: {@code field} - */ - public final String field() { - return this.field; - } - - /** - * Required - API name: {@code term} - */ - public final String term() { - return this.term; - } - - /** - * Required - API name: {@code weight} - */ - public final double weight() { - return this.weight; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("depth"); - generator.write(this.depth); - - generator.writeKey("field"); - generator.write(this.field); - - generator.writeKey("term"); - generator.write(this.term); - - generator.writeKey("weight"); - generator.write(this.weight); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link Vertex}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Long depth; - - private String field; - - private String term; - - private Double weight; - - /** - * Required - API name: {@code depth} - */ - public final Builder depth(long value) { - this.depth = value; - return this; - } - - /** - * Required - API name: {@code field} - */ - public final Builder field(String value) { - this.field = value; - return this; - } - - /** - * Required - API name: {@code term} - */ - public final Builder term(String value) { - this.term = value; - return this; - } - - /** - * Required - API name: {@code weight} - */ - public final Builder weight(double value) { - this.weight = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link Vertex}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public Vertex build() { - _checkSingleUse(); - - return new Vertex(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link Vertex} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - Vertex::setupVertexDeserializer); - - protected static void setupVertexDeserializer(ObjectDeserializer op) { - - op.add(Builder::depth, JsonpDeserializer.longDeserializer(), "depth"); - op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); - op.add(Builder::term, JsonpDeserializer.stringDeserializer(), "term"); - op.add(Builder::weight, JsonpDeserializer.doubleDeserializer(), "weight"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/VertexDefinition.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/VertexDefinition.java deleted file mode 100644 index f06ac89af..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/VertexDefinition.java +++ /dev/null @@ -1,382 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.graph; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.Long; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: graph._types.VertexDefinition - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class VertexDefinition implements JsonpSerializable { - private final List exclude; - - private final String field; - - private final List include; - - @Nullable - private final Long minDocCount; - - @Nullable - private final Long shardMinDocCount; - - @Nullable - private final Integer size; - - // --------------------------------------------------------------------------------------------- - - private VertexDefinition(Builder builder) { - - this.exclude = ApiTypeHelper.unmodifiable(builder.exclude); - this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); - this.include = ApiTypeHelper.unmodifiable(builder.include); - this.minDocCount = builder.minDocCount; - this.shardMinDocCount = builder.shardMinDocCount; - this.size = builder.size; - - } - - public static VertexDefinition of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Prevents the specified terms from being included in the results. - *

- * API name: {@code exclude} - */ - public final List exclude() { - return this.exclude; - } - - /** - * Required - Identifies a field in the documents of interest. - *

- * API name: {@code field} - */ - public final String field() { - return this.field; - } - - /** - * Identifies the terms of interest that form the starting points from which you - * want to spider out. - *

- * API name: {@code include} - */ - public final List include() { - return this.include; - } - - /** - * Specifies how many documents must contain a pair of terms before it is - * considered to be a useful connection. This setting acts as a certainty - * threshold. - *

- * API name: {@code min_doc_count} - */ - @Nullable - public final Long minDocCount() { - return this.minDocCount; - } - - /** - * Controls how many documents on a particular shard have to contain a pair of - * terms before the connection is returned for global consideration. - *

- * API name: {@code shard_min_doc_count} - */ - @Nullable - public final Long shardMinDocCount() { - return this.shardMinDocCount; - } - - /** - * Specifies the maximum number of vertex terms returned for each field. - *

- * API name: {@code size} - */ - @Nullable - public final Integer size() { - return this.size; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.exclude)) { - generator.writeKey("exclude"); - generator.writeStartArray(); - for (String item0 : this.exclude) { - generator.write(item0); - - } - generator.writeEnd(); - - } - generator.writeKey("field"); - generator.write(this.field); - - if (ApiTypeHelper.isDefined(this.include)) { - generator.writeKey("include"); - generator.writeStartArray(); - for (VertexInclude item0 : this.include) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.minDocCount != null) { - generator.writeKey("min_doc_count"); - generator.write(this.minDocCount); - - } - if (this.shardMinDocCount != null) { - generator.writeKey("shard_min_doc_count"); - generator.write(this.shardMinDocCount); - - } - if (this.size != null) { - generator.writeKey("size"); - generator.write(this.size); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link VertexDefinition}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private List exclude; - - private String field; - - @Nullable - private List include; - - @Nullable - private Long minDocCount; - - @Nullable - private Long shardMinDocCount; - - @Nullable - private Integer size; - - /** - * Prevents the specified terms from being included in the results. - *

- * API name: {@code exclude} - *

- * Adds all elements of list to exclude. - */ - public final Builder exclude(List list) { - this.exclude = _listAddAll(this.exclude, list); - return this; - } - - /** - * Prevents the specified terms from being included in the results. - *

- * API name: {@code exclude} - *

- * Adds one or more values to exclude. - */ - public final Builder exclude(String value, String... values) { - this.exclude = _listAdd(this.exclude, value, values); - return this; - } - - /** - * Required - Identifies a field in the documents of interest. - *

- * API name: {@code field} - */ - public final Builder field(String value) { - this.field = value; - return this; - } - - /** - * Identifies the terms of interest that form the starting points from which you - * want to spider out. - *

- * API name: {@code include} - *

- * Adds all elements of list to include. - */ - public final Builder include(List list) { - this.include = _listAddAll(this.include, list); - return this; - } - - /** - * Identifies the terms of interest that form the starting points from which you - * want to spider out. - *

- * API name: {@code include} - *

- * Adds one or more values to include. - */ - public final Builder include(VertexInclude value, VertexInclude... values) { - this.include = _listAdd(this.include, value, values); - return this; - } - - /** - * Identifies the terms of interest that form the starting points from which you - * want to spider out. - *

- * API name: {@code include} - *

- * Adds a value to include using a builder lambda. - */ - public final Builder include(Function> fn) { - return include(fn.apply(new VertexInclude.Builder()).build()); - } - - /** - * Specifies how many documents must contain a pair of terms before it is - * considered to be a useful connection. This setting acts as a certainty - * threshold. - *

- * API name: {@code min_doc_count} - */ - public final Builder minDocCount(@Nullable Long value) { - this.minDocCount = value; - return this; - } - - /** - * Controls how many documents on a particular shard have to contain a pair of - * terms before the connection is returned for global consideration. - *

- * API name: {@code shard_min_doc_count} - */ - public final Builder shardMinDocCount(@Nullable Long value) { - this.shardMinDocCount = value; - return this; - } - - /** - * Specifies the maximum number of vertex terms returned for each field. - *

- * API name: {@code size} - */ - public final Builder size(@Nullable Integer value) { - this.size = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link VertexDefinition}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public VertexDefinition build() { - _checkSingleUse(); - - return new VertexDefinition(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link VertexDefinition} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - VertexDefinition::setupVertexDefinitionDeserializer); - - protected static void setupVertexDefinitionDeserializer(ObjectDeserializer op) { - - op.add(Builder::exclude, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "exclude"); - op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); - op.add(Builder::include, JsonpDeserializer.arrayDeserializer(VertexInclude._DESERIALIZER), "include"); - op.add(Builder::minDocCount, JsonpDeserializer.longDeserializer(), "min_doc_count"); - op.add(Builder::shardMinDocCount, JsonpDeserializer.longDeserializer(), "shard_min_doc_count"); - op.add(Builder::size, JsonpDeserializer.integerDeserializer(), "size"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/VertexInclude.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/VertexInclude.java deleted file mode 100644 index 04c7203c5..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/VertexInclude.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.graph; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Double; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: graph._types.VertexInclude - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class VertexInclude implements JsonpSerializable { - private final double boost; - - private final String term; - - // --------------------------------------------------------------------------------------------- - - private VertexInclude(Builder builder) { - - this.boost = ApiTypeHelper.requireNonNull(builder.boost, this, "boost"); - this.term = ApiTypeHelper.requireNonNull(builder.term, this, "term"); - - } - - public static VertexInclude of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code boost} - */ - public final double boost() { - return this.boost; - } - - /** - * Required - API name: {@code term} - */ - public final String term() { - return this.term; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("boost"); - generator.write(this.boost); - - generator.writeKey("term"); - generator.write(this.term); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link VertexInclude}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Double boost; - - private String term; - - /** - * Required - API name: {@code boost} - */ - public final Builder boost(double value) { - this.boost = value; - return this; - } - - /** - * Required - API name: {@code term} - */ - public final Builder term(String value) { - this.term = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link VertexInclude}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public VertexInclude build() { - _checkSingleUse(); - - return new VertexInclude(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link VertexInclude} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - VertexInclude::setupVertexIncludeDeserializer); - - protected static void setupVertexIncludeDeserializer(ObjectDeserializer op) { - - op.add(Builder::boost, JsonpDeserializer.doubleDeserializer(), "boost"); - op.add(Builder::term, JsonpDeserializer.stringDeserializer(), "term"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AddBlockRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AddBlockRequest.java deleted file mode 100644 index 575697586..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AddBlockRequest.java +++ /dev/null @@ -1,407 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.elasticsearch.indices.add_block.IndicesBlockOptions; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.add_block.Request - -/** - * Add an index block. Limits the operations allowed on an index by blocking - * specific operation types. - * - * @see API - * specification - */ - -public class AddBlockRequest extends RequestBase { - @Nullable - private final Boolean allowNoIndices; - - private final IndicesBlockOptions block; - - private final List expandWildcards; - - @Nullable - private final Boolean ignoreUnavailable; - - private final String index; - - @Nullable - private final Time masterTimeout; - - @Nullable - private final Time timeout; - - // --------------------------------------------------------------------------------------------- - - private AddBlockRequest(Builder builder) { - - this.allowNoIndices = builder.allowNoIndices; - this.block = ApiTypeHelper.requireNonNull(builder.block, this, "block"); - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.ignoreUnavailable = builder.ignoreUnavailable; - this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); - this.masterTimeout = builder.masterTimeout; - this.timeout = builder.timeout; - - } - - public static AddBlockRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Whether to ignore if a wildcard indices expression resolves into no concrete - * indices. (This includes _all string or when no indices have been - * specified) - *

- * API name: {@code allow_no_indices} - */ - @Nullable - public final Boolean allowNoIndices() { - return this.allowNoIndices; - } - - /** - * Required - The block to add (one of read, write, read_only or metadata) - *

- * API name: {@code block} - */ - public final IndicesBlockOptions block() { - return this.block; - } - - /** - * Whether to expand wildcard expression to concrete indices that are open, - * closed or both. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * Whether specified concrete indices should be ignored when unavailable - * (missing or closed) - *

- * API name: {@code ignore_unavailable} - */ - @Nullable - public final Boolean ignoreUnavailable() { - return this.ignoreUnavailable; - } - - /** - * Required - A comma separated list of indices to add a block to - *

- * API name: {@code index} - */ - public final String index() { - return this.index; - } - - /** - * Specify timeout for connection to master - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Explicit operation timeout - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link AddBlockRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { - @Nullable - private Boolean allowNoIndices; - - private IndicesBlockOptions block; - - @Nullable - private List expandWildcards; - - @Nullable - private Boolean ignoreUnavailable; - - private String index; - - @Nullable - private Time masterTimeout; - - @Nullable - private Time timeout; - - /** - * Whether to ignore if a wildcard indices expression resolves into no concrete - * indices. (This includes _all string or when no indices have been - * specified) - *

- * API name: {@code allow_no_indices} - */ - public final Builder allowNoIndices(@Nullable Boolean value) { - this.allowNoIndices = value; - return this; - } - - /** - * Required - The block to add (one of read, write, read_only or metadata) - *

- * API name: {@code block} - */ - public final Builder block(IndicesBlockOptions value) { - this.block = value; - return this; - } - - /** - * Whether to expand wildcard expression to concrete indices that are open, - * closed or both. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Whether to expand wildcard expression to concrete indices that are open, - * closed or both. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * Whether specified concrete indices should be ignored when unavailable - * (missing or closed) - *

- * API name: {@code ignore_unavailable} - */ - public final Builder ignoreUnavailable(@Nullable Boolean value) { - this.ignoreUnavailable = value; - return this; - } - - /** - * Required - A comma separated list of indices to add a block to - *

- * API name: {@code index} - */ - public final Builder index(String value) { - this.index = value; - return this; - } - - /** - * Specify timeout for connection to master - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Specify timeout for connection to master - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Explicit operation timeout - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Explicit operation timeout - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link AddBlockRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public AddBlockRequest build() { - _checkSingleUse(); - - return new AddBlockRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.add_block}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.add_block", - - // Request method - request -> { - return "PUT"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - final int _block = 1 << 1; - - int propsSet = 0; - - propsSet |= _index; - propsSet |= _block; - - if (propsSet == (_index | _block)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index, buf); - buf.append("/_block"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.block.jsonValue(), buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _index = 1 << 0; - final int _block = 1 << 1; - - int propsSet = 0; - - propsSet |= _index; - propsSet |= _block; - - if (propsSet == (_index | _block)) { - params.put("index", request.index); - params.put("block", request.block.jsonValue()); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, AddBlockResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AddBlockResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AddBlockResponse.java deleted file mode 100644 index c25c87be1..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AddBlockResponse.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponse; -import co.elastic.clients.elasticsearch.indices.add_block.IndicesBlockStatus; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.add_block.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class AddBlockResponse implements AcknowledgedResponse, JsonpSerializable { - private final boolean acknowledged; - - private final boolean shardsAcknowledged; - - private final List indices; - - // --------------------------------------------------------------------------------------------- - - private AddBlockResponse(Builder builder) { - - this.acknowledged = ApiTypeHelper.requireNonNull(builder.acknowledged, this, "acknowledged"); - this.shardsAcknowledged = ApiTypeHelper.requireNonNull(builder.shardsAcknowledged, this, "shardsAcknowledged"); - this.indices = ApiTypeHelper.unmodifiableRequired(builder.indices, this, "indices"); - - } - - public static AddBlockResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code acknowledged} - */ - public final boolean acknowledged() { - return this.acknowledged; - } - - /** - * Required - API name: {@code shards_acknowledged} - */ - public final boolean shardsAcknowledged() { - return this.shardsAcknowledged; - } - - /** - * Required - API name: {@code indices} - */ - public final List indices() { - return this.indices; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("acknowledged"); - generator.write(this.acknowledged); - - generator.writeKey("shards_acknowledged"); - generator.write(this.shardsAcknowledged); - - if (ApiTypeHelper.isDefined(this.indices)) { - generator.writeKey("indices"); - generator.writeStartArray(); - for (IndicesBlockStatus item0 : this.indices) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link AddBlockResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Boolean acknowledged; - - private Boolean shardsAcknowledged; - - private List indices; - - /** - * Required - API name: {@code acknowledged} - */ - public final Builder acknowledged(boolean value) { - this.acknowledged = value; - return this; - } - - /** - * Required - API name: {@code shards_acknowledged} - */ - public final Builder shardsAcknowledged(boolean value) { - this.shardsAcknowledged = value; - return this; - } - - /** - * Required - API name: {@code indices} - *

- * Adds all elements of list to indices. - */ - public final Builder indices(List list) { - this.indices = _listAddAll(this.indices, list); - return this; - } - - /** - * Required - API name: {@code indices} - *

- * Adds one or more values to indices. - */ - public final Builder indices(IndicesBlockStatus value, IndicesBlockStatus... values) { - this.indices = _listAdd(this.indices, value, values); - return this; - } - - /** - * Required - API name: {@code indices} - *

- * Adds a value to indices using a builder lambda. - */ - public final Builder indices(Function> fn) { - return indices(fn.apply(new IndicesBlockStatus.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link AddBlockResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public AddBlockResponse build() { - _checkSingleUse(); - - return new AddBlockResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link AddBlockResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - AddBlockResponse::setupAddBlockResponseDeserializer); - - protected static void setupAddBlockResponseDeserializer(ObjectDeserializer op) { - - op.add(Builder::acknowledged, JsonpDeserializer.booleanDeserializer(), "acknowledged"); - op.add(Builder::shardsAcknowledged, JsonpDeserializer.booleanDeserializer(), "shards_acknowledged"); - op.add(Builder::indices, JsonpDeserializer.arrayDeserializer(IndicesBlockStatus._DESERIALIZER), "indices"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Alias.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Alias.java deleted file mode 100644 index 8c0790e01..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Alias.java +++ /dev/null @@ -1,344 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.query_dsl.Query; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.Alias - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class Alias implements JsonpSerializable { - @Nullable - private final Query filter; - - @Nullable - private final String indexRouting; - - @Nullable - private final Boolean isHidden; - - @Nullable - private final Boolean isWriteIndex; - - @Nullable - private final String routing; - - @Nullable - private final String searchRouting; - - // --------------------------------------------------------------------------------------------- - - private Alias(Builder builder) { - - this.filter = builder.filter; - this.indexRouting = builder.indexRouting; - this.isHidden = builder.isHidden; - this.isWriteIndex = builder.isWriteIndex; - this.routing = builder.routing; - this.searchRouting = builder.searchRouting; - - } - - public static Alias of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Query used to limit documents the alias can access. - *

- * API name: {@code filter} - */ - @Nullable - public final Query filter() { - return this.filter; - } - - /** - * Value used to route indexing operations to a specific shard. If specified, - * this overwrites the routing value for indexing operations. - *

- * API name: {@code index_routing} - */ - @Nullable - public final String indexRouting() { - return this.indexRouting; - } - - /** - * If true, the alias is hidden. All indices for the alias must - * have the same is_hidden value. - *

- * API name: {@code is_hidden} - */ - @Nullable - public final Boolean isHidden() { - return this.isHidden; - } - - /** - * If true, the index is the write index for the alias. - *

- * API name: {@code is_write_index} - */ - @Nullable - public final Boolean isWriteIndex() { - return this.isWriteIndex; - } - - /** - * Value used to route indexing and search operations to a specific shard. - *

- * API name: {@code routing} - */ - @Nullable - public final String routing() { - return this.routing; - } - - /** - * Value used to route search operations to a specific shard. If specified, this - * overwrites the routing value for search operations. - *

- * API name: {@code search_routing} - */ - @Nullable - public final String searchRouting() { - return this.searchRouting; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.filter != null) { - generator.writeKey("filter"); - this.filter.serialize(generator, mapper); - - } - if (this.indexRouting != null) { - generator.writeKey("index_routing"); - generator.write(this.indexRouting); - - } - if (this.isHidden != null) { - generator.writeKey("is_hidden"); - generator.write(this.isHidden); - - } - if (this.isWriteIndex != null) { - generator.writeKey("is_write_index"); - generator.write(this.isWriteIndex); - - } - if (this.routing != null) { - generator.writeKey("routing"); - generator.write(this.routing); - - } - if (this.searchRouting != null) { - generator.writeKey("search_routing"); - generator.write(this.searchRouting); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link Alias}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private Query filter; - - @Nullable - private String indexRouting; - - @Nullable - private Boolean isHidden; - - @Nullable - private Boolean isWriteIndex; - - @Nullable - private String routing; - - @Nullable - private String searchRouting; - - /** - * Query used to limit documents the alias can access. - *

- * API name: {@code filter} - */ - public final Builder filter(@Nullable Query value) { - this.filter = value; - return this; - } - - /** - * Query used to limit documents the alias can access. - *

- * API name: {@code filter} - */ - public final Builder filter(Function> fn) { - return this.filter(fn.apply(new Query.Builder()).build()); - } - - /** - * Value used to route indexing operations to a specific shard. If specified, - * this overwrites the routing value for indexing operations. - *

- * API name: {@code index_routing} - */ - public final Builder indexRouting(@Nullable String value) { - this.indexRouting = value; - return this; - } - - /** - * If true, the alias is hidden. All indices for the alias must - * have the same is_hidden value. - *

- * API name: {@code is_hidden} - */ - public final Builder isHidden(@Nullable Boolean value) { - this.isHidden = value; - return this; - } - - /** - * If true, the index is the write index for the alias. - *

- * API name: {@code is_write_index} - */ - public final Builder isWriteIndex(@Nullable Boolean value) { - this.isWriteIndex = value; - return this; - } - - /** - * Value used to route indexing and search operations to a specific shard. - *

- * API name: {@code routing} - */ - public final Builder routing(@Nullable String value) { - this.routing = value; - return this; - } - - /** - * Value used to route search operations to a specific shard. If specified, this - * overwrites the routing value for search operations. - *

- * API name: {@code search_routing} - */ - public final Builder searchRouting(@Nullable String value) { - this.searchRouting = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link Alias}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public Alias build() { - _checkSingleUse(); - - return new Alias(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link Alias} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - Alias::setupAliasDeserializer); - - protected static void setupAliasDeserializer(ObjectDeserializer op) { - - op.add(Builder::filter, Query._DESERIALIZER, "filter"); - op.add(Builder::indexRouting, JsonpDeserializer.stringDeserializer(), "index_routing"); - op.add(Builder::isHidden, JsonpDeserializer.booleanDeserializer(), "is_hidden"); - op.add(Builder::isWriteIndex, JsonpDeserializer.booleanDeserializer(), "is_write_index"); - op.add(Builder::routing, JsonpDeserializer.stringDeserializer(), "routing"); - op.add(Builder::searchRouting, JsonpDeserializer.stringDeserializer(), "search_routing"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AliasDefinition.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AliasDefinition.java deleted file mode 100644 index 85365490e..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AliasDefinition.java +++ /dev/null @@ -1,344 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.query_dsl.Query; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.AliasDefinition - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class AliasDefinition implements JsonpSerializable { - @Nullable - private final Query filter; - - @Nullable - private final String indexRouting; - - @Nullable - private final Boolean isWriteIndex; - - @Nullable - private final String routing; - - @Nullable - private final String searchRouting; - - @Nullable - private final Boolean isHidden; - - // --------------------------------------------------------------------------------------------- - - private AliasDefinition(Builder builder) { - - this.filter = builder.filter; - this.indexRouting = builder.indexRouting; - this.isWriteIndex = builder.isWriteIndex; - this.routing = builder.routing; - this.searchRouting = builder.searchRouting; - this.isHidden = builder.isHidden; - - } - - public static AliasDefinition of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Query used to limit documents the alias can access. - *

- * API name: {@code filter} - */ - @Nullable - public final Query filter() { - return this.filter; - } - - /** - * Value used to route indexing operations to a specific shard. If specified, - * this overwrites the routing value for indexing operations. - *

- * API name: {@code index_routing} - */ - @Nullable - public final String indexRouting() { - return this.indexRouting; - } - - /** - * If true, the index is the write index for the alias. - *

- * API name: {@code is_write_index} - */ - @Nullable - public final Boolean isWriteIndex() { - return this.isWriteIndex; - } - - /** - * Value used to route indexing and search operations to a specific shard. - *

- * API name: {@code routing} - */ - @Nullable - public final String routing() { - return this.routing; - } - - /** - * Value used to route search operations to a specific shard. If specified, this - * overwrites the routing value for search operations. - *

- * API name: {@code search_routing} - */ - @Nullable - public final String searchRouting() { - return this.searchRouting; - } - - /** - * If true, the alias is hidden. All indices for the alias must - * have the same is_hidden value. - *

- * API name: {@code is_hidden} - */ - @Nullable - public final Boolean isHidden() { - return this.isHidden; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.filter != null) { - generator.writeKey("filter"); - this.filter.serialize(generator, mapper); - - } - if (this.indexRouting != null) { - generator.writeKey("index_routing"); - generator.write(this.indexRouting); - - } - if (this.isWriteIndex != null) { - generator.writeKey("is_write_index"); - generator.write(this.isWriteIndex); - - } - if (this.routing != null) { - generator.writeKey("routing"); - generator.write(this.routing); - - } - if (this.searchRouting != null) { - generator.writeKey("search_routing"); - generator.write(this.searchRouting); - - } - if (this.isHidden != null) { - generator.writeKey("is_hidden"); - generator.write(this.isHidden); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link AliasDefinition}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private Query filter; - - @Nullable - private String indexRouting; - - @Nullable - private Boolean isWriteIndex; - - @Nullable - private String routing; - - @Nullable - private String searchRouting; - - @Nullable - private Boolean isHidden; - - /** - * Query used to limit documents the alias can access. - *

- * API name: {@code filter} - */ - public final Builder filter(@Nullable Query value) { - this.filter = value; - return this; - } - - /** - * Query used to limit documents the alias can access. - *

- * API name: {@code filter} - */ - public final Builder filter(Function> fn) { - return this.filter(fn.apply(new Query.Builder()).build()); - } - - /** - * Value used to route indexing operations to a specific shard. If specified, - * this overwrites the routing value for indexing operations. - *

- * API name: {@code index_routing} - */ - public final Builder indexRouting(@Nullable String value) { - this.indexRouting = value; - return this; - } - - /** - * If true, the index is the write index for the alias. - *

- * API name: {@code is_write_index} - */ - public final Builder isWriteIndex(@Nullable Boolean value) { - this.isWriteIndex = value; - return this; - } - - /** - * Value used to route indexing and search operations to a specific shard. - *

- * API name: {@code routing} - */ - public final Builder routing(@Nullable String value) { - this.routing = value; - return this; - } - - /** - * Value used to route search operations to a specific shard. If specified, this - * overwrites the routing value for search operations. - *

- * API name: {@code search_routing} - */ - public final Builder searchRouting(@Nullable String value) { - this.searchRouting = value; - return this; - } - - /** - * If true, the alias is hidden. All indices for the alias must - * have the same is_hidden value. - *

- * API name: {@code is_hidden} - */ - public final Builder isHidden(@Nullable Boolean value) { - this.isHidden = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link AliasDefinition}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public AliasDefinition build() { - _checkSingleUse(); - - return new AliasDefinition(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link AliasDefinition} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - AliasDefinition::setupAliasDefinitionDeserializer); - - protected static void setupAliasDefinitionDeserializer(ObjectDeserializer op) { - - op.add(Builder::filter, Query._DESERIALIZER, "filter"); - op.add(Builder::indexRouting, JsonpDeserializer.stringDeserializer(), "index_routing"); - op.add(Builder::isWriteIndex, JsonpDeserializer.booleanDeserializer(), "is_write_index"); - op.add(Builder::routing, JsonpDeserializer.stringDeserializer(), "routing"); - op.add(Builder::searchRouting, JsonpDeserializer.stringDeserializer(), "search_routing"); - op.add(Builder::isHidden, JsonpDeserializer.booleanDeserializer(), "is_hidden"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AnalyzeRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AnalyzeRequest.java deleted file mode 100644 index a53cc84ad..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AnalyzeRequest.java +++ /dev/null @@ -1,646 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.analysis.CharFilter; -import co.elastic.clients.elasticsearch._types.analysis.TokenFilter; -import co.elastic.clients.elasticsearch._types.analysis.Tokenizer; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.analyze.Request - -/** - * Performs analysis on a text string and returns the resulting tokens. - * - * @see API - * specification - */ -@JsonpDeserializable -public class AnalyzeRequest extends RequestBase implements JsonpSerializable { - @Nullable - private final String analyzer; - - private final List attributes; - - private final List charFilter; - - @Nullable - private final Boolean explain; - - @Nullable - private final String field; - - private final List filter; - - @Nullable - private final String index; - - @Nullable - private final String normalizer; - - private final List text; - - @Nullable - private final Tokenizer tokenizer; - - // --------------------------------------------------------------------------------------------- - - private AnalyzeRequest(Builder builder) { - - this.analyzer = builder.analyzer; - this.attributes = ApiTypeHelper.unmodifiable(builder.attributes); - this.charFilter = ApiTypeHelper.unmodifiable(builder.charFilter); - this.explain = builder.explain; - this.field = builder.field; - this.filter = ApiTypeHelper.unmodifiable(builder.filter); - this.index = builder.index; - this.normalizer = builder.normalizer; - this.text = ApiTypeHelper.unmodifiable(builder.text); - this.tokenizer = builder.tokenizer; - - } - - public static AnalyzeRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * The name of the analyzer that should be applied to the provided - * text. This could be a built-in analyzer, or an analyzer that’s - * been configured in the index. - *

- * API name: {@code analyzer} - */ - @Nullable - public final String analyzer() { - return this.analyzer; - } - - /** - * Array of token attributes used to filter the output of the - * explain parameter. - *

- * API name: {@code attributes} - */ - public final List attributes() { - return this.attributes; - } - - /** - * Array of character filters used to preprocess characters before the - * tokenizer. - *

- * API name: {@code char_filter} - */ - public final List charFilter() { - return this.charFilter; - } - - /** - * If true, the response includes token attributes and additional - * details. - *

- * API name: {@code explain} - */ - @Nullable - public final Boolean explain() { - return this.explain; - } - - /** - * Field used to derive the analyzer. To use this parameter, you must specify an - * index. If specified, the analyzer parameter overrides this - * value. - *

- * API name: {@code field} - */ - @Nullable - public final String field() { - return this.field; - } - - /** - * Array of token filters used to apply after the tokenizer. - *

- * API name: {@code filter} - */ - public final List filter() { - return this.filter; - } - - /** - * Index used to derive the analyzer. If specified, the analyzer or - * field parameter overrides this value. If no index is specified or the index - * does not have a default analyzer, the analyze API uses the standard analyzer. - *

- * API name: {@code index} - */ - @Nullable - public final String index() { - return this.index; - } - - /** - * Normalizer to use to convert text into a single token. - *

- * API name: {@code normalizer} - */ - @Nullable - public final String normalizer() { - return this.normalizer; - } - - /** - * Text to analyze. If an array of strings is provided, it is analyzed as a - * multi-value field. - *

- * API name: {@code text} - */ - public final List text() { - return this.text; - } - - /** - * Tokenizer to use to convert text into tokens. - *

- * API name: {@code tokenizer} - */ - @Nullable - public final Tokenizer tokenizer() { - return this.tokenizer; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.analyzer != null) { - generator.writeKey("analyzer"); - generator.write(this.analyzer); - - } - if (ApiTypeHelper.isDefined(this.attributes)) { - generator.writeKey("attributes"); - generator.writeStartArray(); - for (String item0 : this.attributes) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.charFilter)) { - generator.writeKey("char_filter"); - generator.writeStartArray(); - for (CharFilter item0 : this.charFilter) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.explain != null) { - generator.writeKey("explain"); - generator.write(this.explain); - - } - if (this.field != null) { - generator.writeKey("field"); - generator.write(this.field); - - } - if (ApiTypeHelper.isDefined(this.filter)) { - generator.writeKey("filter"); - generator.writeStartArray(); - for (TokenFilter item0 : this.filter) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.normalizer != null) { - generator.writeKey("normalizer"); - generator.write(this.normalizer); - - } - if (ApiTypeHelper.isDefined(this.text)) { - generator.writeKey("text"); - generator.writeStartArray(); - for (String item0 : this.text) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (this.tokenizer != null) { - generator.writeKey("tokenizer"); - this.tokenizer.serialize(generator, mapper); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link AnalyzeRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { - @Nullable - private String analyzer; - - @Nullable - private List attributes; - - @Nullable - private List charFilter; - - @Nullable - private Boolean explain; - - @Nullable - private String field; - - @Nullable - private List filter; - - @Nullable - private String index; - - @Nullable - private String normalizer; - - @Nullable - private List text; - - @Nullable - private Tokenizer tokenizer; - - /** - * The name of the analyzer that should be applied to the provided - * text. This could be a built-in analyzer, or an analyzer that’s - * been configured in the index. - *

- * API name: {@code analyzer} - */ - public final Builder analyzer(@Nullable String value) { - this.analyzer = value; - return this; - } - - /** - * Array of token attributes used to filter the output of the - * explain parameter. - *

- * API name: {@code attributes} - *

- * Adds all elements of list to attributes. - */ - public final Builder attributes(List list) { - this.attributes = _listAddAll(this.attributes, list); - return this; - } - - /** - * Array of token attributes used to filter the output of the - * explain parameter. - *

- * API name: {@code attributes} - *

- * Adds one or more values to attributes. - */ - public final Builder attributes(String value, String... values) { - this.attributes = _listAdd(this.attributes, value, values); - return this; - } - - /** - * Array of character filters used to preprocess characters before the - * tokenizer. - *

- * API name: {@code char_filter} - *

- * Adds all elements of list to charFilter. - */ - public final Builder charFilter(List list) { - this.charFilter = _listAddAll(this.charFilter, list); - return this; - } - - /** - * Array of character filters used to preprocess characters before the - * tokenizer. - *

- * API name: {@code char_filter} - *

- * Adds one or more values to charFilter. - */ - public final Builder charFilter(CharFilter value, CharFilter... values) { - this.charFilter = _listAdd(this.charFilter, value, values); - return this; - } - - /** - * Array of character filters used to preprocess characters before the - * tokenizer. - *

- * API name: {@code char_filter} - *

- * Adds a value to charFilter using a builder lambda. - */ - public final Builder charFilter(Function> fn) { - return charFilter(fn.apply(new CharFilter.Builder()).build()); - } - - /** - * If true, the response includes token attributes and additional - * details. - *

- * API name: {@code explain} - */ - public final Builder explain(@Nullable Boolean value) { - this.explain = value; - return this; - } - - /** - * Field used to derive the analyzer. To use this parameter, you must specify an - * index. If specified, the analyzer parameter overrides this - * value. - *

- * API name: {@code field} - */ - public final Builder field(@Nullable String value) { - this.field = value; - return this; - } - - /** - * Array of token filters used to apply after the tokenizer. - *

- * API name: {@code filter} - *

- * Adds all elements of list to filter. - */ - public final Builder filter(List list) { - this.filter = _listAddAll(this.filter, list); - return this; - } - - /** - * Array of token filters used to apply after the tokenizer. - *

- * API name: {@code filter} - *

- * Adds one or more values to filter. - */ - public final Builder filter(TokenFilter value, TokenFilter... values) { - this.filter = _listAdd(this.filter, value, values); - return this; - } - - /** - * Array of token filters used to apply after the tokenizer. - *

- * API name: {@code filter} - *

- * Adds a value to filter using a builder lambda. - */ - public final Builder filter(Function> fn) { - return filter(fn.apply(new TokenFilter.Builder()).build()); - } - - /** - * Index used to derive the analyzer. If specified, the analyzer or - * field parameter overrides this value. If no index is specified or the index - * does not have a default analyzer, the analyze API uses the standard analyzer. - *

- * API name: {@code index} - */ - public final Builder index(@Nullable String value) { - this.index = value; - return this; - } - - /** - * Normalizer to use to convert text into a single token. - *

- * API name: {@code normalizer} - */ - public final Builder normalizer(@Nullable String value) { - this.normalizer = value; - return this; - } - - /** - * Text to analyze. If an array of strings is provided, it is analyzed as a - * multi-value field. - *

- * API name: {@code text} - *

- * Adds all elements of list to text. - */ - public final Builder text(List list) { - this.text = _listAddAll(this.text, list); - return this; - } - - /** - * Text to analyze. If an array of strings is provided, it is analyzed as a - * multi-value field. - *

- * API name: {@code text} - *

- * Adds one or more values to text. - */ - public final Builder text(String value, String... values) { - this.text = _listAdd(this.text, value, values); - return this; - } - - /** - * Tokenizer to use to convert text into tokens. - *

- * API name: {@code tokenizer} - */ - public final Builder tokenizer(@Nullable Tokenizer value) { - this.tokenizer = value; - return this; - } - - /** - * Tokenizer to use to convert text into tokens. - *

- * API name: {@code tokenizer} - */ - public final Builder tokenizer(Function> fn) { - return this.tokenizer(fn.apply(new Tokenizer.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link AnalyzeRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public AnalyzeRequest build() { - _checkSingleUse(); - - return new AnalyzeRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link AnalyzeRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - AnalyzeRequest::setupAnalyzeRequestDeserializer); - - protected static void setupAnalyzeRequestDeserializer(ObjectDeserializer op) { - - op.add(Builder::analyzer, JsonpDeserializer.stringDeserializer(), "analyzer"); - op.add(Builder::attributes, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "attributes"); - op.add(Builder::charFilter, JsonpDeserializer.arrayDeserializer(CharFilter._DESERIALIZER), "char_filter"); - op.add(Builder::explain, JsonpDeserializer.booleanDeserializer(), "explain"); - op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); - op.add(Builder::filter, JsonpDeserializer.arrayDeserializer(TokenFilter._DESERIALIZER), "filter"); - op.add(Builder::normalizer, JsonpDeserializer.stringDeserializer(), "normalizer"); - op.add(Builder::text, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "text"); - op.add(Builder::tokenizer, Tokenizer._DESERIALIZER, "tokenizer"); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.analyze}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.analyze", - - // Request method - request -> { - return "POST"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - if (request.index() != null) - propsSet |= _index; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_analyze"); - return buf.toString(); - } - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index, buf); - buf.append("/_analyze"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _index = 1 << 0; - - int propsSet = 0; - - if (request.index() != null) - propsSet |= _index; - - if (propsSet == 0) { - } - if (propsSet == (_index)) { - params.put("index", request.index); - } - return params; - }, - - // Request parameters - request -> { - return Collections.emptyMap(); - - }, SimpleEndpoint.emptyMap(), true, AnalyzeResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AnalyzeResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AnalyzeResponse.java deleted file mode 100644 index dc61d9e70..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AnalyzeResponse.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch.indices.analyze.AnalyzeDetail; -import co.elastic.clients.elasticsearch.indices.analyze.AnalyzeToken; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.analyze.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class AnalyzeResponse implements JsonpSerializable { - @Nullable - private final AnalyzeDetail detail; - - private final List tokens; - - // --------------------------------------------------------------------------------------------- - - private AnalyzeResponse(Builder builder) { - - this.detail = builder.detail; - this.tokens = ApiTypeHelper.unmodifiable(builder.tokens); - - } - - public static AnalyzeResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code detail} - */ - @Nullable - public final AnalyzeDetail detail() { - return this.detail; - } - - /** - * API name: {@code tokens} - */ - public final List tokens() { - return this.tokens; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.detail != null) { - generator.writeKey("detail"); - this.detail.serialize(generator, mapper); - - } - if (ApiTypeHelper.isDefined(this.tokens)) { - generator.writeKey("tokens"); - generator.writeStartArray(); - for (AnalyzeToken item0 : this.tokens) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link AnalyzeResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private AnalyzeDetail detail; - - @Nullable - private List tokens; - - /** - * API name: {@code detail} - */ - public final Builder detail(@Nullable AnalyzeDetail value) { - this.detail = value; - return this; - } - - /** - * API name: {@code detail} - */ - public final Builder detail(Function> fn) { - return this.detail(fn.apply(new AnalyzeDetail.Builder()).build()); - } - - /** - * API name: {@code tokens} - *

- * Adds all elements of list to tokens. - */ - public final Builder tokens(List list) { - this.tokens = _listAddAll(this.tokens, list); - return this; - } - - /** - * API name: {@code tokens} - *

- * Adds one or more values to tokens. - */ - public final Builder tokens(AnalyzeToken value, AnalyzeToken... values) { - this.tokens = _listAdd(this.tokens, value, values); - return this; - } - - /** - * API name: {@code tokens} - *

- * Adds a value to tokens using a builder lambda. - */ - public final Builder tokens(Function> fn) { - return tokens(fn.apply(new AnalyzeToken.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link AnalyzeResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public AnalyzeResponse build() { - _checkSingleUse(); - - return new AnalyzeResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link AnalyzeResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - AnalyzeResponse::setupAnalyzeResponseDeserializer); - - protected static void setupAnalyzeResponseDeserializer(ObjectDeserializer op) { - - op.add(Builder::detail, AnalyzeDetail._DESERIALIZER, "detail"); - op.add(Builder::tokens, JsonpDeserializer.arrayDeserializer(AnalyzeToken._DESERIALIZER), "tokens"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CacheQueries.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CacheQueries.java deleted file mode 100644 index e8e882782..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CacheQueries.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.CacheQueries - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class CacheQueries implements JsonpSerializable { - private final boolean enabled; - - // --------------------------------------------------------------------------------------------- - - private CacheQueries(Builder builder) { - - this.enabled = ApiTypeHelper.requireNonNull(builder.enabled, this, "enabled"); - - } - - public static CacheQueries of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code enabled} - */ - public final boolean enabled() { - return this.enabled; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("enabled"); - generator.write(this.enabled); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link CacheQueries}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Boolean enabled; - - /** - * Required - API name: {@code enabled} - */ - public final Builder enabled(boolean value) { - this.enabled = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link CacheQueries}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public CacheQueries build() { - _checkSingleUse(); - - return new CacheQueries(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link CacheQueries} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - CacheQueries::setupCacheQueriesDeserializer); - - protected static void setupCacheQueriesDeserializer(ObjectDeserializer op) { - - op.add(Builder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateDataStreamRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateDataStreamRequest.java deleted file mode 100644 index a93f1bbe0..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateDataStreamRequest.java +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.create_data_stream.Request - -/** - * Create a data stream. Creates a data stream. You must have a matching index - * template with data stream enabled. - * - * @see API - * specification - */ - -public class CreateDataStreamRequest extends RequestBase { - @Nullable - private final Time masterTimeout; - - private final String name; - - @Nullable - private final Time timeout; - - // --------------------------------------------------------------------------------------------- - - private CreateDataStreamRequest(Builder builder) { - - this.masterTimeout = builder.masterTimeout; - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.timeout = builder.timeout; - - } - - public static CreateDataStreamRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Required - Name of the data stream, which must meet the following criteria: - * Lowercase only; Cannot include \, /, - * *, ?, ", <, - * >, |, ,, #, - * :, or a space character; Cannot start with -, - * _, +, or .ds-; Cannot be - * . or ..; Cannot be longer than 255 bytes. - * Multi-byte characters count towards this limit faster. - *

- * API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link CreateDataStreamRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Time masterTimeout; - - private String name; - - @Nullable - private Time timeout; - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - Name of the data stream, which must meet the following criteria: - * Lowercase only; Cannot include \, /, - * *, ?, ", <, - * >, |, ,, #, - * :, or a space character; Cannot start with -, - * _, +, or .ds-; Cannot be - * . or ..; Cannot be longer than 255 bytes. - * Multi-byte characters count towards this limit faster. - *

- * API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link CreateDataStreamRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public CreateDataStreamRequest build() { - _checkSingleUse(); - - return new CreateDataStreamRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.create_data_stream}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.create_data_stream", - - // Request method - request -> { - return "PUT"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_data_stream"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - params.put("name", request.name); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, CreateDataStreamResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateDataStreamResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateDataStreamResponse.java deleted file mode 100644 index 9b5e2b043..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateDataStreamResponse.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.create_data_stream.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class CreateDataStreamResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private CreateDataStreamResponse(Builder builder) { - super(builder); - - } - - public static CreateDataStreamResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link CreateDataStreamResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link CreateDataStreamResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public CreateDataStreamResponse build() { - _checkSingleUse(); - - return new CreateDataStreamResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link CreateDataStreamResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, CreateDataStreamResponse::setupCreateDataStreamResponseDeserializer); - - protected static void setupCreateDataStreamResponseDeserializer( - ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateIndexRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateIndexRequest.java deleted file mode 100644 index 1a9e5011e..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateIndexRequest.java +++ /dev/null @@ -1,503 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.elasticsearch._types.WaitForActiveShards; -import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.create.Request - -/** - * Create an index. Creates a new index. - * - * @see API - * specification - */ -@JsonpDeserializable -public class CreateIndexRequest extends RequestBase implements JsonpSerializable { - private final Map aliases; - - private final String index; - - @Nullable - private final TypeMapping mappings; - - @Nullable - private final Time masterTimeout; - - @Nullable - private final IndexSettings settings; - - @Nullable - private final Time timeout; - - @Nullable - private final WaitForActiveShards waitForActiveShards; - - // --------------------------------------------------------------------------------------------- - - private CreateIndexRequest(Builder builder) { - - this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); - this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); - this.mappings = builder.mappings; - this.masterTimeout = builder.masterTimeout; - this.settings = builder.settings; - this.timeout = builder.timeout; - this.waitForActiveShards = builder.waitForActiveShards; - - } - - public static CreateIndexRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Aliases for the index. - *

- * API name: {@code aliases} - */ - public final Map aliases() { - return this.aliases; - } - - /** - * Required - Name of the index you wish to create. - *

- * API name: {@code index} - */ - public final String index() { - return this.index; - } - - /** - * Mapping for fields in the index. If specified, this mapping can include: - *

    - *
  • Field names
  • - *
  • Field data types
  • - *
  • Mapping parameters
  • - *
- *

- * API name: {@code mappings} - */ - @Nullable - public final TypeMapping mappings() { - return this.mappings; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Configuration options for the index. - *

- * API name: {@code settings} - */ - @Nullable - public final IndexSettings settings() { - return this.settings; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - /** - * The number of shard copies that must be active before proceeding with the - * operation. Set to all or any positive integer up to the total - * number of shards in the index (number_of_replicas+1). - *

- * API name: {@code wait_for_active_shards} - */ - @Nullable - public final WaitForActiveShards waitForActiveShards() { - return this.waitForActiveShards; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.aliases)) { - generator.writeKey("aliases"); - generator.writeStartObject(); - for (Map.Entry item0 : this.aliases.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.mappings != null) { - generator.writeKey("mappings"); - this.mappings.serialize(generator, mapper); - - } - if (this.settings != null) { - generator.writeKey("settings"); - this.settings.serialize(generator, mapper); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link CreateIndexRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Map aliases; - - private String index; - - @Nullable - private TypeMapping mappings; - - @Nullable - private Time masterTimeout; - - @Nullable - private IndexSettings settings; - - @Nullable - private Time timeout; - - @Nullable - private WaitForActiveShards waitForActiveShards; - - /** - * Aliases for the index. - *

- * API name: {@code aliases} - *

- * Adds all entries of map to aliases. - */ - public final Builder aliases(Map map) { - this.aliases = _mapPutAll(this.aliases, map); - return this; - } - - /** - * Aliases for the index. - *

- * API name: {@code aliases} - *

- * Adds an entry to aliases. - */ - public final Builder aliases(String key, Alias value) { - this.aliases = _mapPut(this.aliases, key, value); - return this; - } - - /** - * Aliases for the index. - *

- * API name: {@code aliases} - *

- * Adds an entry to aliases using a builder lambda. - */ - public final Builder aliases(String key, Function> fn) { - return aliases(key, fn.apply(new Alias.Builder()).build()); - } - - /** - * Required - Name of the index you wish to create. - *

- * API name: {@code index} - */ - public final Builder index(String value) { - this.index = value; - return this; - } - - /** - * Mapping for fields in the index. If specified, this mapping can include: - *

    - *
  • Field names
  • - *
  • Field data types
  • - *
  • Mapping parameters
  • - *
- *

- * API name: {@code mappings} - */ - public final Builder mappings(@Nullable TypeMapping value) { - this.mappings = value; - return this; - } - - /** - * Mapping for fields in the index. If specified, this mapping can include: - *

    - *
  • Field names
  • - *
  • Field data types
  • - *
  • Mapping parameters
  • - *
- *

- * API name: {@code mappings} - */ - public final Builder mappings(Function> fn) { - return this.mappings(fn.apply(new TypeMapping.Builder()).build()); - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Configuration options for the index. - *

- * API name: {@code settings} - */ - public final Builder settings(@Nullable IndexSettings value) { - this.settings = value; - return this; - } - - /** - * Configuration options for the index. - *

- * API name: {@code settings} - */ - public final Builder settings(Function> fn) { - return this.settings(fn.apply(new IndexSettings.Builder()).build()); - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - /** - * The number of shard copies that must be active before proceeding with the - * operation. Set to all or any positive integer up to the total - * number of shards in the index (number_of_replicas+1). - *

- * API name: {@code wait_for_active_shards} - */ - public final Builder waitForActiveShards(@Nullable WaitForActiveShards value) { - this.waitForActiveShards = value; - return this; - } - - /** - * The number of shard copies that must be active before proceeding with the - * operation. Set to all or any positive integer up to the total - * number of shards in the index (number_of_replicas+1). - *

- * API name: {@code wait_for_active_shards} - */ - public final Builder waitForActiveShards( - Function> fn) { - return this.waitForActiveShards(fn.apply(new WaitForActiveShards.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link CreateIndexRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public CreateIndexRequest build() { - _checkSingleUse(); - - return new CreateIndexRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link CreateIndexRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, CreateIndexRequest::setupCreateIndexRequestDeserializer); - - protected static void setupCreateIndexRequestDeserializer(ObjectDeserializer op) { - - op.add(Builder::aliases, JsonpDeserializer.stringMapDeserializer(Alias._DESERIALIZER), "aliases"); - op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings"); - op.add(Builder::settings, IndexSettings._DESERIALIZER, "settings"); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.create}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.create", - - // Request method - request -> { - return "PUT"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - params.put("index", request.index); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.waitForActiveShards != null) { - params.put("wait_for_active_shards", request.waitForActiveShards._toJsonString()); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), true, CreateIndexResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateIndexResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateIndexResponse.java deleted file mode 100644 index 1eb6fe168..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateIndexResponse.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponse; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.create.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class CreateIndexResponse implements AcknowledgedResponse, JsonpSerializable { - private final String index; - - private final boolean shardsAcknowledged; - - private final boolean acknowledged; - - // --------------------------------------------------------------------------------------------- - - private CreateIndexResponse(Builder builder) { - - this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); - this.shardsAcknowledged = ApiTypeHelper.requireNonNull(builder.shardsAcknowledged, this, "shardsAcknowledged"); - this.acknowledged = ApiTypeHelper.requireNonNull(builder.acknowledged, this, "acknowledged"); - - } - - public static CreateIndexResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code index} - */ - public final String index() { - return this.index; - } - - /** - * Required - API name: {@code shards_acknowledged} - */ - public final boolean shardsAcknowledged() { - return this.shardsAcknowledged; - } - - /** - * Required - API name: {@code acknowledged} - */ - public final boolean acknowledged() { - return this.acknowledged; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("index"); - generator.write(this.index); - - generator.writeKey("shards_acknowledged"); - generator.write(this.shardsAcknowledged); - - generator.writeKey("acknowledged"); - generator.write(this.acknowledged); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link CreateIndexResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private String index; - - private Boolean shardsAcknowledged; - - private Boolean acknowledged; - - /** - * Required - API name: {@code index} - */ - public final Builder index(String value) { - this.index = value; - return this; - } - - /** - * Required - API name: {@code shards_acknowledged} - */ - public final Builder shardsAcknowledged(boolean value) { - this.shardsAcknowledged = value; - return this; - } - - /** - * Required - API name: {@code acknowledged} - */ - public final Builder acknowledged(boolean value) { - this.acknowledged = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link CreateIndexResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public CreateIndexResponse build() { - _checkSingleUse(); - - return new CreateIndexResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link CreateIndexResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, CreateIndexResponse::setupCreateIndexResponseDeserializer); - - protected static void setupCreateIndexResponseDeserializer(ObjectDeserializer op) { - - op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); - op.add(Builder::shardsAcknowledged, JsonpDeserializer.booleanDeserializer(), "shards_acknowledged"); - op.add(Builder::acknowledged, JsonpDeserializer.booleanDeserializer(), "acknowledged"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStream.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStream.java deleted file mode 100644 index caedfe618..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStream.java +++ /dev/null @@ -1,775 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.HealthStatus; -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Integer; -import java.lang.String; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.DataStream - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DataStream implements JsonpSerializable { - private final Map meta; - - @Nullable - private final Boolean allowCustomRouting; - - @Nullable - private final FailureStore failureStore; - - private final int generation; - - private final boolean hidden; - - @Nullable - private final String ilmPolicy; - - private final ManagedBy nextGenerationManagedBy; - - private final boolean preferIlm; - - private final List indices; - - @Nullable - private final DataStreamLifecycleWithRollover lifecycle; - - private final String name; - - @Nullable - private final Boolean replicated; - - private final boolean rolloverOnWrite; - - private final HealthStatus status; - - @Nullable - private final Boolean system; - - private final String template; - - private final DataStreamTimestampField timestampField; - - // --------------------------------------------------------------------------------------------- - - private DataStream(Builder builder) { - - this.meta = ApiTypeHelper.unmodifiable(builder.meta); - this.allowCustomRouting = builder.allowCustomRouting; - this.failureStore = builder.failureStore; - this.generation = ApiTypeHelper.requireNonNull(builder.generation, this, "generation"); - this.hidden = ApiTypeHelper.requireNonNull(builder.hidden, this, "hidden"); - this.ilmPolicy = builder.ilmPolicy; - this.nextGenerationManagedBy = ApiTypeHelper.requireNonNull(builder.nextGenerationManagedBy, this, - "nextGenerationManagedBy"); - this.preferIlm = ApiTypeHelper.requireNonNull(builder.preferIlm, this, "preferIlm"); - this.indices = ApiTypeHelper.unmodifiableRequired(builder.indices, this, "indices"); - this.lifecycle = builder.lifecycle; - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.replicated = builder.replicated; - this.rolloverOnWrite = ApiTypeHelper.requireNonNull(builder.rolloverOnWrite, this, "rolloverOnWrite"); - this.status = ApiTypeHelper.requireNonNull(builder.status, this, "status"); - this.system = builder.system; - this.template = ApiTypeHelper.requireNonNull(builder.template, this, "template"); - this.timestampField = ApiTypeHelper.requireNonNull(builder.timestampField, this, "timestampField"); - - } - - public static DataStream of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Custom metadata for the stream, copied from the _meta object of - * the stream’s matching index template. If empty, the response omits this - * property. - *

- * API name: {@code _meta} - */ - public final Map meta() { - return this.meta; - } - - /** - * If true, the data stream allows custom routing on write request. - *

- * API name: {@code allow_custom_routing} - */ - @Nullable - public final Boolean allowCustomRouting() { - return this.allowCustomRouting; - } - - /** - * Information about failure store backing indices - *

- * API name: {@code failure_store} - */ - @Nullable - public final FailureStore failureStore() { - return this.failureStore; - } - - /** - * Required - Current generation for the data stream. This number acts as a - * cumulative count of the stream’s rollovers, starting at 1. - *

- * API name: {@code generation} - */ - public final int generation() { - return this.generation; - } - - /** - * Required - If true, the data stream is hidden. - *

- * API name: {@code hidden} - */ - public final boolean hidden() { - return this.hidden; - } - - /** - * Name of the current ILM lifecycle policy in the stream’s matching index - * template. This lifecycle policy is set in the - * index.lifecycle.name setting. If the template does not include a - * lifecycle policy, this property is not included in the response. NOTE: A data - * stream’s backing indices may be assigned different lifecycle policies. To - * retrieve the lifecycle policy for individual backing indices, use the get - * index settings API. - *

- * API name: {@code ilm_policy} - */ - @Nullable - public final String ilmPolicy() { - return this.ilmPolicy; - } - - /** - * Required - Name of the lifecycle system that'll manage the next generation of - * the data stream. - *

- * API name: {@code next_generation_managed_by} - */ - public final ManagedBy nextGenerationManagedBy() { - return this.nextGenerationManagedBy; - } - - /** - * Required - Indicates if ILM should take precedence over DSL in case both are - * configured to managed this data stream. - *

- * API name: {@code prefer_ilm} - */ - public final boolean preferIlm() { - return this.preferIlm; - } - - /** - * Required - Array of objects containing information about the data stream’s - * backing indices. The last item in this array contains information about the - * stream’s current write index. - *

- * API name: {@code indices} - */ - public final List indices() { - return this.indices; - } - - /** - * Contains the configuration for the data stream lifecycle of this data stream. - *

- * API name: {@code lifecycle} - */ - @Nullable - public final DataStreamLifecycleWithRollover lifecycle() { - return this.lifecycle; - } - - /** - * Required - Name of the data stream. - *

- * API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * If true, the data stream is created and managed by cross-cluster - * replication and the local cluster can not write into this data stream or - * change its mappings. - *

- * API name: {@code replicated} - */ - @Nullable - public final Boolean replicated() { - return this.replicated; - } - - /** - * Required - If true, the next write to this data stream will - * trigger a rollover first and the document will be indexed in the new backing - * index. If the rollover fails the indexing request will fail too. - *

- * API name: {@code rollover_on_write} - */ - public final boolean rolloverOnWrite() { - return this.rolloverOnWrite; - } - - /** - * Required - Health status of the data stream. This health status is based on - * the state of the primary and replica shards of the stream’s backing indices. - *

- * API name: {@code status} - */ - public final HealthStatus status() { - return this.status; - } - - /** - * If true, the data stream is created and managed by an Elastic - * stack component and cannot be modified through normal user interaction. - *

- * API name: {@code system} - */ - @Nullable - public final Boolean system() { - return this.system; - } - - /** - * Required - Name of the index template used to create the data stream’s - * backing indices. The template’s index pattern must match the name of this - * data stream. - *

- * API name: {@code template} - */ - public final String template() { - return this.template; - } - - /** - * Required - Information about the @timestamp field in the data - * stream. - *

- * API name: {@code timestamp_field} - */ - public final DataStreamTimestampField timestampField() { - return this.timestampField; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.meta)) { - generator.writeKey("_meta"); - generator.writeStartObject(); - for (Map.Entry item0 : this.meta.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.allowCustomRouting != null) { - generator.writeKey("allow_custom_routing"); - generator.write(this.allowCustomRouting); - - } - if (this.failureStore != null) { - generator.writeKey("failure_store"); - this.failureStore.serialize(generator, mapper); - - } - generator.writeKey("generation"); - generator.write(this.generation); - - generator.writeKey("hidden"); - generator.write(this.hidden); - - if (this.ilmPolicy != null) { - generator.writeKey("ilm_policy"); - generator.write(this.ilmPolicy); - - } - generator.writeKey("next_generation_managed_by"); - this.nextGenerationManagedBy.serialize(generator, mapper); - generator.writeKey("prefer_ilm"); - generator.write(this.preferIlm); - - if (ApiTypeHelper.isDefined(this.indices)) { - generator.writeKey("indices"); - generator.writeStartArray(); - for (DataStreamIndex item0 : this.indices) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.lifecycle != null) { - generator.writeKey("lifecycle"); - this.lifecycle.serialize(generator, mapper); - - } - generator.writeKey("name"); - generator.write(this.name); - - if (this.replicated != null) { - generator.writeKey("replicated"); - generator.write(this.replicated); - - } - generator.writeKey("rollover_on_write"); - generator.write(this.rolloverOnWrite); - - generator.writeKey("status"); - this.status.serialize(generator, mapper); - if (this.system != null) { - generator.writeKey("system"); - generator.write(this.system); - - } - generator.writeKey("template"); - generator.write(this.template); - - generator.writeKey("timestamp_field"); - this.timestampField.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DataStream}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private Map meta; - - @Nullable - private Boolean allowCustomRouting; - - @Nullable - private FailureStore failureStore; - - private Integer generation; - - private Boolean hidden; - - @Nullable - private String ilmPolicy; - - private ManagedBy nextGenerationManagedBy; - - private Boolean preferIlm; - - private List indices; - - @Nullable - private DataStreamLifecycleWithRollover lifecycle; - - private String name; - - @Nullable - private Boolean replicated; - - private Boolean rolloverOnWrite; - - private HealthStatus status; - - @Nullable - private Boolean system; - - private String template; - - private DataStreamTimestampField timestampField; - - /** - * Custom metadata for the stream, copied from the _meta object of - * the stream’s matching index template. If empty, the response omits this - * property. - *

- * API name: {@code _meta} - *

- * Adds all entries of map to meta. - */ - public final Builder meta(Map map) { - this.meta = _mapPutAll(this.meta, map); - return this; - } - - /** - * Custom metadata for the stream, copied from the _meta object of - * the stream’s matching index template. If empty, the response omits this - * property. - *

- * API name: {@code _meta} - *

- * Adds an entry to meta. - */ - public final Builder meta(String key, JsonData value) { - this.meta = _mapPut(this.meta, key, value); - return this; - } - - /** - * If true, the data stream allows custom routing on write request. - *

- * API name: {@code allow_custom_routing} - */ - public final Builder allowCustomRouting(@Nullable Boolean value) { - this.allowCustomRouting = value; - return this; - } - - /** - * Information about failure store backing indices - *

- * API name: {@code failure_store} - */ - public final Builder failureStore(@Nullable FailureStore value) { - this.failureStore = value; - return this; - } - - /** - * Information about failure store backing indices - *

- * API name: {@code failure_store} - */ - public final Builder failureStore(Function> fn) { - return this.failureStore(fn.apply(new FailureStore.Builder()).build()); - } - - /** - * Required - Current generation for the data stream. This number acts as a - * cumulative count of the stream’s rollovers, starting at 1. - *

- * API name: {@code generation} - */ - public final Builder generation(int value) { - this.generation = value; - return this; - } - - /** - * Required - If true, the data stream is hidden. - *

- * API name: {@code hidden} - */ - public final Builder hidden(boolean value) { - this.hidden = value; - return this; - } - - /** - * Name of the current ILM lifecycle policy in the stream’s matching index - * template. This lifecycle policy is set in the - * index.lifecycle.name setting. If the template does not include a - * lifecycle policy, this property is not included in the response. NOTE: A data - * stream’s backing indices may be assigned different lifecycle policies. To - * retrieve the lifecycle policy for individual backing indices, use the get - * index settings API. - *

- * API name: {@code ilm_policy} - */ - public final Builder ilmPolicy(@Nullable String value) { - this.ilmPolicy = value; - return this; - } - - /** - * Required - Name of the lifecycle system that'll manage the next generation of - * the data stream. - *

- * API name: {@code next_generation_managed_by} - */ - public final Builder nextGenerationManagedBy(ManagedBy value) { - this.nextGenerationManagedBy = value; - return this; - } - - /** - * Required - Indicates if ILM should take precedence over DSL in case both are - * configured to managed this data stream. - *

- * API name: {@code prefer_ilm} - */ - public final Builder preferIlm(boolean value) { - this.preferIlm = value; - return this; - } - - /** - * Required - Array of objects containing information about the data stream’s - * backing indices. The last item in this array contains information about the - * stream’s current write index. - *

- * API name: {@code indices} - *

- * Adds all elements of list to indices. - */ - public final Builder indices(List list) { - this.indices = _listAddAll(this.indices, list); - return this; - } - - /** - * Required - Array of objects containing information about the data stream’s - * backing indices. The last item in this array contains information about the - * stream’s current write index. - *

- * API name: {@code indices} - *

- * Adds one or more values to indices. - */ - public final Builder indices(DataStreamIndex value, DataStreamIndex... values) { - this.indices = _listAdd(this.indices, value, values); - return this; - } - - /** - * Required - Array of objects containing information about the data stream’s - * backing indices. The last item in this array contains information about the - * stream’s current write index. - *

- * API name: {@code indices} - *

- * Adds a value to indices using a builder lambda. - */ - public final Builder indices(Function> fn) { - return indices(fn.apply(new DataStreamIndex.Builder()).build()); - } - - /** - * Contains the configuration for the data stream lifecycle of this data stream. - *

- * API name: {@code lifecycle} - */ - public final Builder lifecycle(@Nullable DataStreamLifecycleWithRollover value) { - this.lifecycle = value; - return this; - } - - /** - * Contains the configuration for the data stream lifecycle of this data stream. - *

- * API name: {@code lifecycle} - */ - public final Builder lifecycle( - Function> fn) { - return this.lifecycle(fn.apply(new DataStreamLifecycleWithRollover.Builder()).build()); - } - - /** - * Required - Name of the data stream. - *

- * API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * If true, the data stream is created and managed by cross-cluster - * replication and the local cluster can not write into this data stream or - * change its mappings. - *

- * API name: {@code replicated} - */ - public final Builder replicated(@Nullable Boolean value) { - this.replicated = value; - return this; - } - - /** - * Required - If true, the next write to this data stream will - * trigger a rollover first and the document will be indexed in the new backing - * index. If the rollover fails the indexing request will fail too. - *

- * API name: {@code rollover_on_write} - */ - public final Builder rolloverOnWrite(boolean value) { - this.rolloverOnWrite = value; - return this; - } - - /** - * Required - Health status of the data stream. This health status is based on - * the state of the primary and replica shards of the stream’s backing indices. - *

- * API name: {@code status} - */ - public final Builder status(HealthStatus value) { - this.status = value; - return this; - } - - /** - * If true, the data stream is created and managed by an Elastic - * stack component and cannot be modified through normal user interaction. - *

- * API name: {@code system} - */ - public final Builder system(@Nullable Boolean value) { - this.system = value; - return this; - } - - /** - * Required - Name of the index template used to create the data stream’s - * backing indices. The template’s index pattern must match the name of this - * data stream. - *

- * API name: {@code template} - */ - public final Builder template(String value) { - this.template = value; - return this; - } - - /** - * Required - Information about the @timestamp field in the data - * stream. - *

- * API name: {@code timestamp_field} - */ - public final Builder timestampField(DataStreamTimestampField value) { - this.timestampField = value; - return this; - } - - /** - * Required - Information about the @timestamp field in the data - * stream. - *

- * API name: {@code timestamp_field} - */ - public final Builder timestampField( - Function> fn) { - return this.timestampField(fn.apply(new DataStreamTimestampField.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DataStream}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DataStream build() { - _checkSingleUse(); - - return new DataStream(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DataStream} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - DataStream::setupDataStreamDeserializer); - - protected static void setupDataStreamDeserializer(ObjectDeserializer op) { - - op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta"); - op.add(Builder::allowCustomRouting, JsonpDeserializer.booleanDeserializer(), "allow_custom_routing"); - op.add(Builder::failureStore, FailureStore._DESERIALIZER, "failure_store"); - op.add(Builder::generation, JsonpDeserializer.integerDeserializer(), "generation"); - op.add(Builder::hidden, JsonpDeserializer.booleanDeserializer(), "hidden"); - op.add(Builder::ilmPolicy, JsonpDeserializer.stringDeserializer(), "ilm_policy"); - op.add(Builder::nextGenerationManagedBy, ManagedBy._DESERIALIZER, "next_generation_managed_by"); - op.add(Builder::preferIlm, JsonpDeserializer.booleanDeserializer(), "prefer_ilm"); - op.add(Builder::indices, JsonpDeserializer.arrayDeserializer(DataStreamIndex._DESERIALIZER), "indices"); - op.add(Builder::lifecycle, DataStreamLifecycleWithRollover._DESERIALIZER, "lifecycle"); - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - op.add(Builder::replicated, JsonpDeserializer.booleanDeserializer(), "replicated"); - op.add(Builder::rolloverOnWrite, JsonpDeserializer.booleanDeserializer(), "rollover_on_write"); - op.add(Builder::status, HealthStatus._DESERIALIZER, "status"); - op.add(Builder::system, JsonpDeserializer.booleanDeserializer(), "system"); - op.add(Builder::template, JsonpDeserializer.stringDeserializer(), "template"); - op.add(Builder::timestampField, DataStreamTimestampField._DESERIALIZER, "timestamp_field"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamIndex.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamIndex.java deleted file mode 100644 index 3e6e64506..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamIndex.java +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.DataStreamIndex - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DataStreamIndex implements JsonpSerializable { - private final String indexName; - - private final String indexUuid; - - @Nullable - private final String ilmPolicy; - - @Nullable - private final ManagedBy managedBy; - - @Nullable - private final Boolean preferIlm; - - // --------------------------------------------------------------------------------------------- - - private DataStreamIndex(Builder builder) { - - this.indexName = ApiTypeHelper.requireNonNull(builder.indexName, this, "indexName"); - this.indexUuid = ApiTypeHelper.requireNonNull(builder.indexUuid, this, "indexUuid"); - this.ilmPolicy = builder.ilmPolicy; - this.managedBy = builder.managedBy; - this.preferIlm = builder.preferIlm; - - } - - public static DataStreamIndex of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Name of the backing index. - *

- * API name: {@code index_name} - */ - public final String indexName() { - return this.indexName; - } - - /** - * Required - Universally unique identifier (UUID) for the index. - *

- * API name: {@code index_uuid} - */ - public final String indexUuid() { - return this.indexUuid; - } - - /** - * Name of the current ILM lifecycle policy configured for this backing index. - *

- * API name: {@code ilm_policy} - */ - @Nullable - public final String ilmPolicy() { - return this.ilmPolicy; - } - - /** - * Name of the lifecycle system that's currently managing this backing index. - *

- * API name: {@code managed_by} - */ - @Nullable - public final ManagedBy managedBy() { - return this.managedBy; - } - - /** - * Indicates if ILM should take precedence over DSL in case both are configured - * to manage this index. - *

- * API name: {@code prefer_ilm} - */ - @Nullable - public final Boolean preferIlm() { - return this.preferIlm; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("index_name"); - generator.write(this.indexName); - - generator.writeKey("index_uuid"); - generator.write(this.indexUuid); - - if (this.ilmPolicy != null) { - generator.writeKey("ilm_policy"); - generator.write(this.ilmPolicy); - - } - if (this.managedBy != null) { - generator.writeKey("managed_by"); - this.managedBy.serialize(generator, mapper); - } - if (this.preferIlm != null) { - generator.writeKey("prefer_ilm"); - generator.write(this.preferIlm); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DataStreamIndex}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String indexName; - - private String indexUuid; - - @Nullable - private String ilmPolicy; - - @Nullable - private ManagedBy managedBy; - - @Nullable - private Boolean preferIlm; - - /** - * Required - Name of the backing index. - *

- * API name: {@code index_name} - */ - public final Builder indexName(String value) { - this.indexName = value; - return this; - } - - /** - * Required - Universally unique identifier (UUID) for the index. - *

- * API name: {@code index_uuid} - */ - public final Builder indexUuid(String value) { - this.indexUuid = value; - return this; - } - - /** - * Name of the current ILM lifecycle policy configured for this backing index. - *

- * API name: {@code ilm_policy} - */ - public final Builder ilmPolicy(@Nullable String value) { - this.ilmPolicy = value; - return this; - } - - /** - * Name of the lifecycle system that's currently managing this backing index. - *

- * API name: {@code managed_by} - */ - public final Builder managedBy(@Nullable ManagedBy value) { - this.managedBy = value; - return this; - } - - /** - * Indicates if ILM should take precedence over DSL in case both are configured - * to manage this index. - *

- * API name: {@code prefer_ilm} - */ - public final Builder preferIlm(@Nullable Boolean value) { - this.preferIlm = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DataStreamIndex}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DataStreamIndex build() { - _checkSingleUse(); - - return new DataStreamIndex(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DataStreamIndex} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - DataStreamIndex::setupDataStreamIndexDeserializer); - - protected static void setupDataStreamIndexDeserializer(ObjectDeserializer op) { - - op.add(Builder::indexName, JsonpDeserializer.stringDeserializer(), "index_name"); - op.add(Builder::indexUuid, JsonpDeserializer.stringDeserializer(), "index_uuid"); - op.add(Builder::ilmPolicy, JsonpDeserializer.stringDeserializer(), "ilm_policy"); - op.add(Builder::managedBy, ManagedBy._DESERIALIZER, "managed_by"); - op.add(Builder::preferIlm, JsonpDeserializer.booleanDeserializer(), "prefer_ilm"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycle.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycle.java deleted file mode 100644 index 7d8973e75..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycle.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.DataStreamLifecycle - -/** - * Data stream lifecycle denotes that a data stream is managed by the data - * stream lifecycle and contains the configuration. - * - * @see API - * specification - */ -@JsonpDeserializable -public class DataStreamLifecycle implements JsonpSerializable { - @Nullable - private final Time dataRetention; - - @Nullable - private final DataStreamLifecycleDownsampling downsampling; - - // --------------------------------------------------------------------------------------------- - - private DataStreamLifecycle(Builder builder) { - - this.dataRetention = builder.dataRetention; - this.downsampling = builder.downsampling; - - } - - public static DataStreamLifecycle of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code data_retention} - */ - @Nullable - public final Time dataRetention() { - return this.dataRetention; - } - - /** - * API name: {@code downsampling} - */ - @Nullable - public final DataStreamLifecycleDownsampling downsampling() { - return this.downsampling; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.dataRetention != null) { - generator.writeKey("data_retention"); - this.dataRetention.serialize(generator, mapper); - - } - if (this.downsampling != null) { - generator.writeKey("downsampling"); - this.downsampling.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DataStreamLifecycle}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Time dataRetention; - - @Nullable - private DataStreamLifecycleDownsampling downsampling; - - /** - * API name: {@code data_retention} - */ - public final Builder dataRetention(@Nullable Time value) { - this.dataRetention = value; - return this; - } - - /** - * API name: {@code data_retention} - */ - public final Builder dataRetention(Function> fn) { - return this.dataRetention(fn.apply(new Time.Builder()).build()); - } - - /** - * API name: {@code downsampling} - */ - public final Builder downsampling(@Nullable DataStreamLifecycleDownsampling value) { - this.downsampling = value; - return this; - } - - /** - * API name: {@code downsampling} - */ - public final Builder downsampling( - Function> fn) { - return this.downsampling(fn.apply(new DataStreamLifecycleDownsampling.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DataStreamLifecycle}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DataStreamLifecycle build() { - _checkSingleUse(); - - return new DataStreamLifecycle(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DataStreamLifecycle} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DataStreamLifecycle::setupDataStreamLifecycleDeserializer); - - protected static void setupDataStreamLifecycleDeserializer(ObjectDeserializer op) { - - op.add(Builder::dataRetention, Time._DESERIALIZER, "data_retention"); - op.add(Builder::downsampling, DataStreamLifecycleDownsampling._DESERIALIZER, "downsampling"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycleDownsampling.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycleDownsampling.java deleted file mode 100644 index b1f5696c4..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycleDownsampling.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.DataStreamLifecycleDownsampling - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DataStreamLifecycleDownsampling implements JsonpSerializable { - private final List rounds; - - // --------------------------------------------------------------------------------------------- - - private DataStreamLifecycleDownsampling(Builder builder) { - - this.rounds = ApiTypeHelper.unmodifiableRequired(builder.rounds, this, "rounds"); - - } - - public static DataStreamLifecycleDownsampling of( - Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - The list of downsampling rounds to execute as part of this - * downsampling configuration - *

- * API name: {@code rounds} - */ - public final List rounds() { - return this.rounds; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.rounds)) { - generator.writeKey("rounds"); - generator.writeStartArray(); - for (DownsamplingRound item0 : this.rounds) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DataStreamLifecycleDownsampling}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private List rounds; - - /** - * Required - The list of downsampling rounds to execute as part of this - * downsampling configuration - *

- * API name: {@code rounds} - *

- * Adds all elements of list to rounds. - */ - public final Builder rounds(List list) { - this.rounds = _listAddAll(this.rounds, list); - return this; - } - - /** - * Required - The list of downsampling rounds to execute as part of this - * downsampling configuration - *

- * API name: {@code rounds} - *

- * Adds one or more values to rounds. - */ - public final Builder rounds(DownsamplingRound value, DownsamplingRound... values) { - this.rounds = _listAdd(this.rounds, value, values); - return this; - } - - /** - * Required - The list of downsampling rounds to execute as part of this - * downsampling configuration - *

- * API name: {@code rounds} - *

- * Adds a value to rounds using a builder lambda. - */ - public final Builder rounds(Function> fn) { - return rounds(fn.apply(new DownsamplingRound.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DataStreamLifecycleDownsampling}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DataStreamLifecycleDownsampling build() { - _checkSingleUse(); - - return new DataStreamLifecycleDownsampling(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DataStreamLifecycleDownsampling} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DataStreamLifecycleDownsampling::setupDataStreamLifecycleDownsamplingDeserializer); - - protected static void setupDataStreamLifecycleDownsamplingDeserializer( - ObjectDeserializer op) { - - op.add(Builder::rounds, JsonpDeserializer.arrayDeserializer(DownsamplingRound._DESERIALIZER), "rounds"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycleRolloverConditions.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycleRolloverConditions.java deleted file mode 100644 index 96605215d..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycleRolloverConditions.java +++ /dev/null @@ -1,434 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.DataStreamLifecycleRolloverConditions - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DataStreamLifecycleRolloverConditions implements JsonpSerializable { - @Nullable - private final Time minAge; - - @Nullable - private final String maxAge; - - @Nullable - private final Long minDocs; - - @Nullable - private final Long maxDocs; - - @Nullable - private final String minSize; - - @Nullable - private final String maxSize; - - @Nullable - private final String minPrimaryShardSize; - - @Nullable - private final String maxPrimaryShardSize; - - @Nullable - private final Long minPrimaryShardDocs; - - @Nullable - private final Long maxPrimaryShardDocs; - - // --------------------------------------------------------------------------------------------- - - private DataStreamLifecycleRolloverConditions(Builder builder) { - - this.minAge = builder.minAge; - this.maxAge = builder.maxAge; - this.minDocs = builder.minDocs; - this.maxDocs = builder.maxDocs; - this.minSize = builder.minSize; - this.maxSize = builder.maxSize; - this.minPrimaryShardSize = builder.minPrimaryShardSize; - this.maxPrimaryShardSize = builder.maxPrimaryShardSize; - this.minPrimaryShardDocs = builder.minPrimaryShardDocs; - this.maxPrimaryShardDocs = builder.maxPrimaryShardDocs; - - } - - public static DataStreamLifecycleRolloverConditions of( - Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code min_age} - */ - @Nullable - public final Time minAge() { - return this.minAge; - } - - /** - * API name: {@code max_age} - */ - @Nullable - public final String maxAge() { - return this.maxAge; - } - - /** - * API name: {@code min_docs} - */ - @Nullable - public final Long minDocs() { - return this.minDocs; - } - - /** - * API name: {@code max_docs} - */ - @Nullable - public final Long maxDocs() { - return this.maxDocs; - } - - /** - * API name: {@code min_size} - */ - @Nullable - public final String minSize() { - return this.minSize; - } - - /** - * API name: {@code max_size} - */ - @Nullable - public final String maxSize() { - return this.maxSize; - } - - /** - * API name: {@code min_primary_shard_size} - */ - @Nullable - public final String minPrimaryShardSize() { - return this.minPrimaryShardSize; - } - - /** - * API name: {@code max_primary_shard_size} - */ - @Nullable - public final String maxPrimaryShardSize() { - return this.maxPrimaryShardSize; - } - - /** - * API name: {@code min_primary_shard_docs} - */ - @Nullable - public final Long minPrimaryShardDocs() { - return this.minPrimaryShardDocs; - } - - /** - * API name: {@code max_primary_shard_docs} - */ - @Nullable - public final Long maxPrimaryShardDocs() { - return this.maxPrimaryShardDocs; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.minAge != null) { - generator.writeKey("min_age"); - this.minAge.serialize(generator, mapper); - - } - if (this.maxAge != null) { - generator.writeKey("max_age"); - generator.write(this.maxAge); - - } - if (this.minDocs != null) { - generator.writeKey("min_docs"); - generator.write(this.minDocs); - - } - if (this.maxDocs != null) { - generator.writeKey("max_docs"); - generator.write(this.maxDocs); - - } - if (this.minSize != null) { - generator.writeKey("min_size"); - generator.write(this.minSize); - - } - if (this.maxSize != null) { - generator.writeKey("max_size"); - generator.write(this.maxSize); - - } - if (this.minPrimaryShardSize != null) { - generator.writeKey("min_primary_shard_size"); - generator.write(this.minPrimaryShardSize); - - } - if (this.maxPrimaryShardSize != null) { - generator.writeKey("max_primary_shard_size"); - generator.write(this.maxPrimaryShardSize); - - } - if (this.minPrimaryShardDocs != null) { - generator.writeKey("min_primary_shard_docs"); - generator.write(this.minPrimaryShardDocs); - - } - if (this.maxPrimaryShardDocs != null) { - generator.writeKey("max_primary_shard_docs"); - generator.write(this.maxPrimaryShardDocs); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DataStreamLifecycleRolloverConditions}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Time minAge; - - @Nullable - private String maxAge; - - @Nullable - private Long minDocs; - - @Nullable - private Long maxDocs; - - @Nullable - private String minSize; - - @Nullable - private String maxSize; - - @Nullable - private String minPrimaryShardSize; - - @Nullable - private String maxPrimaryShardSize; - - @Nullable - private Long minPrimaryShardDocs; - - @Nullable - private Long maxPrimaryShardDocs; - - /** - * API name: {@code min_age} - */ - public final Builder minAge(@Nullable Time value) { - this.minAge = value; - return this; - } - - /** - * API name: {@code min_age} - */ - public final Builder minAge(Function> fn) { - return this.minAge(fn.apply(new Time.Builder()).build()); - } - - /** - * API name: {@code max_age} - */ - public final Builder maxAge(@Nullable String value) { - this.maxAge = value; - return this; - } - - /** - * API name: {@code min_docs} - */ - public final Builder minDocs(@Nullable Long value) { - this.minDocs = value; - return this; - } - - /** - * API name: {@code max_docs} - */ - public final Builder maxDocs(@Nullable Long value) { - this.maxDocs = value; - return this; - } - - /** - * API name: {@code min_size} - */ - public final Builder minSize(@Nullable String value) { - this.minSize = value; - return this; - } - - /** - * API name: {@code max_size} - */ - public final Builder maxSize(@Nullable String value) { - this.maxSize = value; - return this; - } - - /** - * API name: {@code min_primary_shard_size} - */ - public final Builder minPrimaryShardSize(@Nullable String value) { - this.minPrimaryShardSize = value; - return this; - } - - /** - * API name: {@code max_primary_shard_size} - */ - public final Builder maxPrimaryShardSize(@Nullable String value) { - this.maxPrimaryShardSize = value; - return this; - } - - /** - * API name: {@code min_primary_shard_docs} - */ - public final Builder minPrimaryShardDocs(@Nullable Long value) { - this.minPrimaryShardDocs = value; - return this; - } - - /** - * API name: {@code max_primary_shard_docs} - */ - public final Builder maxPrimaryShardDocs(@Nullable Long value) { - this.maxPrimaryShardDocs = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DataStreamLifecycleRolloverConditions}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DataStreamLifecycleRolloverConditions build() { - _checkSingleUse(); - - return new DataStreamLifecycleRolloverConditions(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DataStreamLifecycleRolloverConditions} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, - DataStreamLifecycleRolloverConditions::setupDataStreamLifecycleRolloverConditionsDeserializer); - - protected static void setupDataStreamLifecycleRolloverConditionsDeserializer( - ObjectDeserializer op) { - - op.add(Builder::minAge, Time._DESERIALIZER, "min_age"); - op.add(Builder::maxAge, JsonpDeserializer.stringDeserializer(), "max_age"); - op.add(Builder::minDocs, JsonpDeserializer.longDeserializer(), "min_docs"); - op.add(Builder::maxDocs, JsonpDeserializer.longDeserializer(), "max_docs"); - op.add(Builder::minSize, JsonpDeserializer.stringDeserializer(), "min_size"); - op.add(Builder::maxSize, JsonpDeserializer.stringDeserializer(), "max_size"); - op.add(Builder::minPrimaryShardSize, JsonpDeserializer.stringDeserializer(), "min_primary_shard_size"); - op.add(Builder::maxPrimaryShardSize, JsonpDeserializer.stringDeserializer(), "max_primary_shard_size"); - op.add(Builder::minPrimaryShardDocs, JsonpDeserializer.longDeserializer(), "min_primary_shard_docs"); - op.add(Builder::maxPrimaryShardDocs, JsonpDeserializer.longDeserializer(), "max_primary_shard_docs"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycleWithRollover.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycleWithRollover.java deleted file mode 100644 index 14e94e6e1..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycleWithRollover.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.DataStreamLifecycleWithRollover - -/** - * Data stream lifecycle with rollover can be used to display the configuration - * including the default rollover conditions, if asked. - * - * @see API - * specification - */ -@JsonpDeserializable -public class DataStreamLifecycleWithRollover implements JsonpSerializable { - @Nullable - private final Time dataRetention; - - @Nullable - private final DataStreamLifecycleDownsampling downsampling; - - @Nullable - private final DataStreamLifecycleRolloverConditions rollover; - - // --------------------------------------------------------------------------------------------- - - private DataStreamLifecycleWithRollover(Builder builder) { - - this.dataRetention = builder.dataRetention; - this.downsampling = builder.downsampling; - this.rollover = builder.rollover; - - } - - public static DataStreamLifecycleWithRollover of( - Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If defined, every document added to this data stream will be stored at least - * for this time frame. Any time after this duration the document could be - * deleted. When empty, every document in this data stream will be stored - * indefinitely. - *

- * API name: {@code data_retention} - */ - @Nullable - public final Time dataRetention() { - return this.dataRetention; - } - - /** - * The downsampling configuration to execute for the managed backing index after - * rollover. - *

- * API name: {@code downsampling} - */ - @Nullable - public final DataStreamLifecycleDownsampling downsampling() { - return this.downsampling; - } - - /** - * The conditions which will trigger the rollover of a backing index as - * configured by the cluster setting - * cluster.lifecycle.default.rollover. This property is an - * implementation detail and it will only be retrieved when the query param - * include_defaults is set to true. The contents of this field are - * subject to change. - *

- * API name: {@code rollover} - */ - @Nullable - public final DataStreamLifecycleRolloverConditions rollover() { - return this.rollover; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.dataRetention != null) { - generator.writeKey("data_retention"); - this.dataRetention.serialize(generator, mapper); - - } - if (this.downsampling != null) { - generator.writeKey("downsampling"); - this.downsampling.serialize(generator, mapper); - - } - if (this.rollover != null) { - generator.writeKey("rollover"); - this.rollover.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DataStreamLifecycleWithRollover}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Time dataRetention; - - @Nullable - private DataStreamLifecycleDownsampling downsampling; - - @Nullable - private DataStreamLifecycleRolloverConditions rollover; - - /** - * If defined, every document added to this data stream will be stored at least - * for this time frame. Any time after this duration the document could be - * deleted. When empty, every document in this data stream will be stored - * indefinitely. - *

- * API name: {@code data_retention} - */ - public final Builder dataRetention(@Nullable Time value) { - this.dataRetention = value; - return this; - } - - /** - * If defined, every document added to this data stream will be stored at least - * for this time frame. Any time after this duration the document could be - * deleted. When empty, every document in this data stream will be stored - * indefinitely. - *

- * API name: {@code data_retention} - */ - public final Builder dataRetention(Function> fn) { - return this.dataRetention(fn.apply(new Time.Builder()).build()); - } - - /** - * The downsampling configuration to execute for the managed backing index after - * rollover. - *

- * API name: {@code downsampling} - */ - public final Builder downsampling(@Nullable DataStreamLifecycleDownsampling value) { - this.downsampling = value; - return this; - } - - /** - * The downsampling configuration to execute for the managed backing index after - * rollover. - *

- * API name: {@code downsampling} - */ - public final Builder downsampling( - Function> fn) { - return this.downsampling(fn.apply(new DataStreamLifecycleDownsampling.Builder()).build()); - } - - /** - * The conditions which will trigger the rollover of a backing index as - * configured by the cluster setting - * cluster.lifecycle.default.rollover. This property is an - * implementation detail and it will only be retrieved when the query param - * include_defaults is set to true. The contents of this field are - * subject to change. - *

- * API name: {@code rollover} - */ - public final Builder rollover(@Nullable DataStreamLifecycleRolloverConditions value) { - this.rollover = value; - return this; - } - - /** - * The conditions which will trigger the rollover of a backing index as - * configured by the cluster setting - * cluster.lifecycle.default.rollover. This property is an - * implementation detail and it will only be retrieved when the query param - * include_defaults is set to true. The contents of this field are - * subject to change. - *

- * API name: {@code rollover} - */ - public final Builder rollover( - Function> fn) { - return this.rollover(fn.apply(new DataStreamLifecycleRolloverConditions.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DataStreamLifecycleWithRollover}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DataStreamLifecycleWithRollover build() { - _checkSingleUse(); - - return new DataStreamLifecycleWithRollover(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DataStreamLifecycleWithRollover} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DataStreamLifecycleWithRollover::setupDataStreamLifecycleWithRolloverDeserializer); - - protected static void setupDataStreamLifecycleWithRolloverDeserializer( - ObjectDeserializer op) { - - op.add(Builder::dataRetention, Time._DESERIALIZER, "data_retention"); - op.add(Builder::downsampling, DataStreamLifecycleDownsampling._DESERIALIZER, "downsampling"); - op.add(Builder::rollover, DataStreamLifecycleRolloverConditions._DESERIALIZER, "rollover"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamTimestampField.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamTimestampField.java deleted file mode 100644 index ae0ea8287..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamTimestampField.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.DataStreamTimestampField - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DataStreamTimestampField implements JsonpSerializable { - private final String name; - - // --------------------------------------------------------------------------------------------- - - private DataStreamTimestampField(Builder builder) { - - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - - } - - public static DataStreamTimestampField of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Name of the timestamp field for the data stream, which must be - * @timestamp. The @timestamp field must be included - * in every document indexed to the data stream. - *

- * API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("name"); - generator.write(this.name); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DataStreamTimestampField}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private String name; - - /** - * Required - Name of the timestamp field for the data stream, which must be - * @timestamp. The @timestamp field must be included - * in every document indexed to the data stream. - *

- * API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DataStreamTimestampField}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DataStreamTimestampField build() { - _checkSingleUse(); - - return new DataStreamTimestampField(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DataStreamTimestampField} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DataStreamTimestampField::setupDataStreamTimestampFieldDeserializer); - - protected static void setupDataStreamTimestampFieldDeserializer( - ObjectDeserializer op) { - - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamVisibility.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamVisibility.java deleted file mode 100644 index 9f562c19d..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamVisibility.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.DataStreamVisibility - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DataStreamVisibility implements JsonpSerializable { - @Nullable - private final Boolean hidden; - - // --------------------------------------------------------------------------------------------- - - private DataStreamVisibility(Builder builder) { - - this.hidden = builder.hidden; - - } - - public static DataStreamVisibility of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code hidden} - */ - @Nullable - public final Boolean hidden() { - return this.hidden; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.hidden != null) { - generator.writeKey("hidden"); - generator.write(this.hidden); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DataStreamVisibility}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Boolean hidden; - - /** - * API name: {@code hidden} - */ - public final Builder hidden(@Nullable Boolean value) { - this.hidden = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DataStreamVisibility}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DataStreamVisibility build() { - _checkSingleUse(); - - return new DataStreamVisibility(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DataStreamVisibility} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DataStreamVisibility::setupDataStreamVisibilityDeserializer); - - protected static void setupDataStreamVisibilityDeserializer(ObjectDeserializer op) { - - op.add(Builder::hidden, JsonpDeserializer.booleanDeserializer(), "hidden"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamsStatsRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamsStatsRequest.java deleted file mode 100644 index 04e7ed9f3..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamsStatsRequest.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.data_streams_stats.Request - -/** - * Get data stream stats. Retrieves statistics for one or more data streams. - * - * @see API - * specification - */ - -public class DataStreamsStatsRequest extends RequestBase { - private final List expandWildcards; - - @Nullable - private final String name; - - // --------------------------------------------------------------------------------------------- - - private DataStreamsStatsRequest(Builder builder) { - - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.name = builder.name; - - } - - public static DataStreamsStatsRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Type of data stream that wildcard patterns can match. Supports - * comma-separated values, such as open,hidden. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * Comma-separated list of data streams used to limit the request. Wildcard - * expressions (*) are supported. To target all data streams in a - * cluster, omit this parameter or use *. - *

- * API name: {@code name} - */ - @Nullable - public final String name() { - return this.name; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DataStreamsStatsRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private List expandWildcards; - - @Nullable - private String name; - - /** - * Type of data stream that wildcard patterns can match. Supports - * comma-separated values, such as open,hidden. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Type of data stream that wildcard patterns can match. Supports - * comma-separated values, such as open,hidden. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * Comma-separated list of data streams used to limit the request. Wildcard - * expressions (*) are supported. To target all data streams in a - * cluster, omit this parameter or use *. - *

- * API name: {@code name} - */ - public final Builder name(@Nullable String value) { - this.name = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DataStreamsStatsRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DataStreamsStatsRequest build() { - _checkSingleUse(); - - return new DataStreamsStatsRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.data_streams_stats}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.data_streams_stats", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - if (request.name() != null) - propsSet |= _name; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_data_stream"); - buf.append("/_stats"); - return buf.toString(); - } - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_data_stream"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name, buf); - buf.append("/_stats"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - if (request.name() != null) - propsSet |= _name; - - if (propsSet == 0) { - } - if (propsSet == (_name)) { - params.put("name", request.name); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, DataStreamsStatsResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamsStatsResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamsStatsResponse.java deleted file mode 100644 index efd8a3023..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamsStatsResponse.java +++ /dev/null @@ -1,360 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ShardStatistics; -import co.elastic.clients.elasticsearch.indices.data_streams_stats.DataStreamsStatsItem; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.Long; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.data_streams_stats.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DataStreamsStatsResponse implements JsonpSerializable { - private final ShardStatistics shards; - - private final int backingIndices; - - private final int dataStreamCount; - - private final List dataStreams; - - @Nullable - private final String totalStoreSizes; - - private final long totalStoreSizeBytes; - - // --------------------------------------------------------------------------------------------- - - private DataStreamsStatsResponse(Builder builder) { - - this.shards = ApiTypeHelper.requireNonNull(builder.shards, this, "shards"); - this.backingIndices = ApiTypeHelper.requireNonNull(builder.backingIndices, this, "backingIndices"); - this.dataStreamCount = ApiTypeHelper.requireNonNull(builder.dataStreamCount, this, "dataStreamCount"); - this.dataStreams = ApiTypeHelper.unmodifiableRequired(builder.dataStreams, this, "dataStreams"); - this.totalStoreSizes = builder.totalStoreSizes; - this.totalStoreSizeBytes = ApiTypeHelper.requireNonNull(builder.totalStoreSizeBytes, this, - "totalStoreSizeBytes"); - - } - - public static DataStreamsStatsResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Contains information about shards that attempted to execute the - * request. - *

- * API name: {@code _shards} - */ - public final ShardStatistics shards() { - return this.shards; - } - - /** - * Required - Total number of backing indices for the selected data streams. - *

- * API name: {@code backing_indices} - */ - public final int backingIndices() { - return this.backingIndices; - } - - /** - * Required - Total number of selected data streams. - *

- * API name: {@code data_stream_count} - */ - public final int dataStreamCount() { - return this.dataStreamCount; - } - - /** - * Required - Contains statistics for the selected data streams. - *

- * API name: {@code data_streams} - */ - public final List dataStreams() { - return this.dataStreams; - } - - /** - * Total size of all shards for the selected data streams. This property is - * included only if the human query parameter is true - *

- * API name: {@code total_store_sizes} - */ - @Nullable - public final String totalStoreSizes() { - return this.totalStoreSizes; - } - - /** - * Required - Total size, in bytes, of all shards for the selected data streams. - *

- * API name: {@code total_store_size_bytes} - */ - public final long totalStoreSizeBytes() { - return this.totalStoreSizeBytes; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("_shards"); - this.shards.serialize(generator, mapper); - - generator.writeKey("backing_indices"); - generator.write(this.backingIndices); - - generator.writeKey("data_stream_count"); - generator.write(this.dataStreamCount); - - if (ApiTypeHelper.isDefined(this.dataStreams)) { - generator.writeKey("data_streams"); - generator.writeStartArray(); - for (DataStreamsStatsItem item0 : this.dataStreams) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.totalStoreSizes != null) { - generator.writeKey("total_store_sizes"); - generator.write(this.totalStoreSizes); - - } - generator.writeKey("total_store_size_bytes"); - generator.write(this.totalStoreSizeBytes); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DataStreamsStatsResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private ShardStatistics shards; - - private Integer backingIndices; - - private Integer dataStreamCount; - - private List dataStreams; - - @Nullable - private String totalStoreSizes; - - private Long totalStoreSizeBytes; - - /** - * Required - Contains information about shards that attempted to execute the - * request. - *

- * API name: {@code _shards} - */ - public final Builder shards(ShardStatistics value) { - this.shards = value; - return this; - } - - /** - * Required - Contains information about shards that attempted to execute the - * request. - *

- * API name: {@code _shards} - */ - public final Builder shards(Function> fn) { - return this.shards(fn.apply(new ShardStatistics.Builder()).build()); - } - - /** - * Required - Total number of backing indices for the selected data streams. - *

- * API name: {@code backing_indices} - */ - public final Builder backingIndices(int value) { - this.backingIndices = value; - return this; - } - - /** - * Required - Total number of selected data streams. - *

- * API name: {@code data_stream_count} - */ - public final Builder dataStreamCount(int value) { - this.dataStreamCount = value; - return this; - } - - /** - * Required - Contains statistics for the selected data streams. - *

- * API name: {@code data_streams} - *

- * Adds all elements of list to dataStreams. - */ - public final Builder dataStreams(List list) { - this.dataStreams = _listAddAll(this.dataStreams, list); - return this; - } - - /** - * Required - Contains statistics for the selected data streams. - *

- * API name: {@code data_streams} - *

- * Adds one or more values to dataStreams. - */ - public final Builder dataStreams(DataStreamsStatsItem value, DataStreamsStatsItem... values) { - this.dataStreams = _listAdd(this.dataStreams, value, values); - return this; - } - - /** - * Required - Contains statistics for the selected data streams. - *

- * API name: {@code data_streams} - *

- * Adds a value to dataStreams using a builder lambda. - */ - public final Builder dataStreams( - Function> fn) { - return dataStreams(fn.apply(new DataStreamsStatsItem.Builder()).build()); - } - - /** - * Total size of all shards for the selected data streams. This property is - * included only if the human query parameter is true - *

- * API name: {@code total_store_sizes} - */ - public final Builder totalStoreSizes(@Nullable String value) { - this.totalStoreSizes = value; - return this; - } - - /** - * Required - Total size, in bytes, of all shards for the selected data streams. - *

- * API name: {@code total_store_size_bytes} - */ - public final Builder totalStoreSizeBytes(long value) { - this.totalStoreSizeBytes = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DataStreamsStatsResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DataStreamsStatsResponse build() { - _checkSingleUse(); - - return new DataStreamsStatsResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DataStreamsStatsResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DataStreamsStatsResponse::setupDataStreamsStatsResponseDeserializer); - - protected static void setupDataStreamsStatsResponseDeserializer( - ObjectDeserializer op) { - - op.add(Builder::shards, ShardStatistics._DESERIALIZER, "_shards"); - op.add(Builder::backingIndices, JsonpDeserializer.integerDeserializer(), "backing_indices"); - op.add(Builder::dataStreamCount, JsonpDeserializer.integerDeserializer(), "data_stream_count"); - op.add(Builder::dataStreams, JsonpDeserializer.arrayDeserializer(DataStreamsStatsItem._DESERIALIZER), - "data_streams"); - op.add(Builder::totalStoreSizes, JsonpDeserializer.stringDeserializer(), "total_store_sizes"); - op.add(Builder::totalStoreSizeBytes, JsonpDeserializer.longDeserializer(), "total_store_size_bytes"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteAliasRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteAliasRequest.java deleted file mode 100644 index 711ef9bb2..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteAliasRequest.java +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.delete_alias.Request - -/** - * Delete an alias. Removes a data stream or index from an alias. - * - * @see API - * specification - */ - -public class DeleteAliasRequest extends RequestBase { - private final List index; - - @Nullable - private final Time masterTimeout; - - private final List name; - - @Nullable - private final Time timeout; - - // --------------------------------------------------------------------------------------------- - - private DeleteAliasRequest(Builder builder) { - - this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); - this.masterTimeout = builder.masterTimeout; - this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); - this.timeout = builder.timeout; - - } - - public static DeleteAliasRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Comma-separated list of data streams or indices used to limit the - * request. Supports wildcards (*). - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Required - Comma-separated list of aliases to remove. Supports wildcards - * (*). To remove all aliases, use * or - * _all. - *

- * API name: {@code name} - */ - public final List name() { - return this.name; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DeleteAliasRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - private List index; - - @Nullable - private Time masterTimeout; - - private List name; - - @Nullable - private Time timeout; - - /** - * Required - Comma-separated list of data streams or indices used to limit the - * request. Supports wildcards (*). - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * Required - Comma-separated list of data streams or indices used to limit the - * request. Supports wildcards (*). - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - Comma-separated list of aliases to remove. Supports wildcards - * (*). To remove all aliases, use * or - * _all. - *

- * API name: {@code name} - *

- * Adds all elements of list to name. - */ - public final Builder name(List list) { - this.name = _listAddAll(this.name, list); - return this; - } - - /** - * Required - Comma-separated list of aliases to remove. Supports wildcards - * (*). To remove all aliases, use * or - * _all. - *

- * API name: {@code name} - *

- * Adds one or more values to name. - */ - public final Builder name(String value, String... values) { - this.name = _listAdd(this.name, value, values); - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DeleteAliasRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DeleteAliasRequest build() { - _checkSingleUse(); - - return new DeleteAliasRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.delete_alias}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.delete_alias", - - // Request method - request -> { - return "DELETE"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - final int _index = 1 << 1; - - int propsSet = 0; - - propsSet |= _name; - propsSet |= _index; - - if (propsSet == (_index | _name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_alias"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - if (propsSet == (_index | _name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_aliases"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - final int _index = 1 << 1; - - int propsSet = 0; - - propsSet |= _name; - propsSet |= _index; - - if (propsSet == (_index | _name)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); - } - if (propsSet == (_index | _name)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, DeleteAliasResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteAliasResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteAliasResponse.java deleted file mode 100644 index 1255191ab..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteAliasResponse.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.delete_alias.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DeleteAliasResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private DeleteAliasResponse(Builder builder) { - super(builder); - - } - - public static DeleteAliasResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DeleteAliasResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DeleteAliasResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DeleteAliasResponse build() { - _checkSingleUse(); - - return new DeleteAliasResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DeleteAliasResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DeleteAliasResponse::setupDeleteAliasResponseDeserializer); - - protected static void setupDeleteAliasResponseDeserializer(ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataLifecycleRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataLifecycleRequest.java deleted file mode 100644 index 806db4c28..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataLifecycleRequest.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.delete_data_lifecycle.Request - -/** - * Delete data stream lifecycles. Removes the data stream lifecycle from a data - * stream, rendering it not managed by the data stream lifecycle. - * - * @see API - * specification - */ - -public class DeleteDataLifecycleRequest extends RequestBase { - private final List expandWildcards; - - @Nullable - private final Time masterTimeout; - - private final List name; - - @Nullable - private final Time timeout; - - // --------------------------------------------------------------------------------------------- - - private DeleteDataLifecycleRequest(Builder builder) { - - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.masterTimeout = builder.masterTimeout; - this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); - this.timeout = builder.timeout; - - } - - public static DeleteDataLifecycleRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Whether wildcard expressions should get expanded to open or closed indices - * (default: open) - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * Specify timeout for connection to master - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Required - A comma-separated list of data streams of which the data stream - * lifecycle will be deleted; use * to get all data streams - *

- * API name: {@code name} - */ - public final List name() { - return this.name; - } - - /** - * Explicit timestamp for the document - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DeleteDataLifecycleRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private List expandWildcards; - - @Nullable - private Time masterTimeout; - - private List name; - - @Nullable - private Time timeout; - - /** - * Whether wildcard expressions should get expanded to open or closed indices - * (default: open) - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Whether wildcard expressions should get expanded to open or closed indices - * (default: open) - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * Specify timeout for connection to master - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Specify timeout for connection to master - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - A comma-separated list of data streams of which the data stream - * lifecycle will be deleted; use * to get all data streams - *

- * API name: {@code name} - *

- * Adds all elements of list to name. - */ - public final Builder name(List list) { - this.name = _listAddAll(this.name, list); - return this; - } - - /** - * Required - A comma-separated list of data streams of which the data stream - * lifecycle will be deleted; use * to get all data streams - *

- * API name: {@code name} - *

- * Adds one or more values to name. - */ - public final Builder name(String value, String... values) { - this.name = _listAdd(this.name, value, values); - return this; - } - - /** - * Explicit timestamp for the document - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Explicit timestamp for the document - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DeleteDataLifecycleRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DeleteDataLifecycleRequest build() { - _checkSingleUse(); - - return new DeleteDataLifecycleRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.delete_data_lifecycle}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.delete_data_lifecycle", - - // Request method - request -> { - return "DELETE"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_data_stream"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_lifecycle"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, DeleteDataLifecycleResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataLifecycleResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataLifecycleResponse.java deleted file mode 100644 index e1f782794..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataLifecycleResponse.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.delete_data_lifecycle.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DeleteDataLifecycleResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private DeleteDataLifecycleResponse(Builder builder) { - super(builder); - - } - - public static DeleteDataLifecycleResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DeleteDataLifecycleResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DeleteDataLifecycleResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DeleteDataLifecycleResponse build() { - _checkSingleUse(); - - return new DeleteDataLifecycleResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DeleteDataLifecycleResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DeleteDataLifecycleResponse::setupDeleteDataLifecycleResponseDeserializer); - - protected static void setupDeleteDataLifecycleResponseDeserializer( - ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataStreamRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataStreamRequest.java deleted file mode 100644 index 4b048ef15..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataStreamRequest.java +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.delete_data_stream.Request - -/** - * Delete data streams. Deletes one or more data streams and their backing - * indices. - * - * @see API - * specification - */ - -public class DeleteDataStreamRequest extends RequestBase { - private final List expandWildcards; - - @Nullable - private final Time masterTimeout; - - private final List name; - - // --------------------------------------------------------------------------------------------- - - private DeleteDataStreamRequest(Builder builder) { - - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.masterTimeout = builder.masterTimeout; - this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); - - } - - public static DeleteDataStreamRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Type of data stream that wildcard patterns can match. Supports - * comma-separated values,such as open,hidden. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Required - Comma-separated list of data streams to delete. Wildcard - * (*) expressions are supported. - *

- * API name: {@code name} - */ - public final List name() { - return this.name; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DeleteDataStreamRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private List expandWildcards; - - @Nullable - private Time masterTimeout; - - private List name; - - /** - * Type of data stream that wildcard patterns can match. Supports - * comma-separated values,such as open,hidden. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Type of data stream that wildcard patterns can match. Supports - * comma-separated values,such as open,hidden. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - Comma-separated list of data streams to delete. Wildcard - * (*) expressions are supported. - *

- * API name: {@code name} - *

- * Adds all elements of list to name. - */ - public final Builder name(List list) { - this.name = _listAddAll(this.name, list); - return this; - } - - /** - * Required - Comma-separated list of data streams to delete. Wildcard - * (*) expressions are supported. - *

- * API name: {@code name} - *

- * Adds one or more values to name. - */ - public final Builder name(String value, String... values) { - this.name = _listAdd(this.name, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DeleteDataStreamRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DeleteDataStreamRequest build() { - _checkSingleUse(); - - return new DeleteDataStreamRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.delete_data_stream}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.delete_data_stream", - - // Request method - request -> { - return "DELETE"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_data_stream"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, DeleteDataStreamResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataStreamResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataStreamResponse.java deleted file mode 100644 index a31ed5d30..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataStreamResponse.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.delete_data_stream.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DeleteDataStreamResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private DeleteDataStreamResponse(Builder builder) { - super(builder); - - } - - public static DeleteDataStreamResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DeleteDataStreamResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DeleteDataStreamResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DeleteDataStreamResponse build() { - _checkSingleUse(); - - return new DeleteDataStreamResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DeleteDataStreamResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DeleteDataStreamResponse::setupDeleteDataStreamResponseDeserializer); - - protected static void setupDeleteDataStreamResponseDeserializer( - ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexRequest.java deleted file mode 100644 index 65b550b03..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexRequest.java +++ /dev/null @@ -1,421 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.delete.Request - -/** - * Delete indices. Deletes one or more indices. - * - * @see API - * specification - */ - -public class DeleteIndexRequest extends RequestBase { - @Nullable - private final Boolean allowNoIndices; - - private final List expandWildcards; - - @Nullable - private final Boolean ignoreUnavailable; - - private final List index; - - @Nullable - private final Time masterTimeout; - - @Nullable - private final Time timeout; - - // --------------------------------------------------------------------------------------------- - - private DeleteIndexRequest(Builder builder) { - - this.allowNoIndices = builder.allowNoIndices; - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.ignoreUnavailable = builder.ignoreUnavailable; - this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); - this.masterTimeout = builder.masterTimeout; - this.timeout = builder.timeout; - - } - - public static DeleteIndexRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. - *

- * API name: {@code allow_no_indices} - */ - @Nullable - public final Boolean allowNoIndices() { - return this.allowNoIndices; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * If false, the request returns an error if it targets a missing - * or closed index. - *

- * API name: {@code ignore_unavailable} - */ - @Nullable - public final Boolean ignoreUnavailable() { - return this.ignoreUnavailable; - } - - /** - * Required - Comma-separated list of indices to delete. You cannot specify - * index aliases. By default, this parameter does not support wildcards - * (*) or _all. To use wildcards or _all, - * set the action.destructive_requires_name cluster setting to - * false. - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DeleteIndexRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Boolean allowNoIndices; - - @Nullable - private List expandWildcards; - - @Nullable - private Boolean ignoreUnavailable; - - private List index; - - @Nullable - private Time masterTimeout; - - @Nullable - private Time timeout; - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. - *

- * API name: {@code allow_no_indices} - */ - public final Builder allowNoIndices(@Nullable Boolean value) { - this.allowNoIndices = value; - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * If false, the request returns an error if it targets a missing - * or closed index. - *

- * API name: {@code ignore_unavailable} - */ - public final Builder ignoreUnavailable(@Nullable Boolean value) { - this.ignoreUnavailable = value; - return this; - } - - /** - * Required - Comma-separated list of indices to delete. You cannot specify - * index aliases. By default, this parameter does not support wildcards - * (*) or _all. To use wildcards or _all, - * set the action.destructive_requires_name cluster setting to - * false. - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * Required - Comma-separated list of indices to delete. You cannot specify - * index aliases. By default, this parameter does not support wildcards - * (*) or _all. To use wildcards or _all, - * set the action.destructive_requires_name cluster setting to - * false. - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DeleteIndexRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DeleteIndexRequest build() { - _checkSingleUse(); - - return new DeleteIndexRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.delete}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.delete", - - // Request method - request -> { - return "DELETE"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, DeleteIndexResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexResponse.java deleted file mode 100644 index 9a982fd93..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexResponse.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.IndicesResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.delete.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DeleteIndexResponse extends IndicesResponseBase { - // --------------------------------------------------------------------------------------------- - - private DeleteIndexResponse(Builder builder) { - super(builder); - - } - - public static DeleteIndexResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DeleteIndexResponse}. - */ - - public static class Builder extends IndicesResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DeleteIndexResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DeleteIndexResponse build() { - _checkSingleUse(); - - return new DeleteIndexResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DeleteIndexResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DeleteIndexResponse::setupDeleteIndexResponseDeserializer); - - protected static void setupDeleteIndexResponseDeserializer(ObjectDeserializer op) { - IndicesResponseBase.setupIndicesResponseBaseDeserializer(op); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexTemplateRequest.java deleted file mode 100644 index 95e207025..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexTemplateRequest.java +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.delete_index_template.Request - -/** - * Delete an index template. The provided <index-template> may contain - * multiple template names separated by a comma. If multiple template names are - * specified then there is no wildcard support and the provided names should - * match completely with existing templates. - * - * @see API - * specification - */ - -public class DeleteIndexTemplateRequest extends RequestBase { - @Nullable - private final Time masterTimeout; - - private final List name; - - @Nullable - private final Time timeout; - - // --------------------------------------------------------------------------------------------- - - private DeleteIndexTemplateRequest(Builder builder) { - - this.masterTimeout = builder.masterTimeout; - this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); - this.timeout = builder.timeout; - - } - - public static DeleteIndexTemplateRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Required - Comma-separated list of index template names used to limit the - * request. Wildcard (*) expressions are supported. - *

- * API name: {@code name} - */ - public final List name() { - return this.name; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DeleteIndexTemplateRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Time masterTimeout; - - private List name; - - @Nullable - private Time timeout; - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - Comma-separated list of index template names used to limit the - * request. Wildcard (*) expressions are supported. - *

- * API name: {@code name} - *

- * Adds all elements of list to name. - */ - public final Builder name(List list) { - this.name = _listAddAll(this.name, list); - return this; - } - - /** - * Required - Comma-separated list of index template names used to limit the - * request. Wildcard (*) expressions are supported. - *

- * API name: {@code name} - *

- * Adds one or more values to name. - */ - public final Builder name(String value, String... values) { - this.name = _listAdd(this.name, value, values); - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DeleteIndexTemplateRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DeleteIndexTemplateRequest build() { - _checkSingleUse(); - - return new DeleteIndexTemplateRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.delete_index_template}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.delete_index_template", - - // Request method - request -> { - return "DELETE"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_index_template"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, DeleteIndexTemplateResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexTemplateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexTemplateResponse.java deleted file mode 100644 index 521988450..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexTemplateResponse.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.delete_index_template.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DeleteIndexTemplateResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private DeleteIndexTemplateResponse(Builder builder) { - super(builder); - - } - - public static DeleteIndexTemplateResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DeleteIndexTemplateResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DeleteIndexTemplateResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DeleteIndexTemplateResponse build() { - _checkSingleUse(); - - return new DeleteIndexTemplateResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DeleteIndexTemplateResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DeleteIndexTemplateResponse::setupDeleteIndexTemplateResponseDeserializer); - - protected static void setupDeleteIndexTemplateResponseDeserializer( - ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DownsampleConfig.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DownsampleConfig.java deleted file mode 100644 index 0b9f04da8..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DownsampleConfig.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.DownsampleConfig - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DownsampleConfig implements JsonpSerializable { - private final Time fixedInterval; - - // --------------------------------------------------------------------------------------------- - - private DownsampleConfig(Builder builder) { - - this.fixedInterval = ApiTypeHelper.requireNonNull(builder.fixedInterval, this, "fixedInterval"); - - } - - public static DownsampleConfig of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - The interval at which to aggregate the original time series index. - *

- * API name: {@code fixed_interval} - */ - public final Time fixedInterval() { - return this.fixedInterval; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("fixed_interval"); - this.fixedInterval.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DownsampleConfig}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Time fixedInterval; - - /** - * Required - The interval at which to aggregate the original time series index. - *

- * API name: {@code fixed_interval} - */ - public final Builder fixedInterval(Time value) { - this.fixedInterval = value; - return this; - } - - /** - * Required - The interval at which to aggregate the original time series index. - *

- * API name: {@code fixed_interval} - */ - public final Builder fixedInterval(Function> fn) { - return this.fixedInterval(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DownsampleConfig}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DownsampleConfig build() { - _checkSingleUse(); - - return new DownsampleConfig(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DownsampleConfig} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - DownsampleConfig::setupDownsampleConfigDeserializer); - - protected static void setupDownsampleConfigDeserializer(ObjectDeserializer op) { - - op.add(Builder::fixedInterval, Time._DESERIALIZER, "fixed_interval"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DownsamplingRound.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DownsamplingRound.java deleted file mode 100644 index 047b3a94c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DownsamplingRound.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.DownsamplingRound - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DownsamplingRound implements JsonpSerializable { - private final Time after; - - private final DownsampleConfig config; - - // --------------------------------------------------------------------------------------------- - - private DownsamplingRound(Builder builder) { - - this.after = ApiTypeHelper.requireNonNull(builder.after, this, "after"); - this.config = ApiTypeHelper.requireNonNull(builder.config, this, "config"); - - } - - public static DownsamplingRound of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - The duration since rollover when this downsampling round should - * execute - *

- * API name: {@code after} - */ - public final Time after() { - return this.after; - } - - /** - * Required - The downsample configuration to execute. - *

- * API name: {@code config} - */ - public final DownsampleConfig config() { - return this.config; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("after"); - this.after.serialize(generator, mapper); - - generator.writeKey("config"); - this.config.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DownsamplingRound}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Time after; - - private DownsampleConfig config; - - /** - * Required - The duration since rollover when this downsampling round should - * execute - *

- * API name: {@code after} - */ - public final Builder after(Time value) { - this.after = value; - return this; - } - - /** - * Required - The duration since rollover when this downsampling round should - * execute - *

- * API name: {@code after} - */ - public final Builder after(Function> fn) { - return this.after(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - The downsample configuration to execute. - *

- * API name: {@code config} - */ - public final Builder config(DownsampleConfig value) { - this.config = value; - return this; - } - - /** - * Required - The downsample configuration to execute. - *

- * API name: {@code config} - */ - public final Builder config(Function> fn) { - return this.config(fn.apply(new DownsampleConfig.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DownsamplingRound}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DownsamplingRound build() { - _checkSingleUse(); - - return new DownsamplingRound(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DownsamplingRound} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DownsamplingRound::setupDownsamplingRoundDeserializer); - - protected static void setupDownsamplingRoundDeserializer(ObjectDeserializer op) { - - op.add(Builder::after, Time._DESERIALIZER, "after"); - op.add(Builder::config, DownsampleConfig._DESERIALIZER, "config"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesAsyncClient.java deleted file mode 100644 index fe5ed34cb..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesAsyncClient.java +++ /dev/null @@ -1,1502 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.ApiClient; -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.transport.ElasticsearchTransport; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.JsonEndpoint; -import co.elastic.clients.transport.Transport; -import co.elastic.clients.transport.TransportOptions; -import co.elastic.clients.transport.endpoints.BooleanResponse; -import co.elastic.clients.util.ObjectBuilder; -import java.util.concurrent.CompletableFuture; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Client for the indices namespace. - */ -public class ElasticsearchIndicesAsyncClient - extends - ApiClient { - - public ElasticsearchIndicesAsyncClient(ElasticsearchTransport transport) { - super(transport, null); - } - - public ElasticsearchIndicesAsyncClient(ElasticsearchTransport transport, - @Nullable TransportOptions transportOptions) { - super(transport, transportOptions); - } - - @Override - public ElasticsearchIndicesAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) { - return new ElasticsearchIndicesAsyncClient(this.transport, transportOptions); - } - - // ----- Endpoint: indices.add_block - - /** - * Add an index block. Limits the operations allowed on an index by blocking - * specific operation types. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture addBlock(AddBlockRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) AddBlockRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Add an index block. Limits the operations allowed on an index by blocking - * specific operation types. - * - * @param fn - * a function that initializes a builder to create the - * {@link AddBlockRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture addBlock( - Function> fn) { - return addBlock(fn.apply(new AddBlockRequest.Builder()).build()); - } - - // ----- Endpoint: indices.analyze - - /** - * Performs analysis on a text string and returns the resulting tokens. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture analyze(AnalyzeRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) AnalyzeRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Performs analysis on a text string and returns the resulting tokens. - * - * @param fn - * a function that initializes a builder to create the - * {@link AnalyzeRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture analyze( - Function> fn) { - return analyze(fn.apply(new AnalyzeRequest.Builder()).build()); - } - - /** - * Performs analysis on a text string and returns the resulting tokens. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture analyze() { - return this.transport.performRequestAsync(new AnalyzeRequest.Builder().build(), AnalyzeRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: indices.create - - /** - * Create an index. Creates a new index. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture create(CreateIndexRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) CreateIndexRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Create an index. Creates a new index. - * - * @param fn - * a function that initializes a builder to create the - * {@link CreateIndexRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture create( - Function> fn) { - return create(fn.apply(new CreateIndexRequest.Builder()).build()); - } - - // ----- Endpoint: indices.create_data_stream - - /** - * Create a data stream. Creates a data stream. You must have a matching index - * template with data stream enabled. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture createDataStream(CreateDataStreamRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) CreateDataStreamRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Create a data stream. Creates a data stream. You must have a matching index - * template with data stream enabled. - * - * @param fn - * a function that initializes a builder to create the - * {@link CreateDataStreamRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture createDataStream( - Function> fn) { - return createDataStream(fn.apply(new CreateDataStreamRequest.Builder()).build()); - } - - // ----- Endpoint: indices.data_streams_stats - - /** - * Get data stream stats. Retrieves statistics for one or more data streams. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture dataStreamsStats(DataStreamsStatsRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DataStreamsStatsRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Get data stream stats. Retrieves statistics for one or more data streams. - * - * @param fn - * a function that initializes a builder to create the - * {@link DataStreamsStatsRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture dataStreamsStats( - Function> fn) { - return dataStreamsStats(fn.apply(new DataStreamsStatsRequest.Builder()).build()); - } - - /** - * Get data stream stats. Retrieves statistics for one or more data streams. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture dataStreamsStats() { - return this.transport.performRequestAsync(new DataStreamsStatsRequest.Builder().build(), - DataStreamsStatsRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: indices.delete - - /** - * Delete indices. Deletes one or more indices. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture delete(DeleteIndexRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteIndexRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Delete indices. Deletes one or more indices. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeleteIndexRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture delete( - Function> fn) { - return delete(fn.apply(new DeleteIndexRequest.Builder()).build()); - } - - // ----- Endpoint: indices.delete_alias - - /** - * Delete an alias. Removes a data stream or index from an alias. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture deleteAlias(DeleteAliasRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteAliasRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Delete an alias. Removes a data stream or index from an alias. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeleteAliasRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture deleteAlias( - Function> fn) { - return deleteAlias(fn.apply(new DeleteAliasRequest.Builder()).build()); - } - - // ----- Endpoint: indices.delete_data_lifecycle - - /** - * Delete data stream lifecycles. Removes the data stream lifecycle from a data - * stream, rendering it not managed by the data stream lifecycle. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture deleteDataLifecycle(DeleteDataLifecycleRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteDataLifecycleRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Delete data stream lifecycles. Removes the data stream lifecycle from a data - * stream, rendering it not managed by the data stream lifecycle. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeleteDataLifecycleRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture deleteDataLifecycle( - Function> fn) { - return deleteDataLifecycle(fn.apply(new DeleteDataLifecycleRequest.Builder()).build()); - } - - // ----- Endpoint: indices.delete_data_stream - - /** - * Delete data streams. Deletes one or more data streams and their backing - * indices. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture deleteDataStream(DeleteDataStreamRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteDataStreamRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Delete data streams. Deletes one or more data streams and their backing - * indices. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeleteDataStreamRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture deleteDataStream( - Function> fn) { - return deleteDataStream(fn.apply(new DeleteDataStreamRequest.Builder()).build()); - } - - // ----- Endpoint: indices.delete_index_template - - /** - * Delete an index template. The provided <index-template> may contain - * multiple template names separated by a comma. If multiple template names are - * specified then there is no wildcard support and the provided names should - * match completely with existing templates. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture deleteIndexTemplate(DeleteIndexTemplateRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteIndexTemplateRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Delete an index template. The provided <index-template> may contain - * multiple template names separated by a comma. If multiple template names are - * specified then there is no wildcard support and the provided names should - * match completely with existing templates. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeleteIndexTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture deleteIndexTemplate( - Function> fn) { - return deleteIndexTemplate(fn.apply(new DeleteIndexTemplateRequest.Builder()).build()); - } - - // ----- Endpoint: indices.exists - - /** - * Check indices. Checks if one or more indices, index aliases, or data streams - * exist. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture exists(ExistsRequest request) { - @SuppressWarnings("unchecked") - Endpoint endpoint = (Endpoint) ExistsRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Check indices. Checks if one or more indices, index aliases, or data streams - * exist. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExistsRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture exists( - Function> fn) { - return exists(fn.apply(new ExistsRequest.Builder()).build()); - } - - // ----- Endpoint: indices.exists_alias - - /** - * Check aliases. Checks if one or more data stream or index aliases exist. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture existsAlias(ExistsAliasRequest request) { - @SuppressWarnings("unchecked") - Endpoint endpoint = (Endpoint) ExistsAliasRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Check aliases. Checks if one or more data stream or index aliases exist. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExistsAliasRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture existsAlias( - Function> fn) { - return existsAlias(fn.apply(new ExistsAliasRequest.Builder()).build()); - } - - // ----- Endpoint: indices.exists_index_template - - /** - * Returns information about whether a particular index template exists. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture existsIndexTemplate(ExistsIndexTemplateRequest request) { - @SuppressWarnings("unchecked") - Endpoint endpoint = (Endpoint) ExistsIndexTemplateRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Returns information about whether a particular index template exists. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExistsIndexTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture existsIndexTemplate( - Function> fn) { - return existsIndexTemplate(fn.apply(new ExistsIndexTemplateRequest.Builder()).build()); - } - - // ----- Endpoint: indices.explain_data_lifecycle - - /** - * Get the status for a data stream lifecycle. Retrieves information about an - * index or data stream’s current data stream lifecycle status, such as time - * since index creation, time since rollover, the lifecycle configuration - * managing the index, or any errors encountered during lifecycle execution. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture explainDataLifecycle(ExplainDataLifecycleRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ExplainDataLifecycleRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Get the status for a data stream lifecycle. Retrieves information about an - * index or data stream’s current data stream lifecycle status, such as time - * since index creation, time since rollover, the lifecycle configuration - * managing the index, or any errors encountered during lifecycle execution. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExplainDataLifecycleRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture explainDataLifecycle( - Function> fn) { - return explainDataLifecycle(fn.apply(new ExplainDataLifecycleRequest.Builder()).build()); - } - - // ----- Endpoint: indices.get - - /** - * Get index information. Returns information about one or more indices. For - * data streams, the API returns information about the stream’s backing indices. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture get(GetIndexRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetIndexRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Get index information. Returns information about one or more indices. For - * data streams, the API returns information about the stream’s backing indices. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetIndexRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture get( - Function> fn) { - return get(fn.apply(new GetIndexRequest.Builder()).build()); - } - - // ----- Endpoint: indices.get_alias - - /** - * Get aliases. Retrieves information for one or more data stream or index - * aliases. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture getAlias(GetAliasRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetAliasRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Get aliases. Retrieves information for one or more data stream or index - * aliases. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetAliasRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture getAlias( - Function> fn) { - return getAlias(fn.apply(new GetAliasRequest.Builder()).build()); - } - - /** - * Get aliases. Retrieves information for one or more data stream or index - * aliases. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture getAlias() { - return this.transport.performRequestAsync(new GetAliasRequest.Builder().build(), GetAliasRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: indices.get_data_lifecycle - - /** - * Get data stream lifecycles. Retrieves the data stream lifecycle configuration - * of one or more data streams. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture getDataLifecycle(GetDataLifecycleRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetDataLifecycleRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Get data stream lifecycles. Retrieves the data stream lifecycle configuration - * of one or more data streams. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetDataLifecycleRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture getDataLifecycle( - Function> fn) { - return getDataLifecycle(fn.apply(new GetDataLifecycleRequest.Builder()).build()); - } - - // ----- Endpoint: indices.get_data_stream - - /** - * Get data streams. Retrieves information about one or more data streams. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture getDataStream(GetDataStreamRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetDataStreamRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Get data streams. Retrieves information about one or more data streams. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetDataStreamRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture getDataStream( - Function> fn) { - return getDataStream(fn.apply(new GetDataStreamRequest.Builder()).build()); - } - - /** - * Get data streams. Retrieves information about one or more data streams. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture getDataStream() { - return this.transport.performRequestAsync(new GetDataStreamRequest.Builder().build(), - GetDataStreamRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: indices.get_index_template - - /** - * Get index templates. Returns information about one or more index templates. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture getIndexTemplate(GetIndexTemplateRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetIndexTemplateRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Get index templates. Returns information about one or more index templates. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetIndexTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture getIndexTemplate( - Function> fn) { - return getIndexTemplate(fn.apply(new GetIndexTemplateRequest.Builder()).build()); - } - - /** - * Get index templates. Returns information about one or more index templates. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture getIndexTemplate() { - return this.transport.performRequestAsync(new GetIndexTemplateRequest.Builder().build(), - GetIndexTemplateRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: indices.get_mapping - - /** - * Get mapping definitions. Retrieves mapping definitions for one or more - * indices. For data streams, the API retrieves mappings for the stream’s - * backing indices. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture getMapping(GetMappingRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetMappingRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Get mapping definitions. Retrieves mapping definitions for one or more - * indices. For data streams, the API retrieves mappings for the stream’s - * backing indices. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetMappingRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture getMapping( - Function> fn) { - return getMapping(fn.apply(new GetMappingRequest.Builder()).build()); - } - - /** - * Get mapping definitions. Retrieves mapping definitions for one or more - * indices. For data streams, the API retrieves mappings for the stream’s - * backing indices. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture getMapping() { - return this.transport.performRequestAsync(new GetMappingRequest.Builder().build(), GetMappingRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: indices.get_settings - - /** - * Get index settings. Returns setting information for one or more indices. For - * data streams, returns setting information for the stream’s backing indices. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture getSettings(GetIndicesSettingsRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetIndicesSettingsRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Get index settings. Returns setting information for one or more indices. For - * data streams, returns setting information for the stream’s backing indices. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetIndicesSettingsRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture getSettings( - Function> fn) { - return getSettings(fn.apply(new GetIndicesSettingsRequest.Builder()).build()); - } - - /** - * Get index settings. Returns setting information for one or more indices. For - * data streams, returns setting information for the stream’s backing indices. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture getSettings() { - return this.transport.performRequestAsync(new GetIndicesSettingsRequest.Builder().build(), - GetIndicesSettingsRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: indices.migrate_to_data_stream - - /** - * Convert an index alias to a data stream. Converts an index alias to a data - * stream. You must have a matching index template that is data stream enabled. - * The alias must meet the following criteria: The alias must have a write - * index; All indices for the alias must have a @timestamp field - * mapping of a date or date_nanos field type; The - * alias must not have any filters; The alias must not use custom routing. If - * successful, the request removes the alias and creates a data stream with the - * same name. The indices for the alias become hidden backing indices for the - * stream. The write index for the alias becomes the write index for the stream. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture migrateToDataStream(MigrateToDataStreamRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) MigrateToDataStreamRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Convert an index alias to a data stream. Converts an index alias to a data - * stream. You must have a matching index template that is data stream enabled. - * The alias must meet the following criteria: The alias must have a write - * index; All indices for the alias must have a @timestamp field - * mapping of a date or date_nanos field type; The - * alias must not have any filters; The alias must not use custom routing. If - * successful, the request removes the alias and creates a data stream with the - * same name. The indices for the alias become hidden backing indices for the - * stream. The write index for the alias becomes the write index for the stream. - * - * @param fn - * a function that initializes a builder to create the - * {@link MigrateToDataStreamRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture migrateToDataStream( - Function> fn) { - return migrateToDataStream(fn.apply(new MigrateToDataStreamRequest.Builder()).build()); - } - - // ----- Endpoint: indices.modify_data_stream - - /** - * Update data streams. Performs one or more data stream modification actions in - * a single atomic operation. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture modifyDataStream(ModifyDataStreamRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ModifyDataStreamRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Update data streams. Performs one or more data stream modification actions in - * a single atomic operation. - * - * @param fn - * a function that initializes a builder to create the - * {@link ModifyDataStreamRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture modifyDataStream( - Function> fn) { - return modifyDataStream(fn.apply(new ModifyDataStreamRequest.Builder()).build()); - } - - // ----- Endpoint: indices.put_alias - - /** - * Create or update an alias. Adds a data stream or index to an alias. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture putAlias(PutAliasRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutAliasRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Create or update an alias. Adds a data stream or index to an alias. - * - * @param fn - * a function that initializes a builder to create the - * {@link PutAliasRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture putAlias( - Function> fn) { - return putAlias(fn.apply(new PutAliasRequest.Builder()).build()); - } - - // ----- Endpoint: indices.put_data_lifecycle - - /** - * Update data stream lifecycles. Update the data stream lifecycle of the - * specified data streams. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture putDataLifecycle(PutDataLifecycleRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutDataLifecycleRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Update data stream lifecycles. Update the data stream lifecycle of the - * specified data streams. - * - * @param fn - * a function that initializes a builder to create the - * {@link PutDataLifecycleRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture putDataLifecycle( - Function> fn) { - return putDataLifecycle(fn.apply(new PutDataLifecycleRequest.Builder()).build()); - } - - // ----- Endpoint: indices.put_index_template - - /** - * Create or update an index template. Index templates define settings, - * mappings, and aliases that can be applied automatically to new indices. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture putIndexTemplate(PutIndexTemplateRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutIndexTemplateRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Create or update an index template. Index templates define settings, - * mappings, and aliases that can be applied automatically to new indices. - * - * @param fn - * a function that initializes a builder to create the - * {@link PutIndexTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture putIndexTemplate( - Function> fn) { - return putIndexTemplate(fn.apply(new PutIndexTemplateRequest.Builder()).build()); - } - - // ----- Endpoint: indices.put_mapping - - /** - * Update field mappings. Adds new fields to an existing data stream or index. - * You can also use this API to change the search settings of existing fields. - * For data streams, these changes are applied to all backing indices by - * default. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture putMapping(PutMappingRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutMappingRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Update field mappings. Adds new fields to an existing data stream or index. - * You can also use this API to change the search settings of existing fields. - * For data streams, these changes are applied to all backing indices by - * default. - * - * @param fn - * a function that initializes a builder to create the - * {@link PutMappingRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture putMapping( - Function> fn) { - return putMapping(fn.apply(new PutMappingRequest.Builder()).build()); - } - - // ----- Endpoint: indices.put_settings - - /** - * Update index settings. Changes dynamic index settings in real time. For data - * streams, index setting changes are applied to all backing indices by default. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture putSettings(PutIndicesSettingsRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutIndicesSettingsRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Update index settings. Changes dynamic index settings in real time. For data - * streams, index setting changes are applied to all backing indices by default. - * - * @param fn - * a function that initializes a builder to create the - * {@link PutIndicesSettingsRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture putSettings( - Function> fn) { - return putSettings(fn.apply(new PutIndicesSettingsRequest.Builder()).build()); - } - - /** - * Update index settings. Changes dynamic index settings in real time. For data - * streams, index setting changes are applied to all backing indices by default. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture putSettings() { - return this.transport.performRequestAsync(new PutIndicesSettingsRequest.Builder().build(), - PutIndicesSettingsRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: indices.put_template - - /** - * Create or update an index template. Index templates define settings, - * mappings, and aliases that can be applied automatically to new indices. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture putTemplate(PutTemplateRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutTemplateRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Create or update an index template. Index templates define settings, - * mappings, and aliases that can be applied automatically to new indices. - * - * @param fn - * a function that initializes a builder to create the - * {@link PutTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture putTemplate( - Function> fn) { - return putTemplate(fn.apply(new PutTemplateRequest.Builder()).build()); - } - - // ----- Endpoint: indices.refresh - - /** - * Refresh an index. A refresh makes recent operations performed on one or more - * indices available for search. For data streams, the API runs the refresh - * operation on the stream’s backing indices. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture refresh(RefreshRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) RefreshRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Refresh an index. A refresh makes recent operations performed on one or more - * indices available for search. For data streams, the API runs the refresh - * operation on the stream’s backing indices. - * - * @param fn - * a function that initializes a builder to create the - * {@link RefreshRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture refresh( - Function> fn) { - return refresh(fn.apply(new RefreshRequest.Builder()).build()); - } - - /** - * Refresh an index. A refresh makes recent operations performed on one or more - * indices available for search. For data streams, the API runs the refresh - * operation on the stream’s backing indices. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture refresh() { - return this.transport.performRequestAsync(new RefreshRequest.Builder().build(), RefreshRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: indices.resolve_index - - /** - * Resolves the specified name(s) and/or index patterns for indices, aliases, - * and data streams. Multiple patterns and remote clusters are supported. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture resolveIndex(ResolveIndexRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ResolveIndexRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Resolves the specified name(s) and/or index patterns for indices, aliases, - * and data streams. Multiple patterns and remote clusters are supported. - * - * @param fn - * a function that initializes a builder to create the - * {@link ResolveIndexRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture resolveIndex( - Function> fn) { - return resolveIndex(fn.apply(new ResolveIndexRequest.Builder()).build()); - } - - // ----- Endpoint: indices.rollover - - /** - * Roll over to a new index. Creates a new index for a data stream or index - * alias. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture rollover(RolloverRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) RolloverRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Roll over to a new index. Creates a new index for a data stream or index - * alias. - * - * @param fn - * a function that initializes a builder to create the - * {@link RolloverRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture rollover( - Function> fn) { - return rollover(fn.apply(new RolloverRequest.Builder()).build()); - } - - // ----- Endpoint: indices.simulate_index_template - - /** - * Simulate an index. Returns the index configuration that would be applied to - * the specified index from an existing index template. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture simulateIndexTemplate( - SimulateIndexTemplateRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) SimulateIndexTemplateRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Simulate an index. Returns the index configuration that would be applied to - * the specified index from an existing index template. - * - * @param fn - * a function that initializes a builder to create the - * {@link SimulateIndexTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture simulateIndexTemplate( - Function> fn) { - return simulateIndexTemplate(fn.apply(new SimulateIndexTemplateRequest.Builder()).build()); - } - - // ----- Endpoint: indices.simulate_template - - /** - * Simulate an index template. Returns the index configuration that would be - * applied by a particular index template. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture simulateTemplate(SimulateTemplateRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) SimulateTemplateRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Simulate an index template. Returns the index configuration that would be - * applied by a particular index template. - * - * @param fn - * a function that initializes a builder to create the - * {@link SimulateTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture simulateTemplate( - Function> fn) { - return simulateTemplate(fn.apply(new SimulateTemplateRequest.Builder()).build()); - } - - /** - * Simulate an index template. Returns the index configuration that would be - * applied by a particular index template. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture simulateTemplate() { - return this.transport.performRequestAsync(new SimulateTemplateRequest.Builder().build(), - SimulateTemplateRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: indices.update_aliases - - /** - * Create or update an alias. Adds a data stream or index to an alias. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture updateAliases(UpdateAliasesRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) UpdateAliasesRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Create or update an alias. Adds a data stream or index to an alias. - * - * @param fn - * a function that initializes a builder to create the - * {@link UpdateAliasesRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture updateAliases( - Function> fn) { - return updateAliases(fn.apply(new UpdateAliasesRequest.Builder()).build()); - } - - /** - * Create or update an alias. Adds a data stream or index to an alias. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture updateAliases() { - return this.transport.performRequestAsync(new UpdateAliasesRequest.Builder().build(), - UpdateAliasesRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: indices.validate_query - - /** - * Validate a query. Validates a query without running it. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture validateQuery(ValidateQueryRequest request) { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ValidateQueryRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Validate a query. Validates a query without running it. - * - * @param fn - * a function that initializes a builder to create the - * {@link ValidateQueryRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture validateQuery( - Function> fn) { - return validateQuery(fn.apply(new ValidateQueryRequest.Builder()).build()); - } - - /** - * Validate a query. Validates a query without running it. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture validateQuery() { - return this.transport.performRequestAsync(new ValidateQueryRequest.Builder().build(), - ValidateQueryRequest._ENDPOINT, this.transportOptions); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java deleted file mode 100644 index f9c544a6a..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java +++ /dev/null @@ -1,1542 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.ApiClient; -import co.elastic.clients.elasticsearch._types.ElasticsearchException; -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.transport.ElasticsearchTransport; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.JsonEndpoint; -import co.elastic.clients.transport.Transport; -import co.elastic.clients.transport.TransportOptions; -import co.elastic.clients.transport.endpoints.BooleanResponse; -import co.elastic.clients.util.ObjectBuilder; -import java.io.IOException; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Client for the indices namespace. - */ -public class ElasticsearchIndicesClient extends ApiClient { - - public ElasticsearchIndicesClient(ElasticsearchTransport transport) { - super(transport, null); - } - - public ElasticsearchIndicesClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { - super(transport, transportOptions); - } - - @Override - public ElasticsearchIndicesClient withTransportOptions(@Nullable TransportOptions transportOptions) { - return new ElasticsearchIndicesClient(this.transport, transportOptions); - } - - // ----- Endpoint: indices.add_block - - /** - * Add an index block. Limits the operations allowed on an index by blocking - * specific operation types. - * - * @see Documentation - * on elastic.co - */ - - public AddBlockResponse addBlock(AddBlockRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) AddBlockRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Add an index block. Limits the operations allowed on an index by blocking - * specific operation types. - * - * @param fn - * a function that initializes a builder to create the - * {@link AddBlockRequest} - * @see Documentation - * on elastic.co - */ - - public final AddBlockResponse addBlock(Function> fn) - throws IOException, ElasticsearchException { - return addBlock(fn.apply(new AddBlockRequest.Builder()).build()); - } - - // ----- Endpoint: indices.analyze - - /** - * Performs analysis on a text string and returns the resulting tokens. - * - * @see Documentation - * on elastic.co - */ - - public AnalyzeResponse analyze(AnalyzeRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) AnalyzeRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Performs analysis on a text string and returns the resulting tokens. - * - * @param fn - * a function that initializes a builder to create the - * {@link AnalyzeRequest} - * @see Documentation - * on elastic.co - */ - - public final AnalyzeResponse analyze(Function> fn) - throws IOException, ElasticsearchException { - return analyze(fn.apply(new AnalyzeRequest.Builder()).build()); - } - - /** - * Performs analysis on a text string and returns the resulting tokens. - * - * @see Documentation - * on elastic.co - */ - - public AnalyzeResponse analyze() throws IOException, ElasticsearchException { - return this.transport.performRequest(new AnalyzeRequest.Builder().build(), AnalyzeRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: indices.create - - /** - * Create an index. Creates a new index. - * - * @see Documentation - * on elastic.co - */ - - public CreateIndexResponse create(CreateIndexRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) CreateIndexRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Create an index. Creates a new index. - * - * @param fn - * a function that initializes a builder to create the - * {@link CreateIndexRequest} - * @see Documentation - * on elastic.co - */ - - public final CreateIndexResponse create(Function> fn) - throws IOException, ElasticsearchException { - return create(fn.apply(new CreateIndexRequest.Builder()).build()); - } - - // ----- Endpoint: indices.create_data_stream - - /** - * Create a data stream. Creates a data stream. You must have a matching index - * template with data stream enabled. - * - * @see Documentation - * on elastic.co - */ - - public CreateDataStreamResponse createDataStream(CreateDataStreamRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) CreateDataStreamRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Create a data stream. Creates a data stream. You must have a matching index - * template with data stream enabled. - * - * @param fn - * a function that initializes a builder to create the - * {@link CreateDataStreamRequest} - * @see Documentation - * on elastic.co - */ - - public final CreateDataStreamResponse createDataStream( - Function> fn) - throws IOException, ElasticsearchException { - return createDataStream(fn.apply(new CreateDataStreamRequest.Builder()).build()); - } - - // ----- Endpoint: indices.data_streams_stats - - /** - * Get data stream stats. Retrieves statistics for one or more data streams. - * - * @see Documentation - * on elastic.co - */ - - public DataStreamsStatsResponse dataStreamsStats(DataStreamsStatsRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DataStreamsStatsRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Get data stream stats. Retrieves statistics for one or more data streams. - * - * @param fn - * a function that initializes a builder to create the - * {@link DataStreamsStatsRequest} - * @see Documentation - * on elastic.co - */ - - public final DataStreamsStatsResponse dataStreamsStats( - Function> fn) - throws IOException, ElasticsearchException { - return dataStreamsStats(fn.apply(new DataStreamsStatsRequest.Builder()).build()); - } - - /** - * Get data stream stats. Retrieves statistics for one or more data streams. - * - * @see Documentation - * on elastic.co - */ - - public DataStreamsStatsResponse dataStreamsStats() throws IOException, ElasticsearchException { - return this.transport.performRequest(new DataStreamsStatsRequest.Builder().build(), - DataStreamsStatsRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: indices.delete - - /** - * Delete indices. Deletes one or more indices. - * - * @see Documentation - * on elastic.co - */ - - public DeleteIndexResponse delete(DeleteIndexRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteIndexRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Delete indices. Deletes one or more indices. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeleteIndexRequest} - * @see Documentation - * on elastic.co - */ - - public final DeleteIndexResponse delete(Function> fn) - throws IOException, ElasticsearchException { - return delete(fn.apply(new DeleteIndexRequest.Builder()).build()); - } - - // ----- Endpoint: indices.delete_alias - - /** - * Delete an alias. Removes a data stream or index from an alias. - * - * @see Documentation - * on elastic.co - */ - - public DeleteAliasResponse deleteAlias(DeleteAliasRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteAliasRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Delete an alias. Removes a data stream or index from an alias. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeleteAliasRequest} - * @see Documentation - * on elastic.co - */ - - public final DeleteAliasResponse deleteAlias( - Function> fn) - throws IOException, ElasticsearchException { - return deleteAlias(fn.apply(new DeleteAliasRequest.Builder()).build()); - } - - // ----- Endpoint: indices.delete_data_lifecycle - - /** - * Delete data stream lifecycles. Removes the data stream lifecycle from a data - * stream, rendering it not managed by the data stream lifecycle. - * - * @see Documentation - * on elastic.co - */ - - public DeleteDataLifecycleResponse deleteDataLifecycle(DeleteDataLifecycleRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteDataLifecycleRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Delete data stream lifecycles. Removes the data stream lifecycle from a data - * stream, rendering it not managed by the data stream lifecycle. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeleteDataLifecycleRequest} - * @see Documentation - * on elastic.co - */ - - public final DeleteDataLifecycleResponse deleteDataLifecycle( - Function> fn) - throws IOException, ElasticsearchException { - return deleteDataLifecycle(fn.apply(new DeleteDataLifecycleRequest.Builder()).build()); - } - - // ----- Endpoint: indices.delete_data_stream - - /** - * Delete data streams. Deletes one or more data streams and their backing - * indices. - * - * @see Documentation - * on elastic.co - */ - - public DeleteDataStreamResponse deleteDataStream(DeleteDataStreamRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteDataStreamRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Delete data streams. Deletes one or more data streams and their backing - * indices. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeleteDataStreamRequest} - * @see Documentation - * on elastic.co - */ - - public final DeleteDataStreamResponse deleteDataStream( - Function> fn) - throws IOException, ElasticsearchException { - return deleteDataStream(fn.apply(new DeleteDataStreamRequest.Builder()).build()); - } - - // ----- Endpoint: indices.delete_index_template - - /** - * Delete an index template. The provided <index-template> may contain - * multiple template names separated by a comma. If multiple template names are - * specified then there is no wildcard support and the provided names should - * match completely with existing templates. - * - * @see Documentation - * on elastic.co - */ - - public DeleteIndexTemplateResponse deleteIndexTemplate(DeleteIndexTemplateRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteIndexTemplateRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Delete an index template. The provided <index-template> may contain - * multiple template names separated by a comma. If multiple template names are - * specified then there is no wildcard support and the provided names should - * match completely with existing templates. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeleteIndexTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final DeleteIndexTemplateResponse deleteIndexTemplate( - Function> fn) - throws IOException, ElasticsearchException { - return deleteIndexTemplate(fn.apply(new DeleteIndexTemplateRequest.Builder()).build()); - } - - // ----- Endpoint: indices.exists - - /** - * Check indices. Checks if one or more indices, index aliases, or data streams - * exist. - * - * @see Documentation - * on elastic.co - */ - - public BooleanResponse exists(ExistsRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - Endpoint endpoint = (Endpoint) ExistsRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Check indices. Checks if one or more indices, index aliases, or data streams - * exist. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExistsRequest} - * @see Documentation - * on elastic.co - */ - - public final BooleanResponse exists(Function> fn) - throws IOException, ElasticsearchException { - return exists(fn.apply(new ExistsRequest.Builder()).build()); - } - - // ----- Endpoint: indices.exists_alias - - /** - * Check aliases. Checks if one or more data stream or index aliases exist. - * - * @see Documentation - * on elastic.co - */ - - public BooleanResponse existsAlias(ExistsAliasRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - Endpoint endpoint = (Endpoint) ExistsAliasRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Check aliases. Checks if one or more data stream or index aliases exist. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExistsAliasRequest} - * @see Documentation - * on elastic.co - */ - - public final BooleanResponse existsAlias(Function> fn) - throws IOException, ElasticsearchException { - return existsAlias(fn.apply(new ExistsAliasRequest.Builder()).build()); - } - - // ----- Endpoint: indices.exists_index_template - - /** - * Returns information about whether a particular index template exists. - * - * @see Documentation - * on elastic.co - */ - - public BooleanResponse existsIndexTemplate(ExistsIndexTemplateRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - Endpoint endpoint = (Endpoint) ExistsIndexTemplateRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Returns information about whether a particular index template exists. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExistsIndexTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final BooleanResponse existsIndexTemplate( - Function> fn) - throws IOException, ElasticsearchException { - return existsIndexTemplate(fn.apply(new ExistsIndexTemplateRequest.Builder()).build()); - } - - // ----- Endpoint: indices.explain_data_lifecycle - - /** - * Get the status for a data stream lifecycle. Retrieves information about an - * index or data stream’s current data stream lifecycle status, such as time - * since index creation, time since rollover, the lifecycle configuration - * managing the index, or any errors encountered during lifecycle execution. - * - * @see Documentation - * on elastic.co - */ - - public ExplainDataLifecycleResponse explainDataLifecycle(ExplainDataLifecycleRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ExplainDataLifecycleRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Get the status for a data stream lifecycle. Retrieves information about an - * index or data stream’s current data stream lifecycle status, such as time - * since index creation, time since rollover, the lifecycle configuration - * managing the index, or any errors encountered during lifecycle execution. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExplainDataLifecycleRequest} - * @see Documentation - * on elastic.co - */ - - public final ExplainDataLifecycleResponse explainDataLifecycle( - Function> fn) - throws IOException, ElasticsearchException { - return explainDataLifecycle(fn.apply(new ExplainDataLifecycleRequest.Builder()).build()); - } - - // ----- Endpoint: indices.get - - /** - * Get index information. Returns information about one or more indices. For - * data streams, the API returns information about the stream’s backing indices. - * - * @see Documentation - * on elastic.co - */ - - public GetIndexResponse get(GetIndexRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetIndexRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Get index information. Returns information about one or more indices. For - * data streams, the API returns information about the stream’s backing indices. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetIndexRequest} - * @see Documentation - * on elastic.co - */ - - public final GetIndexResponse get(Function> fn) - throws IOException, ElasticsearchException { - return get(fn.apply(new GetIndexRequest.Builder()).build()); - } - - // ----- Endpoint: indices.get_alias - - /** - * Get aliases. Retrieves information for one or more data stream or index - * aliases. - * - * @see Documentation - * on elastic.co - */ - - public GetAliasResponse getAlias(GetAliasRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetAliasRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Get aliases. Retrieves information for one or more data stream or index - * aliases. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetAliasRequest} - * @see Documentation - * on elastic.co - */ - - public final GetAliasResponse getAlias(Function> fn) - throws IOException, ElasticsearchException { - return getAlias(fn.apply(new GetAliasRequest.Builder()).build()); - } - - /** - * Get aliases. Retrieves information for one or more data stream or index - * aliases. - * - * @see Documentation - * on elastic.co - */ - - public GetAliasResponse getAlias() throws IOException, ElasticsearchException { - return this.transport.performRequest(new GetAliasRequest.Builder().build(), GetAliasRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: indices.get_data_lifecycle - - /** - * Get data stream lifecycles. Retrieves the data stream lifecycle configuration - * of one or more data streams. - * - * @see Documentation - * on elastic.co - */ - - public GetDataLifecycleResponse getDataLifecycle(GetDataLifecycleRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetDataLifecycleRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Get data stream lifecycles. Retrieves the data stream lifecycle configuration - * of one or more data streams. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetDataLifecycleRequest} - * @see Documentation - * on elastic.co - */ - - public final GetDataLifecycleResponse getDataLifecycle( - Function> fn) - throws IOException, ElasticsearchException { - return getDataLifecycle(fn.apply(new GetDataLifecycleRequest.Builder()).build()); - } - - // ----- Endpoint: indices.get_data_stream - - /** - * Get data streams. Retrieves information about one or more data streams. - * - * @see Documentation - * on elastic.co - */ - - public GetDataStreamResponse getDataStream(GetDataStreamRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetDataStreamRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Get data streams. Retrieves information about one or more data streams. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetDataStreamRequest} - * @see Documentation - * on elastic.co - */ - - public final GetDataStreamResponse getDataStream( - Function> fn) - throws IOException, ElasticsearchException { - return getDataStream(fn.apply(new GetDataStreamRequest.Builder()).build()); - } - - /** - * Get data streams. Retrieves information about one or more data streams. - * - * @see Documentation - * on elastic.co - */ - - public GetDataStreamResponse getDataStream() throws IOException, ElasticsearchException { - return this.transport.performRequest(new GetDataStreamRequest.Builder().build(), GetDataStreamRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: indices.get_index_template - - /** - * Get index templates. Returns information about one or more index templates. - * - * @see Documentation - * on elastic.co - */ - - public GetIndexTemplateResponse getIndexTemplate(GetIndexTemplateRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetIndexTemplateRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Get index templates. Returns information about one or more index templates. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetIndexTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final GetIndexTemplateResponse getIndexTemplate( - Function> fn) - throws IOException, ElasticsearchException { - return getIndexTemplate(fn.apply(new GetIndexTemplateRequest.Builder()).build()); - } - - /** - * Get index templates. Returns information about one or more index templates. - * - * @see Documentation - * on elastic.co - */ - - public GetIndexTemplateResponse getIndexTemplate() throws IOException, ElasticsearchException { - return this.transport.performRequest(new GetIndexTemplateRequest.Builder().build(), - GetIndexTemplateRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: indices.get_mapping - - /** - * Get mapping definitions. Retrieves mapping definitions for one or more - * indices. For data streams, the API retrieves mappings for the stream’s - * backing indices. - * - * @see Documentation - * on elastic.co - */ - - public GetMappingResponse getMapping(GetMappingRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetMappingRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Get mapping definitions. Retrieves mapping definitions for one or more - * indices. For data streams, the API retrieves mappings for the stream’s - * backing indices. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetMappingRequest} - * @see Documentation - * on elastic.co - */ - - public final GetMappingResponse getMapping(Function> fn) - throws IOException, ElasticsearchException { - return getMapping(fn.apply(new GetMappingRequest.Builder()).build()); - } - - /** - * Get mapping definitions. Retrieves mapping definitions for one or more - * indices. For data streams, the API retrieves mappings for the stream’s - * backing indices. - * - * @see Documentation - * on elastic.co - */ - - public GetMappingResponse getMapping() throws IOException, ElasticsearchException { - return this.transport.performRequest(new GetMappingRequest.Builder().build(), GetMappingRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: indices.get_settings - - /** - * Get index settings. Returns setting information for one or more indices. For - * data streams, returns setting information for the stream’s backing indices. - * - * @see Documentation - * on elastic.co - */ - - public GetIndicesSettingsResponse getSettings(GetIndicesSettingsRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetIndicesSettingsRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Get index settings. Returns setting information for one or more indices. For - * data streams, returns setting information for the stream’s backing indices. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetIndicesSettingsRequest} - * @see Documentation - * on elastic.co - */ - - public final GetIndicesSettingsResponse getSettings( - Function> fn) - throws IOException, ElasticsearchException { - return getSettings(fn.apply(new GetIndicesSettingsRequest.Builder()).build()); - } - - /** - * Get index settings. Returns setting information for one or more indices. For - * data streams, returns setting information for the stream’s backing indices. - * - * @see Documentation - * on elastic.co - */ - - public GetIndicesSettingsResponse getSettings() throws IOException, ElasticsearchException { - return this.transport.performRequest(new GetIndicesSettingsRequest.Builder().build(), - GetIndicesSettingsRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: indices.migrate_to_data_stream - - /** - * Convert an index alias to a data stream. Converts an index alias to a data - * stream. You must have a matching index template that is data stream enabled. - * The alias must meet the following criteria: The alias must have a write - * index; All indices for the alias must have a @timestamp field - * mapping of a date or date_nanos field type; The - * alias must not have any filters; The alias must not use custom routing. If - * successful, the request removes the alias and creates a data stream with the - * same name. The indices for the alias become hidden backing indices for the - * stream. The write index for the alias becomes the write index for the stream. - * - * @see Documentation - * on elastic.co - */ - - public MigrateToDataStreamResponse migrateToDataStream(MigrateToDataStreamRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) MigrateToDataStreamRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Convert an index alias to a data stream. Converts an index alias to a data - * stream. You must have a matching index template that is data stream enabled. - * The alias must meet the following criteria: The alias must have a write - * index; All indices for the alias must have a @timestamp field - * mapping of a date or date_nanos field type; The - * alias must not have any filters; The alias must not use custom routing. If - * successful, the request removes the alias and creates a data stream with the - * same name. The indices for the alias become hidden backing indices for the - * stream. The write index for the alias becomes the write index for the stream. - * - * @param fn - * a function that initializes a builder to create the - * {@link MigrateToDataStreamRequest} - * @see Documentation - * on elastic.co - */ - - public final MigrateToDataStreamResponse migrateToDataStream( - Function> fn) - throws IOException, ElasticsearchException { - return migrateToDataStream(fn.apply(new MigrateToDataStreamRequest.Builder()).build()); - } - - // ----- Endpoint: indices.modify_data_stream - - /** - * Update data streams. Performs one or more data stream modification actions in - * a single atomic operation. - * - * @see Documentation - * on elastic.co - */ - - public ModifyDataStreamResponse modifyDataStream(ModifyDataStreamRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ModifyDataStreamRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Update data streams. Performs one or more data stream modification actions in - * a single atomic operation. - * - * @param fn - * a function that initializes a builder to create the - * {@link ModifyDataStreamRequest} - * @see Documentation - * on elastic.co - */ - - public final ModifyDataStreamResponse modifyDataStream( - Function> fn) - throws IOException, ElasticsearchException { - return modifyDataStream(fn.apply(new ModifyDataStreamRequest.Builder()).build()); - } - - // ----- Endpoint: indices.put_alias - - /** - * Create or update an alias. Adds a data stream or index to an alias. - * - * @see Documentation - * on elastic.co - */ - - public PutAliasResponse putAlias(PutAliasRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutAliasRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Create or update an alias. Adds a data stream or index to an alias. - * - * @param fn - * a function that initializes a builder to create the - * {@link PutAliasRequest} - * @see Documentation - * on elastic.co - */ - - public final PutAliasResponse putAlias(Function> fn) - throws IOException, ElasticsearchException { - return putAlias(fn.apply(new PutAliasRequest.Builder()).build()); - } - - // ----- Endpoint: indices.put_data_lifecycle - - /** - * Update data stream lifecycles. Update the data stream lifecycle of the - * specified data streams. - * - * @see Documentation - * on elastic.co - */ - - public PutDataLifecycleResponse putDataLifecycle(PutDataLifecycleRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutDataLifecycleRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Update data stream lifecycles. Update the data stream lifecycle of the - * specified data streams. - * - * @param fn - * a function that initializes a builder to create the - * {@link PutDataLifecycleRequest} - * @see Documentation - * on elastic.co - */ - - public final PutDataLifecycleResponse putDataLifecycle( - Function> fn) - throws IOException, ElasticsearchException { - return putDataLifecycle(fn.apply(new PutDataLifecycleRequest.Builder()).build()); - } - - // ----- Endpoint: indices.put_index_template - - /** - * Create or update an index template. Index templates define settings, - * mappings, and aliases that can be applied automatically to new indices. - * - * @see Documentation - * on elastic.co - */ - - public PutIndexTemplateResponse putIndexTemplate(PutIndexTemplateRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutIndexTemplateRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Create or update an index template. Index templates define settings, - * mappings, and aliases that can be applied automatically to new indices. - * - * @param fn - * a function that initializes a builder to create the - * {@link PutIndexTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final PutIndexTemplateResponse putIndexTemplate( - Function> fn) - throws IOException, ElasticsearchException { - return putIndexTemplate(fn.apply(new PutIndexTemplateRequest.Builder()).build()); - } - - // ----- Endpoint: indices.put_mapping - - /** - * Update field mappings. Adds new fields to an existing data stream or index. - * You can also use this API to change the search settings of existing fields. - * For data streams, these changes are applied to all backing indices by - * default. - * - * @see Documentation - * on elastic.co - */ - - public PutMappingResponse putMapping(PutMappingRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutMappingRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Update field mappings. Adds new fields to an existing data stream or index. - * You can also use this API to change the search settings of existing fields. - * For data streams, these changes are applied to all backing indices by - * default. - * - * @param fn - * a function that initializes a builder to create the - * {@link PutMappingRequest} - * @see Documentation - * on elastic.co - */ - - public final PutMappingResponse putMapping(Function> fn) - throws IOException, ElasticsearchException { - return putMapping(fn.apply(new PutMappingRequest.Builder()).build()); - } - - // ----- Endpoint: indices.put_settings - - /** - * Update index settings. Changes dynamic index settings in real time. For data - * streams, index setting changes are applied to all backing indices by default. - * - * @see Documentation - * on elastic.co - */ - - public PutIndicesSettingsResponse putSettings(PutIndicesSettingsRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutIndicesSettingsRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Update index settings. Changes dynamic index settings in real time. For data - * streams, index setting changes are applied to all backing indices by default. - * - * @param fn - * a function that initializes a builder to create the - * {@link PutIndicesSettingsRequest} - * @see Documentation - * on elastic.co - */ - - public final PutIndicesSettingsResponse putSettings( - Function> fn) - throws IOException, ElasticsearchException { - return putSettings(fn.apply(new PutIndicesSettingsRequest.Builder()).build()); - } - - /** - * Update index settings. Changes dynamic index settings in real time. For data - * streams, index setting changes are applied to all backing indices by default. - * - * @see Documentation - * on elastic.co - */ - - public PutIndicesSettingsResponse putSettings() throws IOException, ElasticsearchException { - return this.transport.performRequest(new PutIndicesSettingsRequest.Builder().build(), - PutIndicesSettingsRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: indices.put_template - - /** - * Create or update an index template. Index templates define settings, - * mappings, and aliases that can be applied automatically to new indices. - * - * @see Documentation - * on elastic.co - */ - - public PutTemplateResponse putTemplate(PutTemplateRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutTemplateRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Create or update an index template. Index templates define settings, - * mappings, and aliases that can be applied automatically to new indices. - * - * @param fn - * a function that initializes a builder to create the - * {@link PutTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final PutTemplateResponse putTemplate( - Function> fn) - throws IOException, ElasticsearchException { - return putTemplate(fn.apply(new PutTemplateRequest.Builder()).build()); - } - - // ----- Endpoint: indices.refresh - - /** - * Refresh an index. A refresh makes recent operations performed on one or more - * indices available for search. For data streams, the API runs the refresh - * operation on the stream’s backing indices. - * - * @see Documentation - * on elastic.co - */ - - public RefreshResponse refresh(RefreshRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) RefreshRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Refresh an index. A refresh makes recent operations performed on one or more - * indices available for search. For data streams, the API runs the refresh - * operation on the stream’s backing indices. - * - * @param fn - * a function that initializes a builder to create the - * {@link RefreshRequest} - * @see Documentation - * on elastic.co - */ - - public final RefreshResponse refresh(Function> fn) - throws IOException, ElasticsearchException { - return refresh(fn.apply(new RefreshRequest.Builder()).build()); - } - - /** - * Refresh an index. A refresh makes recent operations performed on one or more - * indices available for search. For data streams, the API runs the refresh - * operation on the stream’s backing indices. - * - * @see Documentation - * on elastic.co - */ - - public RefreshResponse refresh() throws IOException, ElasticsearchException { - return this.transport.performRequest(new RefreshRequest.Builder().build(), RefreshRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: indices.resolve_index - - /** - * Resolves the specified name(s) and/or index patterns for indices, aliases, - * and data streams. Multiple patterns and remote clusters are supported. - * - * @see Documentation - * on elastic.co - */ - - public ResolveIndexResponse resolveIndex(ResolveIndexRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ResolveIndexRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Resolves the specified name(s) and/or index patterns for indices, aliases, - * and data streams. Multiple patterns and remote clusters are supported. - * - * @param fn - * a function that initializes a builder to create the - * {@link ResolveIndexRequest} - * @see Documentation - * on elastic.co - */ - - public final ResolveIndexResponse resolveIndex( - Function> fn) - throws IOException, ElasticsearchException { - return resolveIndex(fn.apply(new ResolveIndexRequest.Builder()).build()); - } - - // ----- Endpoint: indices.rollover - - /** - * Roll over to a new index. Creates a new index for a data stream or index - * alias. - * - * @see Documentation - * on elastic.co - */ - - public RolloverResponse rollover(RolloverRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) RolloverRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Roll over to a new index. Creates a new index for a data stream or index - * alias. - * - * @param fn - * a function that initializes a builder to create the - * {@link RolloverRequest} - * @see Documentation - * on elastic.co - */ - - public final RolloverResponse rollover(Function> fn) - throws IOException, ElasticsearchException { - return rollover(fn.apply(new RolloverRequest.Builder()).build()); - } - - // ----- Endpoint: indices.simulate_index_template - - /** - * Simulate an index. Returns the index configuration that would be applied to - * the specified index from an existing index template. - * - * @see Documentation - * on elastic.co - */ - - public SimulateIndexTemplateResponse simulateIndexTemplate(SimulateIndexTemplateRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) SimulateIndexTemplateRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Simulate an index. Returns the index configuration that would be applied to - * the specified index from an existing index template. - * - * @param fn - * a function that initializes a builder to create the - * {@link SimulateIndexTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final SimulateIndexTemplateResponse simulateIndexTemplate( - Function> fn) - throws IOException, ElasticsearchException { - return simulateIndexTemplate(fn.apply(new SimulateIndexTemplateRequest.Builder()).build()); - } - - // ----- Endpoint: indices.simulate_template - - /** - * Simulate an index template. Returns the index configuration that would be - * applied by a particular index template. - * - * @see Documentation - * on elastic.co - */ - - public SimulateTemplateResponse simulateTemplate(SimulateTemplateRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) SimulateTemplateRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Simulate an index template. Returns the index configuration that would be - * applied by a particular index template. - * - * @param fn - * a function that initializes a builder to create the - * {@link SimulateTemplateRequest} - * @see Documentation - * on elastic.co - */ - - public final SimulateTemplateResponse simulateTemplate( - Function> fn) - throws IOException, ElasticsearchException { - return simulateTemplate(fn.apply(new SimulateTemplateRequest.Builder()).build()); - } - - /** - * Simulate an index template. Returns the index configuration that would be - * applied by a particular index template. - * - * @see Documentation - * on elastic.co - */ - - public SimulateTemplateResponse simulateTemplate() throws IOException, ElasticsearchException { - return this.transport.performRequest(new SimulateTemplateRequest.Builder().build(), - SimulateTemplateRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: indices.update_aliases - - /** - * Create or update an alias. Adds a data stream or index to an alias. - * - * @see Documentation - * on elastic.co - */ - - public UpdateAliasesResponse updateAliases(UpdateAliasesRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) UpdateAliasesRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Create or update an alias. Adds a data stream or index to an alias. - * - * @param fn - * a function that initializes a builder to create the - * {@link UpdateAliasesRequest} - * @see Documentation - * on elastic.co - */ - - public final UpdateAliasesResponse updateAliases( - Function> fn) - throws IOException, ElasticsearchException { - return updateAliases(fn.apply(new UpdateAliasesRequest.Builder()).build()); - } - - /** - * Create or update an alias. Adds a data stream or index to an alias. - * - * @see Documentation - * on elastic.co - */ - - public UpdateAliasesResponse updateAliases() throws IOException, ElasticsearchException { - return this.transport.performRequest(new UpdateAliasesRequest.Builder().build(), UpdateAliasesRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: indices.validate_query - - /** - * Validate a query. Validates a query without running it. - * - * @see Documentation - * on elastic.co - */ - - public ValidateQueryResponse validateQuery(ValidateQueryRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ValidateQueryRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Validate a query. Validates a query without running it. - * - * @param fn - * a function that initializes a builder to create the - * {@link ValidateQueryRequest} - * @see Documentation - * on elastic.co - */ - - public final ValidateQueryResponse validateQuery( - Function> fn) - throws IOException, ElasticsearchException { - return validateQuery(fn.apply(new ValidateQueryRequest.Builder()).build()); - } - - /** - * Validate a query. Validates a query without running it. - * - * @see Documentation - * on elastic.co - */ - - public ValidateQueryResponse validateQuery() throws IOException, ElasticsearchException { - return this.transport.performRequest(new ValidateQueryRequest.Builder().build(), ValidateQueryRequest._ENDPOINT, - this.transportOptions); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsAliasRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsAliasRequest.java deleted file mode 100644 index b86cd677b..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsAliasRequest.java +++ /dev/null @@ -1,426 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.BooleanEndpoint; -import co.elastic.clients.transport.endpoints.BooleanResponse; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.exists_alias.Request - -/** - * Check aliases. Checks if one or more data stream or index aliases exist. - * - * @see API - * specification - */ - -public class ExistsAliasRequest extends RequestBase { - @Nullable - private final Boolean allowNoIndices; - - private final List expandWildcards; - - @Nullable - private final Boolean ignoreUnavailable; - - private final List index; - - @Nullable - private final Boolean local; - - private final List name; - - // --------------------------------------------------------------------------------------------- - - private ExistsAliasRequest(Builder builder) { - - this.allowNoIndices = builder.allowNoIndices; - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.ignoreUnavailable = builder.ignoreUnavailable; - this.index = ApiTypeHelper.unmodifiable(builder.index); - this.local = builder.local; - this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); - - } - - public static ExistsAliasRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. - *

- * API name: {@code allow_no_indices} - */ - @Nullable - public final Boolean allowNoIndices() { - return this.allowNoIndices; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * If false, requests that include a missing data stream or index - * in the target indices or data streams return an error. - *

- * API name: {@code ignore_unavailable} - */ - @Nullable - public final Boolean ignoreUnavailable() { - return this.ignoreUnavailable; - } - - /** - * Comma-separated list of data streams or indices used to limit the request. - * Supports wildcards (*). To target all data streams and indices, - * omit this parameter or use * or _all. - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - /** - * If true, the request retrieves information from the local node - * only. - *

- * API name: {@code local} - */ - @Nullable - public final Boolean local() { - return this.local; - } - - /** - * Required - Comma-separated list of aliases to check. Supports wildcards - * (*). - *

- * API name: {@code name} - */ - public final List name() { - return this.name; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ExistsAliasRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Boolean allowNoIndices; - - @Nullable - private List expandWildcards; - - @Nullable - private Boolean ignoreUnavailable; - - @Nullable - private List index; - - @Nullable - private Boolean local; - - private List name; - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. - *

- * API name: {@code allow_no_indices} - */ - public final Builder allowNoIndices(@Nullable Boolean value) { - this.allowNoIndices = value; - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * If false, requests that include a missing data stream or index - * in the target indices or data streams return an error. - *

- * API name: {@code ignore_unavailable} - */ - public final Builder ignoreUnavailable(@Nullable Boolean value) { - this.ignoreUnavailable = value; - return this; - } - - /** - * Comma-separated list of data streams or indices used to limit the request. - * Supports wildcards (*). To target all data streams and indices, - * omit this parameter or use * or _all. - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * Comma-separated list of data streams or indices used to limit the request. - * Supports wildcards (*). To target all data streams and indices, - * omit this parameter or use * or _all. - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - /** - * If true, the request retrieves information from the local node - * only. - *

- * API name: {@code local} - */ - public final Builder local(@Nullable Boolean value) { - this.local = value; - return this; - } - - /** - * Required - Comma-separated list of aliases to check. Supports wildcards - * (*). - *

- * API name: {@code name} - *

- * Adds all elements of list to name. - */ - public final Builder name(List list) { - this.name = _listAddAll(this.name, list); - return this; - } - - /** - * Required - Comma-separated list of aliases to check. Supports wildcards - * (*). - *

- * API name: {@code name} - *

- * Adds one or more values to name. - */ - public final Builder name(String value, String... values) { - this.name = _listAdd(this.name, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ExistsAliasRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ExistsAliasRequest build() { - _checkSingleUse(); - - return new ExistsAliasRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.exists_alias}". - */ - public static final Endpoint _ENDPOINT = new BooleanEndpoint<>( - "es/indices.exists_alias", - - // Request method - request -> { - return "HEAD"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - final int _index = 1 << 1; - - int propsSet = 0; - - propsSet |= _name; - if (ApiTypeHelper.isDefined(request.index())) - propsSet |= _index; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_alias"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - if (propsSet == (_index | _name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_alias"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - final int _index = 1 << 1; - - int propsSet = 0; - - propsSet |= _name; - if (ApiTypeHelper.isDefined(request.index())) - propsSet |= _index; - - if (propsSet == (_name)) { - params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); - } - if (propsSet == (_index | _name)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, null); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsIndexTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsIndexTemplateRequest.java deleted file mode 100644 index f204a6986..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsIndexTemplateRequest.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.BooleanEndpoint; -import co.elastic.clients.transport.endpoints.BooleanResponse; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.exists_index_template.Request - -/** - * Returns information about whether a particular index template exists. - * - * @see API - * specification - */ - -public class ExistsIndexTemplateRequest extends RequestBase { - @Nullable - private final Time masterTimeout; - - private final String name; - - // --------------------------------------------------------------------------------------------- - - private ExistsIndexTemplateRequest(Builder builder) { - - this.masterTimeout = builder.masterTimeout; - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - - } - - public static ExistsIndexTemplateRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Required - Comma-separated list of index template names used to limit the - * request. Wildcard (*) expressions are supported. - *

- * API name: {@code name} - */ - public final String name() { - return this.name; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ExistsIndexTemplateRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Time masterTimeout; - - private String name; - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - Comma-separated list of index template names used to limit the - * request. Wildcard (*) expressions are supported. - *

- * API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ExistsIndexTemplateRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ExistsIndexTemplateRequest build() { - _checkSingleUse(); - - return new ExistsIndexTemplateRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.exists_index_template}". - */ - public static final Endpoint _ENDPOINT = new BooleanEndpoint<>( - "es/indices.exists_index_template", - - // Request method - request -> { - return "HEAD"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_index_template"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - params.put("name", request.name); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, null); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsRequest.java deleted file mode 100644 index 1e11e63ea..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsRequest.java +++ /dev/null @@ -1,420 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.BooleanEndpoint; -import co.elastic.clients.transport.endpoints.BooleanResponse; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.exists.Request - -/** - * Check indices. Checks if one or more indices, index aliases, or data streams - * exist. - * - * @see API - * specification - */ - -public class ExistsRequest extends RequestBase { - @Nullable - private final Boolean allowNoIndices; - - private final List expandWildcards; - - @Nullable - private final Boolean flatSettings; - - @Nullable - private final Boolean ignoreUnavailable; - - @Nullable - private final Boolean includeDefaults; - - private final List index; - - @Nullable - private final Boolean local; - - // --------------------------------------------------------------------------------------------- - - private ExistsRequest(Builder builder) { - - this.allowNoIndices = builder.allowNoIndices; - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.flatSettings = builder.flatSettings; - this.ignoreUnavailable = builder.ignoreUnavailable; - this.includeDefaults = builder.includeDefaults; - this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); - this.local = builder.local; - - } - - public static ExistsRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. - *

- * API name: {@code allow_no_indices} - */ - @Nullable - public final Boolean allowNoIndices() { - return this.allowNoIndices; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * If true, returns settings in flat format. - *

- * API name: {@code flat_settings} - */ - @Nullable - public final Boolean flatSettings() { - return this.flatSettings; - } - - /** - * If false, the request returns an error if it targets a missing - * or closed index. - *

- * API name: {@code ignore_unavailable} - */ - @Nullable - public final Boolean ignoreUnavailable() { - return this.ignoreUnavailable; - } - - /** - * If true, return all default settings in the response. - *

- * API name: {@code include_defaults} - */ - @Nullable - public final Boolean includeDefaults() { - return this.includeDefaults; - } - - /** - * Required - Comma-separated list of data streams, indices, and aliases. - * Supports wildcards (*). - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - /** - * If true, the request retrieves information from the local node - * only. - *

- * API name: {@code local} - */ - @Nullable - public final Boolean local() { - return this.local; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ExistsRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { - @Nullable - private Boolean allowNoIndices; - - @Nullable - private List expandWildcards; - - @Nullable - private Boolean flatSettings; - - @Nullable - private Boolean ignoreUnavailable; - - @Nullable - private Boolean includeDefaults; - - private List index; - - @Nullable - private Boolean local; - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. - *

- * API name: {@code allow_no_indices} - */ - public final Builder allowNoIndices(@Nullable Boolean value) { - this.allowNoIndices = value; - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * If true, returns settings in flat format. - *

- * API name: {@code flat_settings} - */ - public final Builder flatSettings(@Nullable Boolean value) { - this.flatSettings = value; - return this; - } - - /** - * If false, the request returns an error if it targets a missing - * or closed index. - *

- * API name: {@code ignore_unavailable} - */ - public final Builder ignoreUnavailable(@Nullable Boolean value) { - this.ignoreUnavailable = value; - return this; - } - - /** - * If true, return all default settings in the response. - *

- * API name: {@code include_defaults} - */ - public final Builder includeDefaults(@Nullable Boolean value) { - this.includeDefaults = value; - return this; - } - - /** - * Required - Comma-separated list of data streams, indices, and aliases. - * Supports wildcards (*). - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * Required - Comma-separated list of data streams, indices, and aliases. - * Supports wildcards (*). - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - /** - * If true, the request retrieves information from the local node - * only. - *

- * API name: {@code local} - */ - public final Builder local(@Nullable Boolean value) { - this.local = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ExistsRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ExistsRequest build() { - _checkSingleUse(); - - return new ExistsRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.exists}". - */ - public static final Endpoint _ENDPOINT = new BooleanEndpoint<>( - "es/indices.exists", - - // Request method - request -> { - return "HEAD"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.includeDefaults != null) { - params.put("include_defaults", String.valueOf(request.includeDefaults)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, null); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExplainDataLifecycleRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExplainDataLifecycleRequest.java deleted file mode 100644 index 1af1f6e3d..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExplainDataLifecycleRequest.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.explain_data_lifecycle.Request - -/** - * Get the status for a data stream lifecycle. Retrieves information about an - * index or data stream’s current data stream lifecycle status, such as time - * since index creation, time since rollover, the lifecycle configuration - * managing the index, or any errors encountered during lifecycle execution. - * - * @see API - * specification - */ - -public class ExplainDataLifecycleRequest extends RequestBase { - @Nullable - private final Boolean includeDefaults; - - private final List index; - - @Nullable - private final Time masterTimeout; - - // --------------------------------------------------------------------------------------------- - - private ExplainDataLifecycleRequest(Builder builder) { - - this.includeDefaults = builder.includeDefaults; - this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); - this.masterTimeout = builder.masterTimeout; - - } - - public static ExplainDataLifecycleRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * indicates if the API should return the default values the system uses for the - * index's lifecycle - *

- * API name: {@code include_defaults} - */ - @Nullable - public final Boolean includeDefaults() { - return this.includeDefaults; - } - - /** - * Required - The name of the index to explain - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - /** - * Specify timeout for connection to master - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ExplainDataLifecycleRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Boolean includeDefaults; - - private List index; - - @Nullable - private Time masterTimeout; - - /** - * indicates if the API should return the default values the system uses for the - * index's lifecycle - *

- * API name: {@code include_defaults} - */ - public final Builder includeDefaults(@Nullable Boolean value) { - this.includeDefaults = value; - return this; - } - - /** - * Required - The name of the index to explain - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * Required - The name of the index to explain - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - /** - * Specify timeout for connection to master - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Specify timeout for connection to master - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ExplainDataLifecycleRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ExplainDataLifecycleRequest build() { - _checkSingleUse(); - - return new ExplainDataLifecycleRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.explain_data_lifecycle}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.explain_data_lifecycle", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_lifecycle"); - buf.append("/explain"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.includeDefaults != null) { - params.put("include_defaults", String.valueOf(request.includeDefaults)); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, ExplainDataLifecycleResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExplainDataLifecycleResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExplainDataLifecycleResponse.java deleted file mode 100644 index e8b06c9de..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExplainDataLifecycleResponse.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch.indices.explain_data_lifecycle.DataStreamLifecycleExplain; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.explain_data_lifecycle.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ExplainDataLifecycleResponse implements JsonpSerializable { - private final Map indices; - - // --------------------------------------------------------------------------------------------- - - private ExplainDataLifecycleResponse(Builder builder) { - - this.indices = ApiTypeHelper.unmodifiableRequired(builder.indices, this, "indices"); - - } - - public static ExplainDataLifecycleResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code indices} - */ - public final Map indices() { - return this.indices; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.indices)) { - generator.writeKey("indices"); - generator.writeStartObject(); - for (Map.Entry item0 : this.indices.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ExplainDataLifecycleResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private Map indices; - - /** - * Required - API name: {@code indices} - *

- * Adds all entries of map to indices. - */ - public final Builder indices(Map map) { - this.indices = _mapPutAll(this.indices, map); - return this; - } - - /** - * Required - API name: {@code indices} - *

- * Adds an entry to indices. - */ - public final Builder indices(String key, DataStreamLifecycleExplain value) { - this.indices = _mapPut(this.indices, key, value); - return this; - } - - /** - * Required - API name: {@code indices} - *

- * Adds an entry to indices using a builder lambda. - */ - public final Builder indices(String key, - Function> fn) { - return indices(key, fn.apply(new DataStreamLifecycleExplain.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ExplainDataLifecycleResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ExplainDataLifecycleResponse build() { - _checkSingleUse(); - - return new ExplainDataLifecycleResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ExplainDataLifecycleResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ExplainDataLifecycleResponse::setupExplainDataLifecycleResponseDeserializer); - - protected static void setupExplainDataLifecycleResponseDeserializer( - ObjectDeserializer op) { - - op.add(Builder::indices, JsonpDeserializer.stringMapDeserializer(DataStreamLifecycleExplain._DESERIALIZER), - "indices"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/FailureStore.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/FailureStore.java deleted file mode 100644 index c43ae6b1c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/FailureStore.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.FailureStore - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class FailureStore implements JsonpSerializable { - private final boolean enabled; - - private final List indices; - - private final boolean rolloverOnWrite; - - // --------------------------------------------------------------------------------------------- - - private FailureStore(Builder builder) { - - this.enabled = ApiTypeHelper.requireNonNull(builder.enabled, this, "enabled"); - this.indices = ApiTypeHelper.unmodifiableRequired(builder.indices, this, "indices"); - this.rolloverOnWrite = ApiTypeHelper.requireNonNull(builder.rolloverOnWrite, this, "rolloverOnWrite"); - - } - - public static FailureStore of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code enabled} - */ - public final boolean enabled() { - return this.enabled; - } - - /** - * Required - API name: {@code indices} - */ - public final List indices() { - return this.indices; - } - - /** - * Required - API name: {@code rollover_on_write} - */ - public final boolean rolloverOnWrite() { - return this.rolloverOnWrite; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("enabled"); - generator.write(this.enabled); - - if (ApiTypeHelper.isDefined(this.indices)) { - generator.writeKey("indices"); - generator.writeStartArray(); - for (DataStreamIndex item0 : this.indices) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - generator.writeKey("rollover_on_write"); - generator.write(this.rolloverOnWrite); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link FailureStore}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Boolean enabled; - - private List indices; - - private Boolean rolloverOnWrite; - - /** - * Required - API name: {@code enabled} - */ - public final Builder enabled(boolean value) { - this.enabled = value; - return this; - } - - /** - * Required - API name: {@code indices} - *

- * Adds all elements of list to indices. - */ - public final Builder indices(List list) { - this.indices = _listAddAll(this.indices, list); - return this; - } - - /** - * Required - API name: {@code indices} - *

- * Adds one or more values to indices. - */ - public final Builder indices(DataStreamIndex value, DataStreamIndex... values) { - this.indices = _listAdd(this.indices, value, values); - return this; - } - - /** - * Required - API name: {@code indices} - *

- * Adds a value to indices using a builder lambda. - */ - public final Builder indices(Function> fn) { - return indices(fn.apply(new DataStreamIndex.Builder()).build()); - } - - /** - * Required - API name: {@code rollover_on_write} - */ - public final Builder rolloverOnWrite(boolean value) { - this.rolloverOnWrite = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link FailureStore}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public FailureStore build() { - _checkSingleUse(); - - return new FailureStore(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link FailureStore} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - FailureStore::setupFailureStoreDeserializer); - - protected static void setupFailureStoreDeserializer(ObjectDeserializer op) { - - op.add(Builder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled"); - op.add(Builder::indices, JsonpDeserializer.arrayDeserializer(DataStreamIndex._DESERIALIZER), "indices"); - op.add(Builder::rolloverOnWrite, JsonpDeserializer.booleanDeserializer(), "rollover_on_write"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/FielddataFrequencyFilter.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/FielddataFrequencyFilter.java deleted file mode 100644 index f197b6bf0..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/FielddataFrequencyFilter.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Double; -import java.lang.Integer; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.FielddataFrequencyFilter - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class FielddataFrequencyFilter implements JsonpSerializable { - private final double max; - - private final double min; - - private final int minSegmentSize; - - // --------------------------------------------------------------------------------------------- - - private FielddataFrequencyFilter(Builder builder) { - - this.max = ApiTypeHelper.requireNonNull(builder.max, this, "max"); - this.min = ApiTypeHelper.requireNonNull(builder.min, this, "min"); - this.minSegmentSize = ApiTypeHelper.requireNonNull(builder.minSegmentSize, this, "minSegmentSize"); - - } - - public static FielddataFrequencyFilter of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code max} - */ - public final double max() { - return this.max; - } - - /** - * Required - API name: {@code min} - */ - public final double min() { - return this.min; - } - - /** - * Required - API name: {@code min_segment_size} - */ - public final int minSegmentSize() { - return this.minSegmentSize; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("max"); - generator.write(this.max); - - generator.writeKey("min"); - generator.write(this.min); - - generator.writeKey("min_segment_size"); - generator.write(this.minSegmentSize); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link FielddataFrequencyFilter}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private Double max; - - private Double min; - - private Integer minSegmentSize; - - /** - * Required - API name: {@code max} - */ - public final Builder max(double value) { - this.max = value; - return this; - } - - /** - * Required - API name: {@code min} - */ - public final Builder min(double value) { - this.min = value; - return this; - } - - /** - * Required - API name: {@code min_segment_size} - */ - public final Builder minSegmentSize(int value) { - this.minSegmentSize = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link FielddataFrequencyFilter}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public FielddataFrequencyFilter build() { - _checkSingleUse(); - - return new FielddataFrequencyFilter(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link FielddataFrequencyFilter} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, FielddataFrequencyFilter::setupFielddataFrequencyFilterDeserializer); - - protected static void setupFielddataFrequencyFilterDeserializer( - ObjectDeserializer op) { - - op.add(Builder::max, JsonpDeserializer.doubleDeserializer(), "max"); - op.add(Builder::min, JsonpDeserializer.doubleDeserializer(), "min"); - op.add(Builder::minSegmentSize, JsonpDeserializer.integerDeserializer(), "min_segment_size"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetAliasRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetAliasRequest.java deleted file mode 100644 index 1c2195539..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetAliasRequest.java +++ /dev/null @@ -1,446 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.get_alias.Request - -/** - * Get aliases. Retrieves information for one or more data stream or index - * aliases. - * - * @see API - * specification - */ - -public class GetAliasRequest extends RequestBase { - @Nullable - private final Boolean allowNoIndices; - - private final List expandWildcards; - - @Nullable - private final Boolean ignoreUnavailable; - - private final List index; - - @Nullable - private final Boolean local; - - private final List name; - - // --------------------------------------------------------------------------------------------- - - private GetAliasRequest(Builder builder) { - - this.allowNoIndices = builder.allowNoIndices; - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.ignoreUnavailable = builder.ignoreUnavailable; - this.index = ApiTypeHelper.unmodifiable(builder.index); - this.local = builder.local; - this.name = ApiTypeHelper.unmodifiable(builder.name); - - } - - public static GetAliasRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. - *

- * API name: {@code allow_no_indices} - */ - @Nullable - public final Boolean allowNoIndices() { - return this.allowNoIndices; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * If false, the request returns an error if it targets a missing - * or closed index. - *

- * API name: {@code ignore_unavailable} - */ - @Nullable - public final Boolean ignoreUnavailable() { - return this.ignoreUnavailable; - } - - /** - * Comma-separated list of data streams or indices used to limit the request. - * Supports wildcards (*). To target all data streams and indices, - * omit this parameter or use * or _all. - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - /** - * If true, the request retrieves information from the local node - * only. - *

- * API name: {@code local} - */ - @Nullable - public final Boolean local() { - return this.local; - } - - /** - * Comma-separated list of aliases to retrieve. Supports wildcards - * (*). To retrieve all aliases, omit this parameter or use - * * or _all. - *

- * API name: {@code name} - */ - public final List name() { - return this.name; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetAliasRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { - @Nullable - private Boolean allowNoIndices; - - @Nullable - private List expandWildcards; - - @Nullable - private Boolean ignoreUnavailable; - - @Nullable - private List index; - - @Nullable - private Boolean local; - - @Nullable - private List name; - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. - *

- * API name: {@code allow_no_indices} - */ - public final Builder allowNoIndices(@Nullable Boolean value) { - this.allowNoIndices = value; - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * If false, the request returns an error if it targets a missing - * or closed index. - *

- * API name: {@code ignore_unavailable} - */ - public final Builder ignoreUnavailable(@Nullable Boolean value) { - this.ignoreUnavailable = value; - return this; - } - - /** - * Comma-separated list of data streams or indices used to limit the request. - * Supports wildcards (*). To target all data streams and indices, - * omit this parameter or use * or _all. - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * Comma-separated list of data streams or indices used to limit the request. - * Supports wildcards (*). To target all data streams and indices, - * omit this parameter or use * or _all. - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - /** - * If true, the request retrieves information from the local node - * only. - *

- * API name: {@code local} - */ - public final Builder local(@Nullable Boolean value) { - this.local = value; - return this; - } - - /** - * Comma-separated list of aliases to retrieve. Supports wildcards - * (*). To retrieve all aliases, omit this parameter or use - * * or _all. - *

- * API name: {@code name} - *

- * Adds all elements of list to name. - */ - public final Builder name(List list) { - this.name = _listAddAll(this.name, list); - return this; - } - - /** - * Comma-separated list of aliases to retrieve. Supports wildcards - * (*). To retrieve all aliases, omit this parameter or use - * * or _all. - *

- * API name: {@code name} - *

- * Adds one or more values to name. - */ - public final Builder name(String value, String... values) { - this.name = _listAdd(this.name, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetAliasRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetAliasRequest build() { - _checkSingleUse(); - - return new GetAliasRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.get_alias}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.get_alias", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - final int _index = 1 << 1; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.name())) - propsSet |= _name; - if (ApiTypeHelper.isDefined(request.index())) - propsSet |= _index; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_alias"); - return buf.toString(); - } - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_alias"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - if (propsSet == (_index | _name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_alias"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_alias"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - final int _index = 1 << 1; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.name())) - propsSet |= _name; - if (ApiTypeHelper.isDefined(request.index())) - propsSet |= _index; - - if (propsSet == 0) { - } - if (propsSet == (_name)) { - params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); - } - if (propsSet == (_index | _name)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); - } - if (propsSet == (_index)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, GetAliasResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetAliasResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetAliasResponse.java deleted file mode 100644 index 07a00f9c1..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetAliasResponse.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch.indices.get_alias.IndexAliases; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import jakarta.json.stream.JsonParser; -import java.lang.String; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.get_alias.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class GetAliasResponse implements JsonpSerializable { - private final Map result; - - // --------------------------------------------------------------------------------------------- - - private GetAliasResponse(Builder builder) { - - this.result = ApiTypeHelper.unmodifiableRequired(builder.result, this, "result"); - - } - - public static GetAliasResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Response value. - */ - public final Map result() { - return this.result; - } - - /** - * Get an element of {@code result}. - */ - public final @Nullable IndexAliases get(String key) { - return this.result.get(key); - } - - /** - * Serialize this value to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - for (Map.Entry item0 : this.result.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetAliasResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Map result = new HashMap<>(); - - /** - * Required - Response value. - *

- * Adds all entries of map to result. - */ - public final Builder result(Map map) { - this.result = _mapPutAll(this.result, map); - return this; - } - - /** - * Required - Response value. - *

- * Adds an entry to result. - */ - public final Builder result(String key, IndexAliases value) { - this.result = _mapPut(this.result, key, value); - return this; - } - - /** - * Required - Response value. - *

- * Adds an entry to result using a builder lambda. - */ - public final Builder result(String key, Function> fn) { - return result(key, fn.apply(new IndexAliases.Builder()).build()); - } - - @Override - public Builder withJson(JsonParser parser, JsonpMapper mapper) { - - @SuppressWarnings("unchecked") - Map value = (Map) JsonpDeserializer - .stringMapDeserializer(IndexAliases._DESERIALIZER).deserialize(parser, mapper); - return this.result(value); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetAliasResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetAliasResponse build() { - _checkSingleUse(); - - return new GetAliasResponse(this); - } - } - - public static final JsonpDeserializer _DESERIALIZER = createGetAliasResponseDeserializer(); - protected static JsonpDeserializer createGetAliasResponseDeserializer() { - - JsonpDeserializer> valueDeserializer = JsonpDeserializer - .stringMapDeserializer(IndexAliases._DESERIALIZER); - - return JsonpDeserializer.of(valueDeserializer.acceptedEvents(), (parser, mapper, event) -> new Builder() - .result(valueDeserializer.deserialize(parser, mapper, event)).build()); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataLifecycleRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataLifecycleRequest.java deleted file mode 100644 index 7ae7c3df5..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataLifecycleRequest.java +++ /dev/null @@ -1,333 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.get_data_lifecycle.Request - -/** - * Get data stream lifecycles. Retrieves the data stream lifecycle configuration - * of one or more data streams. - * - * @see API - * specification - */ - -public class GetDataLifecycleRequest extends RequestBase { - private final List expandWildcards; - - @Nullable - private final Boolean includeDefaults; - - @Nullable - private final Time masterTimeout; - - private final List name; - - // --------------------------------------------------------------------------------------------- - - private GetDataLifecycleRequest(Builder builder) { - - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.includeDefaults = builder.includeDefaults; - this.masterTimeout = builder.masterTimeout; - this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); - - } - - public static GetDataLifecycleRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Type of data stream that wildcard patterns can match. Supports - * comma-separated values, such as open,hidden. Valid values are: - * all, open, closed, - * hidden, none. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * If true, return all default settings in the response. - *

- * API name: {@code include_defaults} - */ - @Nullable - public final Boolean includeDefaults() { - return this.includeDefaults; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Required - Comma-separated list of data streams to limit the request. - * Supports wildcards (*). To target all data streams, omit this - * parameter or use * or _all. - *

- * API name: {@code name} - */ - public final List name() { - return this.name; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetDataLifecycleRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private List expandWildcards; - - @Nullable - private Boolean includeDefaults; - - @Nullable - private Time masterTimeout; - - private List name; - - /** - * Type of data stream that wildcard patterns can match. Supports - * comma-separated values, such as open,hidden. Valid values are: - * all, open, closed, - * hidden, none. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Type of data stream that wildcard patterns can match. Supports - * comma-separated values, such as open,hidden. Valid values are: - * all, open, closed, - * hidden, none. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * If true, return all default settings in the response. - *

- * API name: {@code include_defaults} - */ - public final Builder includeDefaults(@Nullable Boolean value) { - this.includeDefaults = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - Comma-separated list of data streams to limit the request. - * Supports wildcards (*). To target all data streams, omit this - * parameter or use * or _all. - *

- * API name: {@code name} - *

- * Adds all elements of list to name. - */ - public final Builder name(List list) { - this.name = _listAddAll(this.name, list); - return this; - } - - /** - * Required - Comma-separated list of data streams to limit the request. - * Supports wildcards (*). To target all data streams, omit this - * parameter or use * or _all. - *

- * API name: {@code name} - *

- * Adds one or more values to name. - */ - public final Builder name(String value, String... values) { - this.name = _listAdd(this.name, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetDataLifecycleRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetDataLifecycleRequest build() { - _checkSingleUse(); - - return new GetDataLifecycleRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.get_data_lifecycle}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.get_data_lifecycle", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_data_stream"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_lifecycle"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.includeDefaults != null) { - params.put("include_defaults", String.valueOf(request.includeDefaults)); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, GetDataLifecycleResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataLifecycleResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataLifecycleResponse.java deleted file mode 100644 index b770acbe5..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataLifecycleResponse.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch.indices.get_data_lifecycle.DataStreamWithLifecycle; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.get_data_lifecycle.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class GetDataLifecycleResponse implements JsonpSerializable { - private final List dataStreams; - - // --------------------------------------------------------------------------------------------- - - private GetDataLifecycleResponse(Builder builder) { - - this.dataStreams = ApiTypeHelper.unmodifiableRequired(builder.dataStreams, this, "dataStreams"); - - } - - public static GetDataLifecycleResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code data_streams} - */ - public final List dataStreams() { - return this.dataStreams; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.dataStreams)) { - generator.writeKey("data_streams"); - generator.writeStartArray(); - for (DataStreamWithLifecycle item0 : this.dataStreams) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetDataLifecycleResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private List dataStreams; - - /** - * Required - API name: {@code data_streams} - *

- * Adds all elements of list to dataStreams. - */ - public final Builder dataStreams(List list) { - this.dataStreams = _listAddAll(this.dataStreams, list); - return this; - } - - /** - * Required - API name: {@code data_streams} - *

- * Adds one or more values to dataStreams. - */ - public final Builder dataStreams(DataStreamWithLifecycle value, DataStreamWithLifecycle... values) { - this.dataStreams = _listAdd(this.dataStreams, value, values); - return this; - } - - /** - * Required - API name: {@code data_streams} - *

- * Adds a value to dataStreams using a builder lambda. - */ - public final Builder dataStreams( - Function> fn) { - return dataStreams(fn.apply(new DataStreamWithLifecycle.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetDataLifecycleResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetDataLifecycleResponse build() { - _checkSingleUse(); - - return new GetDataLifecycleResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link GetDataLifecycleResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, GetDataLifecycleResponse::setupGetDataLifecycleResponseDeserializer); - - protected static void setupGetDataLifecycleResponseDeserializer( - ObjectDeserializer op) { - - op.add(Builder::dataStreams, JsonpDeserializer.arrayDeserializer(DataStreamWithLifecycle._DESERIALIZER), - "data_streams"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataStreamRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataStreamRequest.java deleted file mode 100644 index 18fb316d6..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataStreamRequest.java +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.get_data_stream.Request - -/** - * Get data streams. Retrieves information about one or more data streams. - * - * @see API - * specification - */ - -public class GetDataStreamRequest extends RequestBase { - private final List expandWildcards; - - @Nullable - private final Boolean includeDefaults; - - @Nullable - private final Time masterTimeout; - - private final List name; - - @Nullable - private final Boolean verbose; - - // --------------------------------------------------------------------------------------------- - - private GetDataStreamRequest(Builder builder) { - - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.includeDefaults = builder.includeDefaults; - this.masterTimeout = builder.masterTimeout; - this.name = ApiTypeHelper.unmodifiable(builder.name); - this.verbose = builder.verbose; - - } - - public static GetDataStreamRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Type of data stream that wildcard patterns can match. Supports - * comma-separated values, such as open,hidden. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * If true, returns all relevant default configurations for the index template. - *

- * API name: {@code include_defaults} - */ - @Nullable - public final Boolean includeDefaults() { - return this.includeDefaults; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Comma-separated list of data stream names used to limit the request. Wildcard - * (*) expressions are supported. If omitted, all data streams are - * returned. - *

- * API name: {@code name} - */ - public final List name() { - return this.name; - } - - /** - * Whether the maximum timestamp for each data stream should be calculated and - * returned. - *

- * API name: {@code verbose} - */ - @Nullable - public final Boolean verbose() { - return this.verbose; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetDataStreamRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private List expandWildcards; - - @Nullable - private Boolean includeDefaults; - - @Nullable - private Time masterTimeout; - - @Nullable - private List name; - - @Nullable - private Boolean verbose; - - /** - * Type of data stream that wildcard patterns can match. Supports - * comma-separated values, such as open,hidden. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Type of data stream that wildcard patterns can match. Supports - * comma-separated values, such as open,hidden. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * If true, returns all relevant default configurations for the index template. - *

- * API name: {@code include_defaults} - */ - public final Builder includeDefaults(@Nullable Boolean value) { - this.includeDefaults = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Comma-separated list of data stream names used to limit the request. Wildcard - * (*) expressions are supported. If omitted, all data streams are - * returned. - *

- * API name: {@code name} - *

- * Adds all elements of list to name. - */ - public final Builder name(List list) { - this.name = _listAddAll(this.name, list); - return this; - } - - /** - * Comma-separated list of data stream names used to limit the request. Wildcard - * (*) expressions are supported. If omitted, all data streams are - * returned. - *

- * API name: {@code name} - *

- * Adds one or more values to name. - */ - public final Builder name(String value, String... values) { - this.name = _listAdd(this.name, value, values); - return this; - } - - /** - * Whether the maximum timestamp for each data stream should be calculated and - * returned. - *

- * API name: {@code verbose} - */ - public final Builder verbose(@Nullable Boolean value) { - this.verbose = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetDataStreamRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetDataStreamRequest build() { - _checkSingleUse(); - - return new GetDataStreamRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.get_data_stream}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.get_data_stream", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.name())) - propsSet |= _name; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_data_stream"); - return buf.toString(); - } - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_data_stream"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.name())) - propsSet |= _name; - - if (propsSet == 0) { - } - if (propsSet == (_name)) { - params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.includeDefaults != null) { - params.put("include_defaults", String.valueOf(request.includeDefaults)); - } - if (request.verbose != null) { - params.put("verbose", String.valueOf(request.verbose)); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, GetDataStreamResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataStreamResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataStreamResponse.java deleted file mode 100644 index 3c7fa5d83..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataStreamResponse.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.get_data_stream.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class GetDataStreamResponse implements JsonpSerializable { - private final List dataStreams; - - // --------------------------------------------------------------------------------------------- - - private GetDataStreamResponse(Builder builder) { - - this.dataStreams = ApiTypeHelper.unmodifiableRequired(builder.dataStreams, this, "dataStreams"); - - } - - public static GetDataStreamResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code data_streams} - */ - public final List dataStreams() { - return this.dataStreams; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.dataStreams)) { - generator.writeKey("data_streams"); - generator.writeStartArray(); - for (DataStream item0 : this.dataStreams) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetDataStreamResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private List dataStreams; - - /** - * Required - API name: {@code data_streams} - *

- * Adds all elements of list to dataStreams. - */ - public final Builder dataStreams(List list) { - this.dataStreams = _listAddAll(this.dataStreams, list); - return this; - } - - /** - * Required - API name: {@code data_streams} - *

- * Adds one or more values to dataStreams. - */ - public final Builder dataStreams(DataStream value, DataStream... values) { - this.dataStreams = _listAdd(this.dataStreams, value, values); - return this; - } - - /** - * Required - API name: {@code data_streams} - *

- * Adds a value to dataStreams using a builder lambda. - */ - public final Builder dataStreams(Function> fn) { - return dataStreams(fn.apply(new DataStream.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetDataStreamResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetDataStreamResponse build() { - _checkSingleUse(); - - return new GetDataStreamResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link GetDataStreamResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, GetDataStreamResponse::setupGetDataStreamResponseDeserializer); - - protected static void setupGetDataStreamResponseDeserializer(ObjectDeserializer op) { - - op.add(Builder::dataStreams, JsonpDeserializer.arrayDeserializer(DataStream._DESERIALIZER), "data_streams"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexRequest.java deleted file mode 100644 index f25673cc9..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexRequest.java +++ /dev/null @@ -1,496 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.elasticsearch.indices.get.Feature; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.get.Request - -/** - * Get index information. Returns information about one or more indices. For - * data streams, the API returns information about the stream’s backing indices. - * - * @see API - * specification - */ - -public class GetIndexRequest extends RequestBase { - @Nullable - private final Boolean allowNoIndices; - - private final List expandWildcards; - - private final List features; - - @Nullable - private final Boolean flatSettings; - - @Nullable - private final Boolean ignoreUnavailable; - - @Nullable - private final Boolean includeDefaults; - - private final List index; - - @Nullable - private final Boolean local; - - @Nullable - private final Time masterTimeout; - - // --------------------------------------------------------------------------------------------- - - private GetIndexRequest(Builder builder) { - - this.allowNoIndices = builder.allowNoIndices; - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.features = ApiTypeHelper.unmodifiable(builder.features); - this.flatSettings = builder.flatSettings; - this.ignoreUnavailable = builder.ignoreUnavailable; - this.includeDefaults = builder.includeDefaults; - this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); - this.local = builder.local; - this.masterTimeout = builder.masterTimeout; - - } - - public static GetIndexRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If false, the request returns an error if any wildcard expression, index - * alias, or _all value targets only missing or closed indices. This behavior - * applies even if the request targets other open indices. For example, a - * request targeting foo*,bar* returns an error if an index starts with foo but - * no index starts with bar. - *

- * API name: {@code allow_no_indices} - */ - @Nullable - public final Boolean allowNoIndices() { - return this.allowNoIndices; - } - - /** - * Type of index that wildcard expressions can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as open,hidden. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * Return only information on specified index features - *

- * API name: {@code features} - */ - public final List features() { - return this.features; - } - - /** - * If true, returns settings in flat format. - *

- * API name: {@code flat_settings} - */ - @Nullable - public final Boolean flatSettings() { - return this.flatSettings; - } - - /** - * If false, requests that target a missing index return an error. - *

- * API name: {@code ignore_unavailable} - */ - @Nullable - public final Boolean ignoreUnavailable() { - return this.ignoreUnavailable; - } - - /** - * If true, return all default settings in the response. - *

- * API name: {@code include_defaults} - */ - @Nullable - public final Boolean includeDefaults() { - return this.includeDefaults; - } - - /** - * Required - Comma-separated list of data streams, indices, and index aliases - * used to limit the request. Wildcard expressions (*) are supported. - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - /** - * If true, the request retrieves information from the local node only. Defaults - * to false, which means information is retrieved from the master node. - *

- * API name: {@code local} - */ - @Nullable - public final Boolean local() { - return this.local; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetIndexRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { - @Nullable - private Boolean allowNoIndices; - - @Nullable - private List expandWildcards; - - @Nullable - private List features; - - @Nullable - private Boolean flatSettings; - - @Nullable - private Boolean ignoreUnavailable; - - @Nullable - private Boolean includeDefaults; - - private List index; - - @Nullable - private Boolean local; - - @Nullable - private Time masterTimeout; - - /** - * If false, the request returns an error if any wildcard expression, index - * alias, or _all value targets only missing or closed indices. This behavior - * applies even if the request targets other open indices. For example, a - * request targeting foo*,bar* returns an error if an index starts with foo but - * no index starts with bar. - *

- * API name: {@code allow_no_indices} - */ - public final Builder allowNoIndices(@Nullable Boolean value) { - this.allowNoIndices = value; - return this; - } - - /** - * Type of index that wildcard expressions can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as open,hidden. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Type of index that wildcard expressions can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as open,hidden. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * Return only information on specified index features - *

- * API name: {@code features} - *

- * Adds all elements of list to features. - */ - public final Builder features(List list) { - this.features = _listAddAll(this.features, list); - return this; - } - - /** - * Return only information on specified index features - *

- * API name: {@code features} - *

- * Adds one or more values to features. - */ - public final Builder features(Feature value, Feature... values) { - this.features = _listAdd(this.features, value, values); - return this; - } - - /** - * If true, returns settings in flat format. - *

- * API name: {@code flat_settings} - */ - public final Builder flatSettings(@Nullable Boolean value) { - this.flatSettings = value; - return this; - } - - /** - * If false, requests that target a missing index return an error. - *

- * API name: {@code ignore_unavailable} - */ - public final Builder ignoreUnavailable(@Nullable Boolean value) { - this.ignoreUnavailable = value; - return this; - } - - /** - * If true, return all default settings in the response. - *

- * API name: {@code include_defaults} - */ - public final Builder includeDefaults(@Nullable Boolean value) { - this.includeDefaults = value; - return this; - } - - /** - * Required - Comma-separated list of data streams, indices, and index aliases - * used to limit the request. Wildcard expressions (*) are supported. - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * Required - Comma-separated list of data streams, indices, and index aliases - * used to limit the request. Wildcard expressions (*) are supported. - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - /** - * If true, the request retrieves information from the local node only. Defaults - * to false, which means information is retrieved from the master node. - *

- * API name: {@code local} - */ - public final Builder local(@Nullable Boolean value) { - this.local = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetIndexRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetIndexRequest build() { - _checkSingleUse(); - - return new GetIndexRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.get}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.get", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.features)) { - params.put("features", - request.features.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.includeDefaults != null) { - params.put("include_defaults", String.valueOf(request.includeDefaults)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, GetIndexResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexResponse.java deleted file mode 100644 index 0eb9e9f14..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexResponse.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import jakarta.json.stream.JsonParser; -import java.lang.String; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.get.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class GetIndexResponse implements JsonpSerializable { - private final Map result; - - // --------------------------------------------------------------------------------------------- - - private GetIndexResponse(Builder builder) { - - this.result = ApiTypeHelper.unmodifiableRequired(builder.result, this, "result"); - - } - - public static GetIndexResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Response value. - */ - public final Map result() { - return this.result; - } - - /** - * Get an element of {@code result}. - */ - public final @Nullable IndexState get(String key) { - return this.result.get(key); - } - - /** - * Serialize this value to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - for (Map.Entry item0 : this.result.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetIndexResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Map result = new HashMap<>(); - - /** - * Required - Response value. - *

- * Adds all entries of map to result. - */ - public final Builder result(Map map) { - this.result = _mapPutAll(this.result, map); - return this; - } - - /** - * Required - Response value. - *

- * Adds an entry to result. - */ - public final Builder result(String key, IndexState value) { - this.result = _mapPut(this.result, key, value); - return this; - } - - /** - * Required - Response value. - *

- * Adds an entry to result using a builder lambda. - */ - public final Builder result(String key, Function> fn) { - return result(key, fn.apply(new IndexState.Builder()).build()); - } - - @Override - public Builder withJson(JsonParser parser, JsonpMapper mapper) { - - @SuppressWarnings("unchecked") - Map value = (Map) JsonpDeserializer - .stringMapDeserializer(IndexState._DESERIALIZER).deserialize(parser, mapper); - return this.result(value); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetIndexResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetIndexResponse build() { - _checkSingleUse(); - - return new GetIndexResponse(this); - } - } - - public static final JsonpDeserializer _DESERIALIZER = createGetIndexResponseDeserializer(); - protected static JsonpDeserializer createGetIndexResponseDeserializer() { - - JsonpDeserializer> valueDeserializer = JsonpDeserializer - .stringMapDeserializer(IndexState._DESERIALIZER); - - return JsonpDeserializer.of(valueDeserializer.acceptedEvents(), (parser, mapper, event) -> new Builder() - .result(valueDeserializer.deserialize(parser, mapper, event)).build()); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexTemplateRequest.java deleted file mode 100644 index 88d77c6fb..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexTemplateRequest.java +++ /dev/null @@ -1,331 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.get_index_template.Request - -/** - * Get index templates. Returns information about one or more index templates. - * - * @see API - * specification - */ - -public class GetIndexTemplateRequest extends RequestBase { - @Nullable - private final Boolean flatSettings; - - @Nullable - private final Boolean includeDefaults; - - @Nullable - private final Boolean local; - - @Nullable - private final Time masterTimeout; - - @Nullable - private final String name; - - // --------------------------------------------------------------------------------------------- - - private GetIndexTemplateRequest(Builder builder) { - - this.flatSettings = builder.flatSettings; - this.includeDefaults = builder.includeDefaults; - this.local = builder.local; - this.masterTimeout = builder.masterTimeout; - this.name = builder.name; - - } - - public static GetIndexTemplateRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If true, returns settings in flat format. - *

- * API name: {@code flat_settings} - */ - @Nullable - public final Boolean flatSettings() { - return this.flatSettings; - } - - /** - * If true, returns all relevant default configurations for the index template. - *

- * API name: {@code include_defaults} - */ - @Nullable - public final Boolean includeDefaults() { - return this.includeDefaults; - } - - /** - * If true, the request retrieves information from the local node only. Defaults - * to false, which means information is retrieved from the master node. - *

- * API name: {@code local} - */ - @Nullable - public final Boolean local() { - return this.local; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Comma-separated list of index template names used to limit the request. - * Wildcard (*) expressions are supported. - *

- * API name: {@code name} - */ - @Nullable - public final String name() { - return this.name; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetIndexTemplateRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Boolean flatSettings; - - @Nullable - private Boolean includeDefaults; - - @Nullable - private Boolean local; - - @Nullable - private Time masterTimeout; - - @Nullable - private String name; - - /** - * If true, returns settings in flat format. - *

- * API name: {@code flat_settings} - */ - public final Builder flatSettings(@Nullable Boolean value) { - this.flatSettings = value; - return this; - } - - /** - * If true, returns all relevant default configurations for the index template. - *

- * API name: {@code include_defaults} - */ - public final Builder includeDefaults(@Nullable Boolean value) { - this.includeDefaults = value; - return this; - } - - /** - * If true, the request retrieves information from the local node only. Defaults - * to false, which means information is retrieved from the master node. - *

- * API name: {@code local} - */ - public final Builder local(@Nullable Boolean value) { - this.local = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Comma-separated list of index template names used to limit the request. - * Wildcard (*) expressions are supported. - *

- * API name: {@code name} - */ - public final Builder name(@Nullable String value) { - this.name = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetIndexTemplateRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetIndexTemplateRequest build() { - _checkSingleUse(); - - return new GetIndexTemplateRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.get_index_template}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.get_index_template", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - if (request.name() != null) - propsSet |= _name; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_index_template"); - return buf.toString(); - } - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_index_template"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - if (request.name() != null) - propsSet |= _name; - - if (propsSet == 0) { - } - if (propsSet == (_name)) { - params.put("name", request.name); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (request.includeDefaults != null) { - params.put("include_defaults", String.valueOf(request.includeDefaults)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, GetIndexTemplateResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexTemplateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexTemplateResponse.java deleted file mode 100644 index a098f2ba7..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexTemplateResponse.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch.indices.get_index_template.IndexTemplateItem; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.get_index_template.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class GetIndexTemplateResponse implements JsonpSerializable { - private final List indexTemplates; - - // --------------------------------------------------------------------------------------------- - - private GetIndexTemplateResponse(Builder builder) { - - this.indexTemplates = ApiTypeHelper.unmodifiableRequired(builder.indexTemplates, this, "indexTemplates"); - - } - - public static GetIndexTemplateResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code index_templates} - */ - public final List indexTemplates() { - return this.indexTemplates; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.indexTemplates)) { - generator.writeKey("index_templates"); - generator.writeStartArray(); - for (IndexTemplateItem item0 : this.indexTemplates) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetIndexTemplateResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private List indexTemplates; - - /** - * Required - API name: {@code index_templates} - *

- * Adds all elements of list to indexTemplates. - */ - public final Builder indexTemplates(List list) { - this.indexTemplates = _listAddAll(this.indexTemplates, list); - return this; - } - - /** - * Required - API name: {@code index_templates} - *

- * Adds one or more values to indexTemplates. - */ - public final Builder indexTemplates(IndexTemplateItem value, IndexTemplateItem... values) { - this.indexTemplates = _listAdd(this.indexTemplates, value, values); - return this; - } - - /** - * Required - API name: {@code index_templates} - *

- * Adds a value to indexTemplates using a builder lambda. - */ - public final Builder indexTemplates(Function> fn) { - return indexTemplates(fn.apply(new IndexTemplateItem.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetIndexTemplateResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetIndexTemplateResponse build() { - _checkSingleUse(); - - return new GetIndexTemplateResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link GetIndexTemplateResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, GetIndexTemplateResponse::setupGetIndexTemplateResponseDeserializer); - - protected static void setupGetIndexTemplateResponseDeserializer( - ObjectDeserializer op) { - - op.add(Builder::indexTemplates, JsonpDeserializer.arrayDeserializer(IndexTemplateItem._DESERIALIZER), - "index_templates"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndicesSettingsRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndicesSettingsRequest.java deleted file mode 100644 index b24881456..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndicesSettingsRequest.java +++ /dev/null @@ -1,541 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.get_settings.Request - -/** - * Get index settings. Returns setting information for one or more indices. For - * data streams, returns setting information for the stream’s backing indices. - * - * @see API - * specification - */ - -public class GetIndicesSettingsRequest extends RequestBase { - @Nullable - private final Boolean allowNoIndices; - - private final List expandWildcards; - - @Nullable - private final Boolean flatSettings; - - @Nullable - private final Boolean ignoreUnavailable; - - @Nullable - private final Boolean includeDefaults; - - private final List index; - - @Nullable - private final Boolean local; - - @Nullable - private final Time masterTimeout; - - private final List name; - - // --------------------------------------------------------------------------------------------- - - private GetIndicesSettingsRequest(Builder builder) { - - this.allowNoIndices = builder.allowNoIndices; - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.flatSettings = builder.flatSettings; - this.ignoreUnavailable = builder.ignoreUnavailable; - this.includeDefaults = builder.includeDefaults; - this.index = ApiTypeHelper.unmodifiable(builder.index); - this.local = builder.local; - this.masterTimeout = builder.masterTimeout; - this.name = ApiTypeHelper.unmodifiable(builder.name); - - } - - public static GetIndicesSettingsRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. For example, a request targeting foo*,bar* returns an - * error if an index starts with foo but no index starts with bar. - *

- * API name: {@code allow_no_indices} - */ - @Nullable - public final Boolean allowNoIndices() { - return this.allowNoIndices; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * If true, returns settings in flat format. - *

- * API name: {@code flat_settings} - */ - @Nullable - public final Boolean flatSettings() { - return this.flatSettings; - } - - /** - * If false, the request returns an error if it targets a missing - * or closed index. - *

- * API name: {@code ignore_unavailable} - */ - @Nullable - public final Boolean ignoreUnavailable() { - return this.ignoreUnavailable; - } - - /** - * If true, return all default settings in the response. - *

- * API name: {@code include_defaults} - */ - @Nullable - public final Boolean includeDefaults() { - return this.includeDefaults; - } - - /** - * Comma-separated list of data streams, indices, and aliases used to limit the - * request. Supports wildcards (*). To target all data streams and - * indices, omit this parameter or use * or _all. - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - /** - * If true, the request retrieves information from the local node - * only. If false, information is retrieved from the master node. - *

- * API name: {@code local} - */ - @Nullable - public final Boolean local() { - return this.local; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Comma-separated list or wildcard expression of settings to retrieve. - *

- * API name: {@code name} - */ - public final List name() { - return this.name; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetIndicesSettingsRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Boolean allowNoIndices; - - @Nullable - private List expandWildcards; - - @Nullable - private Boolean flatSettings; - - @Nullable - private Boolean ignoreUnavailable; - - @Nullable - private Boolean includeDefaults; - - @Nullable - private List index; - - @Nullable - private Boolean local; - - @Nullable - private Time masterTimeout; - - @Nullable - private List name; - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. For example, a request targeting foo*,bar* returns an - * error if an index starts with foo but no index starts with bar. - *

- * API name: {@code allow_no_indices} - */ - public final Builder allowNoIndices(@Nullable Boolean value) { - this.allowNoIndices = value; - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * If true, returns settings in flat format. - *

- * API name: {@code flat_settings} - */ - public final Builder flatSettings(@Nullable Boolean value) { - this.flatSettings = value; - return this; - } - - /** - * If false, the request returns an error if it targets a missing - * or closed index. - *

- * API name: {@code ignore_unavailable} - */ - public final Builder ignoreUnavailable(@Nullable Boolean value) { - this.ignoreUnavailable = value; - return this; - } - - /** - * If true, return all default settings in the response. - *

- * API name: {@code include_defaults} - */ - public final Builder includeDefaults(@Nullable Boolean value) { - this.includeDefaults = value; - return this; - } - - /** - * Comma-separated list of data streams, indices, and aliases used to limit the - * request. Supports wildcards (*). To target all data streams and - * indices, omit this parameter or use * or _all. - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * Comma-separated list of data streams, indices, and aliases used to limit the - * request. Supports wildcards (*). To target all data streams and - * indices, omit this parameter or use * or _all. - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - /** - * If true, the request retrieves information from the local node - * only. If false, information is retrieved from the master node. - *

- * API name: {@code local} - */ - public final Builder local(@Nullable Boolean value) { - this.local = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Comma-separated list or wildcard expression of settings to retrieve. - *

- * API name: {@code name} - *

- * Adds all elements of list to name. - */ - public final Builder name(List list) { - this.name = _listAddAll(this.name, list); - return this; - } - - /** - * Comma-separated list or wildcard expression of settings to retrieve. - *

- * API name: {@code name} - *

- * Adds one or more values to name. - */ - public final Builder name(String value, String... values) { - this.name = _listAdd(this.name, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetIndicesSettingsRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetIndicesSettingsRequest build() { - _checkSingleUse(); - - return new GetIndicesSettingsRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.get_settings}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.get_settings", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - final int _index = 1 << 1; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.name())) - propsSet |= _name; - if (ApiTypeHelper.isDefined(request.index())) - propsSet |= _index; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_settings"); - return buf.toString(); - } - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_settings"); - return buf.toString(); - } - if (propsSet == (_index | _name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_settings"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_settings"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - final int _index = 1 << 1; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.name())) - propsSet |= _name; - if (ApiTypeHelper.isDefined(request.index())) - propsSet |= _index; - - if (propsSet == 0) { - } - if (propsSet == (_index)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - } - if (propsSet == (_index | _name)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); - } - if (propsSet == (_name)) { - params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.includeDefaults != null) { - params.put("include_defaults", String.valueOf(request.includeDefaults)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, GetIndicesSettingsResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndicesSettingsResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndicesSettingsResponse.java deleted file mode 100644 index 4bbe6b441..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndicesSettingsResponse.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import jakarta.json.stream.JsonParser; -import java.lang.String; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.get_settings.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class GetIndicesSettingsResponse implements JsonpSerializable { - private final Map result; - - // --------------------------------------------------------------------------------------------- - - private GetIndicesSettingsResponse(Builder builder) { - - this.result = ApiTypeHelper.unmodifiableRequired(builder.result, this, "result"); - - } - - public static GetIndicesSettingsResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Response value. - */ - public final Map result() { - return this.result; - } - - /** - * Get an element of {@code result}. - */ - public final @Nullable IndexState get(String key) { - return this.result.get(key); - } - - /** - * Serialize this value to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - for (Map.Entry item0 : this.result.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetIndicesSettingsResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private Map result = new HashMap<>(); - - /** - * Required - Response value. - *

- * Adds all entries of map to result. - */ - public final Builder result(Map map) { - this.result = _mapPutAll(this.result, map); - return this; - } - - /** - * Required - Response value. - *

- * Adds an entry to result. - */ - public final Builder result(String key, IndexState value) { - this.result = _mapPut(this.result, key, value); - return this; - } - - /** - * Required - Response value. - *

- * Adds an entry to result using a builder lambda. - */ - public final Builder result(String key, Function> fn) { - return result(key, fn.apply(new IndexState.Builder()).build()); - } - - @Override - public Builder withJson(JsonParser parser, JsonpMapper mapper) { - - @SuppressWarnings("unchecked") - Map value = (Map) JsonpDeserializer - .stringMapDeserializer(IndexState._DESERIALIZER).deserialize(parser, mapper); - return this.result(value); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetIndicesSettingsResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetIndicesSettingsResponse build() { - _checkSingleUse(); - - return new GetIndicesSettingsResponse(this); - } - } - - public static final JsonpDeserializer _DESERIALIZER = createGetIndicesSettingsResponseDeserializer(); - protected static JsonpDeserializer createGetIndicesSettingsResponseDeserializer() { - - JsonpDeserializer> valueDeserializer = JsonpDeserializer - .stringMapDeserializer(IndexState._DESERIALIZER); - - return JsonpDeserializer.of(valueDeserializer.acceptedEvents(), (parser, mapper, event) -> new Builder() - .result(valueDeserializer.deserialize(parser, mapper, event)).build()); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetMappingRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetMappingRequest.java deleted file mode 100644 index ea3bf519a..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetMappingRequest.java +++ /dev/null @@ -1,418 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.get_mapping.Request - -/** - * Get mapping definitions. Retrieves mapping definitions for one or more - * indices. For data streams, the API retrieves mappings for the stream’s - * backing indices. - * - * @see API - * specification - */ - -public class GetMappingRequest extends RequestBase { - @Nullable - private final Boolean allowNoIndices; - - private final List expandWildcards; - - @Nullable - private final Boolean ignoreUnavailable; - - private final List index; - - @Nullable - private final Boolean local; - - @Nullable - private final Time masterTimeout; - - // --------------------------------------------------------------------------------------------- - - private GetMappingRequest(Builder builder) { - - this.allowNoIndices = builder.allowNoIndices; - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.ignoreUnavailable = builder.ignoreUnavailable; - this.index = ApiTypeHelper.unmodifiable(builder.index); - this.local = builder.local; - this.masterTimeout = builder.masterTimeout; - - } - - public static GetMappingRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. - *

- * API name: {@code allow_no_indices} - */ - @Nullable - public final Boolean allowNoIndices() { - return this.allowNoIndices; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * If false, the request returns an error if it targets a missing - * or closed index. - *

- * API name: {@code ignore_unavailable} - */ - @Nullable - public final Boolean ignoreUnavailable() { - return this.ignoreUnavailable; - } - - /** - * Comma-separated list of data streams, indices, and aliases used to limit the - * request. Supports wildcards (*). To target all data streams and - * indices, omit this parameter or use * or _all. - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - /** - * If true, the request retrieves information from the local node - * only. - *

- * API name: {@code local} - */ - @Nullable - public final Boolean local() { - return this.local; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetMappingRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Boolean allowNoIndices; - - @Nullable - private List expandWildcards; - - @Nullable - private Boolean ignoreUnavailable; - - @Nullable - private List index; - - @Nullable - private Boolean local; - - @Nullable - private Time masterTimeout; - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. - *

- * API name: {@code allow_no_indices} - */ - public final Builder allowNoIndices(@Nullable Boolean value) { - this.allowNoIndices = value; - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * If false, the request returns an error if it targets a missing - * or closed index. - *

- * API name: {@code ignore_unavailable} - */ - public final Builder ignoreUnavailable(@Nullable Boolean value) { - this.ignoreUnavailable = value; - return this; - } - - /** - * Comma-separated list of data streams, indices, and aliases used to limit the - * request. Supports wildcards (*). To target all data streams and - * indices, omit this parameter or use * or _all. - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * Comma-separated list of data streams, indices, and aliases used to limit the - * request. Supports wildcards (*). To target all data streams and - * indices, omit this parameter or use * or _all. - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - /** - * If true, the request retrieves information from the local node - * only. - *

- * API name: {@code local} - */ - public final Builder local(@Nullable Boolean value) { - this.local = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetMappingRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetMappingRequest build() { - _checkSingleUse(); - - return new GetMappingRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.get_mapping}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.get_mapping", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.index())) - propsSet |= _index; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_mapping"); - return buf.toString(); - } - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_mapping"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _index = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.index())) - propsSet |= _index; - - if (propsSet == 0) { - } - if (propsSet == (_index)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, GetMappingResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetMappingResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetMappingResponse.java deleted file mode 100644 index 5d88a4fed..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetMappingResponse.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch.indices.get_mapping.IndexMappingRecord; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import jakarta.json.stream.JsonParser; -import java.lang.String; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.get_mapping.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class GetMappingResponse implements JsonpSerializable { - private final Map result; - - // --------------------------------------------------------------------------------------------- - - private GetMappingResponse(Builder builder) { - - this.result = ApiTypeHelper.unmodifiableRequired(builder.result, this, "result"); - - } - - public static GetMappingResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Response value. - */ - public final Map result() { - return this.result; - } - - /** - * Get an element of {@code result}. - */ - public final @Nullable IndexMappingRecord get(String key) { - return this.result.get(key); - } - - /** - * Serialize this value to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - for (Map.Entry item0 : this.result.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetMappingResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private Map result = new HashMap<>(); - - /** - * Required - Response value. - *

- * Adds all entries of map to result. - */ - public final Builder result(Map map) { - this.result = _mapPutAll(this.result, map); - return this; - } - - /** - * Required - Response value. - *

- * Adds an entry to result. - */ - public final Builder result(String key, IndexMappingRecord value) { - this.result = _mapPut(this.result, key, value); - return this; - } - - /** - * Required - Response value. - *

- * Adds an entry to result using a builder lambda. - */ - public final Builder result(String key, - Function> fn) { - return result(key, fn.apply(new IndexMappingRecord.Builder()).build()); - } - - @Override - public Builder withJson(JsonParser parser, JsonpMapper mapper) { - - @SuppressWarnings("unchecked") - Map value = (Map) JsonpDeserializer - .stringMapDeserializer(IndexMappingRecord._DESERIALIZER).deserialize(parser, mapper); - return this.result(value); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetMappingResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetMappingResponse build() { - _checkSingleUse(); - - return new GetMappingResponse(this); - } - } - - public static final JsonpDeserializer _DESERIALIZER = createGetMappingResponseDeserializer(); - protected static JsonpDeserializer createGetMappingResponseDeserializer() { - - JsonpDeserializer> valueDeserializer = JsonpDeserializer - .stringMapDeserializer(IndexMappingRecord._DESERIALIZER); - - return JsonpDeserializer.of(valueDeserializer.acceptedEvents(), (parser, mapper, event) -> new Builder() - .result(valueDeserializer.deserialize(parser, mapper, event)).build()); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexCheckOnStartup.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexCheckOnStartup.java deleted file mode 100644 index f26073eec..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexCheckOnStartup.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum IndexCheckOnStartup implements JsonEnum { - True("true"), - - False("false"), - - Checksum("checksum"), - - ; - - private final String jsonValue; - - IndexCheckOnStartup(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - IndexCheckOnStartup.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRouting.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRouting.java deleted file mode 100644 index c8a8fbb59..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRouting.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexRouting - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexRouting implements JsonpSerializable { - @Nullable - private final IndexRoutingAllocation allocation; - - @Nullable - private final IndexRoutingRebalance rebalance; - - // --------------------------------------------------------------------------------------------- - - private IndexRouting(Builder builder) { - - this.allocation = builder.allocation; - this.rebalance = builder.rebalance; - - } - - public static IndexRouting of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code allocation} - */ - @Nullable - public final IndexRoutingAllocation allocation() { - return this.allocation; - } - - /** - * API name: {@code rebalance} - */ - @Nullable - public final IndexRoutingRebalance rebalance() { - return this.rebalance; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.allocation != null) { - generator.writeKey("allocation"); - this.allocation.serialize(generator, mapper); - - } - if (this.rebalance != null) { - generator.writeKey("rebalance"); - this.rebalance.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexRouting}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private IndexRoutingAllocation allocation; - - @Nullable - private IndexRoutingRebalance rebalance; - - /** - * API name: {@code allocation} - */ - public final Builder allocation(@Nullable IndexRoutingAllocation value) { - this.allocation = value; - return this; - } - - /** - * API name: {@code allocation} - */ - public final Builder allocation( - Function> fn) { - return this.allocation(fn.apply(new IndexRoutingAllocation.Builder()).build()); - } - - /** - * API name: {@code rebalance} - */ - public final Builder rebalance(@Nullable IndexRoutingRebalance value) { - this.rebalance = value; - return this; - } - - /** - * API name: {@code rebalance} - */ - public final Builder rebalance( - Function> fn) { - return this.rebalance(fn.apply(new IndexRoutingRebalance.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexRouting}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexRouting build() { - _checkSingleUse(); - - return new IndexRouting(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexRouting} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - IndexRouting::setupIndexRoutingDeserializer); - - protected static void setupIndexRoutingDeserializer(ObjectDeserializer op) { - - op.add(Builder::allocation, IndexRoutingAllocation._DESERIALIZER, "allocation"); - op.add(Builder::rebalance, IndexRoutingRebalance._DESERIALIZER, "rebalance"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocation.java deleted file mode 100644 index b97033031..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocation.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexRoutingAllocation - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexRoutingAllocation implements JsonpSerializable { - @Nullable - private final IndexRoutingAllocationOptions enable; - - @Nullable - private final IndexRoutingAllocationInclude include; - - @Nullable - private final IndexRoutingAllocationInitialRecovery initialRecovery; - - @Nullable - private final IndexRoutingAllocationDisk disk; - - // --------------------------------------------------------------------------------------------- - - private IndexRoutingAllocation(Builder builder) { - - this.enable = builder.enable; - this.include = builder.include; - this.initialRecovery = builder.initialRecovery; - this.disk = builder.disk; - - } - - public static IndexRoutingAllocation of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code enable} - */ - @Nullable - public final IndexRoutingAllocationOptions enable() { - return this.enable; - } - - /** - * API name: {@code include} - */ - @Nullable - public final IndexRoutingAllocationInclude include() { - return this.include; - } - - /** - * API name: {@code initial_recovery} - */ - @Nullable - public final IndexRoutingAllocationInitialRecovery initialRecovery() { - return this.initialRecovery; - } - - /** - * API name: {@code disk} - */ - @Nullable - public final IndexRoutingAllocationDisk disk() { - return this.disk; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.enable != null) { - generator.writeKey("enable"); - this.enable.serialize(generator, mapper); - } - if (this.include != null) { - generator.writeKey("include"); - this.include.serialize(generator, mapper); - - } - if (this.initialRecovery != null) { - generator.writeKey("initial_recovery"); - this.initialRecovery.serialize(generator, mapper); - - } - if (this.disk != null) { - generator.writeKey("disk"); - this.disk.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexRoutingAllocation}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private IndexRoutingAllocationOptions enable; - - @Nullable - private IndexRoutingAllocationInclude include; - - @Nullable - private IndexRoutingAllocationInitialRecovery initialRecovery; - - @Nullable - private IndexRoutingAllocationDisk disk; - - /** - * API name: {@code enable} - */ - public final Builder enable(@Nullable IndexRoutingAllocationOptions value) { - this.enable = value; - return this; - } - - /** - * API name: {@code include} - */ - public final Builder include(@Nullable IndexRoutingAllocationInclude value) { - this.include = value; - return this; - } - - /** - * API name: {@code include} - */ - public final Builder include( - Function> fn) { - return this.include(fn.apply(new IndexRoutingAllocationInclude.Builder()).build()); - } - - /** - * API name: {@code initial_recovery} - */ - public final Builder initialRecovery(@Nullable IndexRoutingAllocationInitialRecovery value) { - this.initialRecovery = value; - return this; - } - - /** - * API name: {@code initial_recovery} - */ - public final Builder initialRecovery( - Function> fn) { - return this.initialRecovery(fn.apply(new IndexRoutingAllocationInitialRecovery.Builder()).build()); - } - - /** - * API name: {@code disk} - */ - public final Builder disk(@Nullable IndexRoutingAllocationDisk value) { - this.disk = value; - return this; - } - - /** - * API name: {@code disk} - */ - public final Builder disk( - Function> fn) { - return this.disk(fn.apply(new IndexRoutingAllocationDisk.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexRoutingAllocation}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexRoutingAllocation build() { - _checkSingleUse(); - - return new IndexRoutingAllocation(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexRoutingAllocation} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndexRoutingAllocation::setupIndexRoutingAllocationDeserializer); - - protected static void setupIndexRoutingAllocationDeserializer( - ObjectDeserializer op) { - - op.add(Builder::enable, IndexRoutingAllocationOptions._DESERIALIZER, "enable"); - op.add(Builder::include, IndexRoutingAllocationInclude._DESERIALIZER, "include"); - op.add(Builder::initialRecovery, IndexRoutingAllocationInitialRecovery._DESERIALIZER, "initial_recovery"); - op.add(Builder::disk, IndexRoutingAllocationDisk._DESERIALIZER, "disk"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationDisk.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationDisk.java deleted file mode 100644 index 5433c50a8..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationDisk.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexRoutingAllocationDisk - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexRoutingAllocationDisk implements JsonpSerializable { - @Nullable - private final Boolean thresholdEnabled; - - // --------------------------------------------------------------------------------------------- - - private IndexRoutingAllocationDisk(Builder builder) { - - this.thresholdEnabled = builder.thresholdEnabled; - - } - - public static IndexRoutingAllocationDisk of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code threshold_enabled} - */ - @Nullable - public final Boolean thresholdEnabled() { - return this.thresholdEnabled; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.thresholdEnabled != null) { - generator.writeKey("threshold_enabled"); - generator.write(this.thresholdEnabled); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexRoutingAllocationDisk}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Boolean thresholdEnabled; - - /** - * API name: {@code threshold_enabled} - */ - public final Builder thresholdEnabled(@Nullable Boolean value) { - this.thresholdEnabled = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexRoutingAllocationDisk}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexRoutingAllocationDisk build() { - _checkSingleUse(); - - return new IndexRoutingAllocationDisk(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexRoutingAllocationDisk} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndexRoutingAllocationDisk::setupIndexRoutingAllocationDiskDeserializer); - - protected static void setupIndexRoutingAllocationDiskDeserializer( - ObjectDeserializer op) { - - op.add(Builder::thresholdEnabled, JsonpDeserializer.booleanDeserializer(), "threshold_enabled"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationInclude.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationInclude.java deleted file mode 100644 index aaec90173..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationInclude.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexRoutingAllocationInclude - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexRoutingAllocationInclude implements JsonpSerializable { - @Nullable - private final String tierPreference; - - @Nullable - private final String id; - - // --------------------------------------------------------------------------------------------- - - private IndexRoutingAllocationInclude(Builder builder) { - - this.tierPreference = builder.tierPreference; - this.id = builder.id; - - } - - public static IndexRoutingAllocationInclude of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code _tier_preference} - */ - @Nullable - public final String tierPreference() { - return this.tierPreference; - } - - /** - * API name: {@code _id} - */ - @Nullable - public final String id() { - return this.id; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.tierPreference != null) { - generator.writeKey("_tier_preference"); - generator.write(this.tierPreference); - - } - if (this.id != null) { - generator.writeKey("_id"); - generator.write(this.id); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexRoutingAllocationInclude}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private String tierPreference; - - @Nullable - private String id; - - /** - * API name: {@code _tier_preference} - */ - public final Builder tierPreference(@Nullable String value) { - this.tierPreference = value; - return this; - } - - /** - * API name: {@code _id} - */ - public final Builder id(@Nullable String value) { - this.id = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexRoutingAllocationInclude}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexRoutingAllocationInclude build() { - _checkSingleUse(); - - return new IndexRoutingAllocationInclude(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexRoutingAllocationInclude} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndexRoutingAllocationInclude::setupIndexRoutingAllocationIncludeDeserializer); - - protected static void setupIndexRoutingAllocationIncludeDeserializer( - ObjectDeserializer op) { - - op.add(Builder::tierPreference, JsonpDeserializer.stringDeserializer(), "_tier_preference"); - op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "_id"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationInitialRecovery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationInitialRecovery.java deleted file mode 100644 index be6c63829..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationInitialRecovery.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexRoutingAllocationInitialRecovery - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexRoutingAllocationInitialRecovery implements JsonpSerializable { - @Nullable - private final String id; - - // --------------------------------------------------------------------------------------------- - - private IndexRoutingAllocationInitialRecovery(Builder builder) { - - this.id = builder.id; - - } - - public static IndexRoutingAllocationInitialRecovery of( - Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code _id} - */ - @Nullable - public final String id() { - return this.id; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.id != null) { - generator.writeKey("_id"); - generator.write(this.id); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexRoutingAllocationInitialRecovery}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private String id; - - /** - * API name: {@code _id} - */ - public final Builder id(@Nullable String value) { - this.id = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexRoutingAllocationInitialRecovery}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexRoutingAllocationInitialRecovery build() { - _checkSingleUse(); - - return new IndexRoutingAllocationInitialRecovery(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexRoutingAllocationInitialRecovery} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, - IndexRoutingAllocationInitialRecovery::setupIndexRoutingAllocationInitialRecoveryDeserializer); - - protected static void setupIndexRoutingAllocationInitialRecoveryDeserializer( - ObjectDeserializer op) { - - op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "_id"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationOptions.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationOptions.java deleted file mode 100644 index e52caeb82..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationOptions.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum IndexRoutingAllocationOptions implements JsonEnum { - All("all"), - - Primaries("primaries"), - - NewPrimaries("new_primaries"), - - None("none"), - - ; - - private final String jsonValue; - - IndexRoutingAllocationOptions(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - IndexRoutingAllocationOptions.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingRebalance.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingRebalance.java deleted file mode 100644 index 437f95ac1..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingRebalance.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexRoutingRebalance - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexRoutingRebalance implements JsonpSerializable { - private final IndexRoutingRebalanceOptions enable; - - // --------------------------------------------------------------------------------------------- - - private IndexRoutingRebalance(Builder builder) { - - this.enable = ApiTypeHelper.requireNonNull(builder.enable, this, "enable"); - - } - - public static IndexRoutingRebalance of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code enable} - */ - public final IndexRoutingRebalanceOptions enable() { - return this.enable; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("enable"); - this.enable.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexRoutingRebalance}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private IndexRoutingRebalanceOptions enable; - - /** - * Required - API name: {@code enable} - */ - public final Builder enable(IndexRoutingRebalanceOptions value) { - this.enable = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexRoutingRebalance}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexRoutingRebalance build() { - _checkSingleUse(); - - return new IndexRoutingRebalance(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexRoutingRebalance} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndexRoutingRebalance::setupIndexRoutingRebalanceDeserializer); - - protected static void setupIndexRoutingRebalanceDeserializer(ObjectDeserializer op) { - - op.add(Builder::enable, IndexRoutingRebalanceOptions._DESERIALIZER, "enable"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingRebalanceOptions.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingRebalanceOptions.java deleted file mode 100644 index 8563e0f9e..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingRebalanceOptions.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum IndexRoutingRebalanceOptions implements JsonEnum { - All("all"), - - Primaries("primaries"), - - Replicas("replicas"), - - None("none"), - - ; - - private final String jsonValue; - - IndexRoutingRebalanceOptions(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - IndexRoutingRebalanceOptions.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSegmentSort.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSegmentSort.java deleted file mode 100644 index 882d57436..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSegmentSort.java +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexSegmentSort - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexSegmentSort implements JsonpSerializable { - private final List field; - - private final List order; - - private final List mode; - - private final List missing; - - // --------------------------------------------------------------------------------------------- - - private IndexSegmentSort(Builder builder) { - - this.field = ApiTypeHelper.unmodifiable(builder.field); - this.order = ApiTypeHelper.unmodifiable(builder.order); - this.mode = ApiTypeHelper.unmodifiable(builder.mode); - this.missing = ApiTypeHelper.unmodifiable(builder.missing); - - } - - public static IndexSegmentSort of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code field} - */ - public final List field() { - return this.field; - } - - /** - * API name: {@code order} - */ - public final List order() { - return this.order; - } - - /** - * API name: {@code mode} - */ - public final List mode() { - return this.mode; - } - - /** - * API name: {@code missing} - */ - public final List missing() { - return this.missing; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.field)) { - generator.writeKey("field"); - generator.writeStartArray(); - for (String item0 : this.field) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.order)) { - generator.writeKey("order"); - generator.writeStartArray(); - for (SegmentSortOrder item0 : this.order) { - item0.serialize(generator, mapper); - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.mode)) { - generator.writeKey("mode"); - generator.writeStartArray(); - for (SegmentSortMode item0 : this.mode) { - item0.serialize(generator, mapper); - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.missing)) { - generator.writeKey("missing"); - generator.writeStartArray(); - for (SegmentSortMissing item0 : this.missing) { - item0.serialize(generator, mapper); - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexSegmentSort}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private List field; - - @Nullable - private List order; - - @Nullable - private List mode; - - @Nullable - private List missing; - - /** - * API name: {@code field} - *

- * Adds all elements of list to field. - */ - public final Builder field(List list) { - this.field = _listAddAll(this.field, list); - return this; - } - - /** - * API name: {@code field} - *

- * Adds one or more values to field. - */ - public final Builder field(String value, String... values) { - this.field = _listAdd(this.field, value, values); - return this; - } - - /** - * API name: {@code order} - *

- * Adds all elements of list to order. - */ - public final Builder order(List list) { - this.order = _listAddAll(this.order, list); - return this; - } - - /** - * API name: {@code order} - *

- * Adds one or more values to order. - */ - public final Builder order(SegmentSortOrder value, SegmentSortOrder... values) { - this.order = _listAdd(this.order, value, values); - return this; - } - - /** - * API name: {@code mode} - *

- * Adds all elements of list to mode. - */ - public final Builder mode(List list) { - this.mode = _listAddAll(this.mode, list); - return this; - } - - /** - * API name: {@code mode} - *

- * Adds one or more values to mode. - */ - public final Builder mode(SegmentSortMode value, SegmentSortMode... values) { - this.mode = _listAdd(this.mode, value, values); - return this; - } - - /** - * API name: {@code missing} - *

- * Adds all elements of list to missing. - */ - public final Builder missing(List list) { - this.missing = _listAddAll(this.missing, list); - return this; - } - - /** - * API name: {@code missing} - *

- * Adds one or more values to missing. - */ - public final Builder missing(SegmentSortMissing value, SegmentSortMissing... values) { - this.missing = _listAdd(this.missing, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexSegmentSort}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexSegmentSort build() { - _checkSingleUse(); - - return new IndexSegmentSort(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexSegmentSort} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - IndexSegmentSort::setupIndexSegmentSortDeserializer); - - protected static void setupIndexSegmentSortDeserializer(ObjectDeserializer op) { - - op.add(Builder::field, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "field"); - op.add(Builder::order, JsonpDeserializer.arrayDeserializer(SegmentSortOrder._DESERIALIZER), "order"); - op.add(Builder::mode, JsonpDeserializer.arrayDeserializer(SegmentSortMode._DESERIALIZER), "mode"); - op.add(Builder::missing, JsonpDeserializer.arrayDeserializer(SegmentSortMissing._DESERIALIZER), "missing"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingBlocks.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingBlocks.java deleted file mode 100644 index 93fbc4b1a..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingBlocks.java +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexSettingBlocks - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexSettingBlocks implements JsonpSerializable { - @Nullable - private final Boolean readOnly; - - @Nullable - private final Boolean readOnlyAllowDelete; - - @Nullable - private final Boolean read; - - @Nullable - private final Boolean write; - - @Nullable - private final Boolean metadata; - - // --------------------------------------------------------------------------------------------- - - private IndexSettingBlocks(Builder builder) { - - this.readOnly = builder.readOnly; - this.readOnlyAllowDelete = builder.readOnlyAllowDelete; - this.read = builder.read; - this.write = builder.write; - this.metadata = builder.metadata; - - } - - public static IndexSettingBlocks of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code read_only} - */ - @Nullable - public final Boolean readOnly() { - return this.readOnly; - } - - /** - * API name: {@code read_only_allow_delete} - */ - @Nullable - public final Boolean readOnlyAllowDelete() { - return this.readOnlyAllowDelete; - } - - /** - * API name: {@code read} - */ - @Nullable - public final Boolean read() { - return this.read; - } - - /** - * API name: {@code write} - */ - @Nullable - public final Boolean write() { - return this.write; - } - - /** - * API name: {@code metadata} - */ - @Nullable - public final Boolean metadata() { - return this.metadata; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.readOnly != null) { - generator.writeKey("read_only"); - generator.write(this.readOnly); - - } - if (this.readOnlyAllowDelete != null) { - generator.writeKey("read_only_allow_delete"); - generator.write(this.readOnlyAllowDelete); - - } - if (this.read != null) { - generator.writeKey("read"); - generator.write(this.read); - - } - if (this.write != null) { - generator.writeKey("write"); - generator.write(this.write); - - } - if (this.metadata != null) { - generator.writeKey("metadata"); - generator.write(this.metadata); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexSettingBlocks}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Boolean readOnly; - - @Nullable - private Boolean readOnlyAllowDelete; - - @Nullable - private Boolean read; - - @Nullable - private Boolean write; - - @Nullable - private Boolean metadata; - - /** - * API name: {@code read_only} - */ - public final Builder readOnly(@Nullable Boolean value) { - this.readOnly = value; - return this; - } - - /** - * API name: {@code read_only_allow_delete} - */ - public final Builder readOnlyAllowDelete(@Nullable Boolean value) { - this.readOnlyAllowDelete = value; - return this; - } - - /** - * API name: {@code read} - */ - public final Builder read(@Nullable Boolean value) { - this.read = value; - return this; - } - - /** - * API name: {@code write} - */ - public final Builder write(@Nullable Boolean value) { - this.write = value; - return this; - } - - /** - * API name: {@code metadata} - */ - public final Builder metadata(@Nullable Boolean value) { - this.metadata = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexSettingBlocks}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexSettingBlocks build() { - _checkSingleUse(); - - return new IndexSettingBlocks(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexSettingBlocks} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndexSettingBlocks::setupIndexSettingBlocksDeserializer); - - protected static void setupIndexSettingBlocksDeserializer(ObjectDeserializer op) { - - op.add(Builder::readOnly, JsonpDeserializer.booleanDeserializer(), "read_only"); - op.add(Builder::readOnlyAllowDelete, JsonpDeserializer.booleanDeserializer(), "read_only_allow_delete"); - op.add(Builder::read, JsonpDeserializer.booleanDeserializer(), "read"); - op.add(Builder::write, JsonpDeserializer.booleanDeserializer(), "write"); - op.add(Builder::metadata, JsonpDeserializer.booleanDeserializer(), "metadata"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettings.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettings.java deleted file mode 100644 index 63fe19942..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettings.java +++ /dev/null @@ -1,2068 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.DateTime; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Integer; -import java.lang.Long; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexSettings - -/** - * - * @see Documentation - * on elastic.co - * @see API - * specification - */ -@JsonpDeserializable -public class IndexSettings implements JsonpSerializable { - private final Map otherSettings; - - @Nullable - private final IndexSettings index; - - @Nullable - private final String mode; - - private final List routingPath; - - @Nullable - private final SoftDeletes softDeletes; - - @Nullable - private final IndexSegmentSort sort; - - @Nullable - private final String numberOfShards; - - @Nullable - private final String numberOfReplicas; - - @Nullable - private final Integer numberOfRoutingShards; - - @Nullable - private final IndexCheckOnStartup checkOnStartup; - - @Nullable - private final String codec; - - @Nullable - private final Integer routingPartitionSize; - - @Nullable - private final Boolean loadFixedBitsetFiltersEagerly; - - @Nullable - private final Boolean hidden; - - @Nullable - private final String autoExpandReplicas; - - @Nullable - private final Merge merge; - - @Nullable - private final SettingsSearch search; - - @Nullable - private final Time refreshInterval; - - @Nullable - private final Integer maxResultWindow; - - @Nullable - private final Integer maxInnerResultWindow; - - @Nullable - private final Integer maxRescoreWindow; - - @Nullable - private final Integer maxDocvalueFieldsSearch; - - @Nullable - private final Integer maxScriptFields; - - @Nullable - private final Integer maxNgramDiff; - - @Nullable - private final Integer maxShingleDiff; - - @Nullable - private final IndexSettingBlocks blocks; - - @Nullable - private final Integer maxRefreshListeners; - - @Nullable - private final SettingsAnalyze analyze; - - @Nullable - private final SettingsHighlight highlight; - - @Nullable - private final Integer maxTermsCount; - - @Nullable - private final Integer maxRegexLength; - - @Nullable - private final IndexRouting routing; - - @Nullable - private final Time gcDeletes; - - @Nullable - private final String defaultPipeline; - - @Nullable - private final String finalPipeline; - - @Nullable - private final IndexSettingsLifecycle lifecycle; - - @Nullable - private final String providedName; - - @Nullable - private final Long creationDate; - - @Nullable - private final DateTime creationDateString; - - @Nullable - private final String uuid; - - @Nullable - private final IndexVersioning version; - - @Nullable - private final Boolean verifiedBeforeClose; - - @Nullable - private final String format; - - @Nullable - private final Integer maxSlicesPerScroll; - - @Nullable - private final Translog translog; - - @Nullable - private final SettingsQueryString queryString; - - @Nullable - private final String priority; - - @Nullable - private final Integer topMetricsMaxSize; - - @Nullable - private final IndexSettingsAnalysis analysis; - - @Nullable - private final IndexSettings settings; - - @Nullable - private final IndexSettingsTimeSeries timeSeries; - - @Nullable - private final Queries queries; - - private final Map similarity; - - @Nullable - private final MappingLimitSettings mapping; - - @Nullable - private final IndexingSlowlogSettings indexingSlowlog; - - @Nullable - private final IndexingPressure indexingPressure; - - @Nullable - private final Storage store; - - // --------------------------------------------------------------------------------------------- - - private IndexSettings(Builder builder) { - - this.otherSettings = ApiTypeHelper.unmodifiable(builder.otherSettings); - - this.index = builder.index; - this.mode = builder.mode; - this.routingPath = ApiTypeHelper.unmodifiable(builder.routingPath); - this.softDeletes = builder.softDeletes; - this.sort = builder.sort; - this.numberOfShards = builder.numberOfShards; - this.numberOfReplicas = builder.numberOfReplicas; - this.numberOfRoutingShards = builder.numberOfRoutingShards; - this.checkOnStartup = builder.checkOnStartup; - this.codec = builder.codec; - this.routingPartitionSize = builder.routingPartitionSize; - this.loadFixedBitsetFiltersEagerly = builder.loadFixedBitsetFiltersEagerly; - this.hidden = builder.hidden; - this.autoExpandReplicas = builder.autoExpandReplicas; - this.merge = builder.merge; - this.search = builder.search; - this.refreshInterval = builder.refreshInterval; - this.maxResultWindow = builder.maxResultWindow; - this.maxInnerResultWindow = builder.maxInnerResultWindow; - this.maxRescoreWindow = builder.maxRescoreWindow; - this.maxDocvalueFieldsSearch = builder.maxDocvalueFieldsSearch; - this.maxScriptFields = builder.maxScriptFields; - this.maxNgramDiff = builder.maxNgramDiff; - this.maxShingleDiff = builder.maxShingleDiff; - this.blocks = builder.blocks; - this.maxRefreshListeners = builder.maxRefreshListeners; - this.analyze = builder.analyze; - this.highlight = builder.highlight; - this.maxTermsCount = builder.maxTermsCount; - this.maxRegexLength = builder.maxRegexLength; - this.routing = builder.routing; - this.gcDeletes = builder.gcDeletes; - this.defaultPipeline = builder.defaultPipeline; - this.finalPipeline = builder.finalPipeline; - this.lifecycle = builder.lifecycle; - this.providedName = builder.providedName; - this.creationDate = builder.creationDate; - this.creationDateString = builder.creationDateString; - this.uuid = builder.uuid; - this.version = builder.version; - this.verifiedBeforeClose = builder.verifiedBeforeClose; - this.format = builder.format; - this.maxSlicesPerScroll = builder.maxSlicesPerScroll; - this.translog = builder.translog; - this.queryString = builder.queryString; - this.priority = builder.priority; - this.topMetricsMaxSize = builder.topMetricsMaxSize; - this.analysis = builder.analysis; - this.settings = builder.settings; - this.timeSeries = builder.timeSeries; - this.queries = builder.queries; - this.similarity = ApiTypeHelper.unmodifiable(builder.similarity); - this.mapping = builder.mapping; - this.indexingSlowlog = builder.indexingSlowlog; - this.indexingPressure = builder.indexingPressure; - this.store = builder.store; - - } - - public static IndexSettings of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Additional settings not covered in this type. Unless these settings are - * defined by a plugin, please open an issue on the Elasticsearch API - * specification so that they can be added in a future release. - */ - public final Map otherSettings() { - return this.otherSettings; - } - - /** - * API name: {@code index} - */ - @Nullable - public final IndexSettings index() { - return this.index; - } - - /** - * API name: {@code mode} - */ - @Nullable - public final String mode() { - return this.mode; - } - - /** - * API name: {@code routing_path} - */ - public final List routingPath() { - return this.routingPath; - } - - /** - * API name: {@code soft_deletes} - */ - @Nullable - public final SoftDeletes softDeletes() { - return this.softDeletes; - } - - /** - * API name: {@code sort} - */ - @Nullable - public final IndexSegmentSort sort() { - return this.sort; - } - - /** - * API name: {@code number_of_shards} - */ - @Nullable - public final String numberOfShards() { - return this.numberOfShards; - } - - /** - * API name: {@code number_of_replicas} - */ - @Nullable - public final String numberOfReplicas() { - return this.numberOfReplicas; - } - - /** - * API name: {@code number_of_routing_shards} - */ - @Nullable - public final Integer numberOfRoutingShards() { - return this.numberOfRoutingShards; - } - - /** - * API name: {@code check_on_startup} - */ - @Nullable - public final IndexCheckOnStartup checkOnStartup() { - return this.checkOnStartup; - } - - /** - * API name: {@code codec} - */ - @Nullable - public final String codec() { - return this.codec; - } - - /** - * API name: {@code routing_partition_size} - */ - @Nullable - public final Integer routingPartitionSize() { - return this.routingPartitionSize; - } - - /** - * API name: {@code load_fixed_bitset_filters_eagerly} - */ - @Nullable - public final Boolean loadFixedBitsetFiltersEagerly() { - return this.loadFixedBitsetFiltersEagerly; - } - - /** - * API name: {@code hidden} - */ - @Nullable - public final Boolean hidden() { - return this.hidden; - } - - /** - * API name: {@code auto_expand_replicas} - */ - @Nullable - public final String autoExpandReplicas() { - return this.autoExpandReplicas; - } - - /** - * API name: {@code merge} - */ - @Nullable - public final Merge merge() { - return this.merge; - } - - /** - * API name: {@code search} - */ - @Nullable - public final SettingsSearch search() { - return this.search; - } - - /** - * API name: {@code refresh_interval} - */ - @Nullable - public final Time refreshInterval() { - return this.refreshInterval; - } - - /** - * API name: {@code max_result_window} - */ - @Nullable - public final Integer maxResultWindow() { - return this.maxResultWindow; - } - - /** - * API name: {@code max_inner_result_window} - */ - @Nullable - public final Integer maxInnerResultWindow() { - return this.maxInnerResultWindow; - } - - /** - * API name: {@code max_rescore_window} - */ - @Nullable - public final Integer maxRescoreWindow() { - return this.maxRescoreWindow; - } - - /** - * API name: {@code max_docvalue_fields_search} - */ - @Nullable - public final Integer maxDocvalueFieldsSearch() { - return this.maxDocvalueFieldsSearch; - } - - /** - * API name: {@code max_script_fields} - */ - @Nullable - public final Integer maxScriptFields() { - return this.maxScriptFields; - } - - /** - * API name: {@code max_ngram_diff} - */ - @Nullable - public final Integer maxNgramDiff() { - return this.maxNgramDiff; - } - - /** - * API name: {@code max_shingle_diff} - */ - @Nullable - public final Integer maxShingleDiff() { - return this.maxShingleDiff; - } - - /** - * API name: {@code blocks} - */ - @Nullable - public final IndexSettingBlocks blocks() { - return this.blocks; - } - - /** - * API name: {@code max_refresh_listeners} - */ - @Nullable - public final Integer maxRefreshListeners() { - return this.maxRefreshListeners; - } - - /** - * Settings to define analyzers, tokenizers, token filters and character - * filters. - *

- * API name: {@code analyze} - */ - @Nullable - public final SettingsAnalyze analyze() { - return this.analyze; - } - - /** - * API name: {@code highlight} - */ - @Nullable - public final SettingsHighlight highlight() { - return this.highlight; - } - - /** - * API name: {@code max_terms_count} - */ - @Nullable - public final Integer maxTermsCount() { - return this.maxTermsCount; - } - - /** - * API name: {@code max_regex_length} - */ - @Nullable - public final Integer maxRegexLength() { - return this.maxRegexLength; - } - - /** - * API name: {@code routing} - */ - @Nullable - public final IndexRouting routing() { - return this.routing; - } - - /** - * API name: {@code gc_deletes} - */ - @Nullable - public final Time gcDeletes() { - return this.gcDeletes; - } - - /** - * API name: {@code default_pipeline} - */ - @Nullable - public final String defaultPipeline() { - return this.defaultPipeline; - } - - /** - * API name: {@code final_pipeline} - */ - @Nullable - public final String finalPipeline() { - return this.finalPipeline; - } - - /** - * API name: {@code lifecycle} - */ - @Nullable - public final IndexSettingsLifecycle lifecycle() { - return this.lifecycle; - } - - /** - * API name: {@code provided_name} - */ - @Nullable - public final String providedName() { - return this.providedName; - } - - /** - * API name: {@code creation_date} - */ - @Nullable - public final Long creationDate() { - return this.creationDate; - } - - /** - * API name: {@code creation_date_string} - */ - @Nullable - public final DateTime creationDateString() { - return this.creationDateString; - } - - /** - * API name: {@code uuid} - */ - @Nullable - public final String uuid() { - return this.uuid; - } - - /** - * API name: {@code version} - */ - @Nullable - public final IndexVersioning version() { - return this.version; - } - - /** - * API name: {@code verified_before_close} - */ - @Nullable - public final Boolean verifiedBeforeClose() { - return this.verifiedBeforeClose; - } - - /** - * API name: {@code format} - */ - @Nullable - public final String format() { - return this.format; - } - - /** - * API name: {@code max_slices_per_scroll} - */ - @Nullable - public final Integer maxSlicesPerScroll() { - return this.maxSlicesPerScroll; - } - - /** - * API name: {@code translog} - */ - @Nullable - public final Translog translog() { - return this.translog; - } - - /** - * API name: {@code query_string} - */ - @Nullable - public final SettingsQueryString queryString() { - return this.queryString; - } - - /** - * API name: {@code priority} - */ - @Nullable - public final String priority() { - return this.priority; - } - - /** - * API name: {@code top_metrics_max_size} - */ - @Nullable - public final Integer topMetricsMaxSize() { - return this.topMetricsMaxSize; - } - - /** - * API name: {@code analysis} - */ - @Nullable - public final IndexSettingsAnalysis analysis() { - return this.analysis; - } - - /** - * API name: {@code settings} - */ - @Nullable - public final IndexSettings settings() { - return this.settings; - } - - /** - * API name: {@code time_series} - */ - @Nullable - public final IndexSettingsTimeSeries timeSeries() { - return this.timeSeries; - } - - /** - * API name: {@code queries} - */ - @Nullable - public final Queries queries() { - return this.queries; - } - - /** - * Configure custom similarity settings to customize how search results are - * scored. - *

- * API name: {@code similarity} - */ - public final Map similarity() { - return this.similarity; - } - - /** - * Enable or disable dynamic mapping for an index. - *

- * API name: {@code mapping} - */ - @Nullable - public final MappingLimitSettings mapping() { - return this.mapping; - } - - /** - * API name: {@code indexing.slowlog} - */ - @Nullable - public final IndexingSlowlogSettings indexingSlowlog() { - return this.indexingSlowlog; - } - - /** - * Configure indexing back pressure limits. - *

- * API name: {@code indexing_pressure} - */ - @Nullable - public final IndexingPressure indexingPressure() { - return this.indexingPressure; - } - - /** - * The store module allows you to control how index data is stored and accessed - * on disk. - *

- * API name: {@code store} - */ - @Nullable - public final Storage store() { - return this.store; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - for (Map.Entry item0 : this.otherSettings.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - - if (this.index != null) { - generator.writeKey("index"); - this.index.serialize(generator, mapper); - - } - if (this.mode != null) { - generator.writeKey("mode"); - generator.write(this.mode); - - } - if (ApiTypeHelper.isDefined(this.routingPath)) { - generator.writeKey("routing_path"); - generator.writeStartArray(); - for (String item0 : this.routingPath) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (this.softDeletes != null) { - generator.writeKey("soft_deletes"); - this.softDeletes.serialize(generator, mapper); - - } - if (this.sort != null) { - generator.writeKey("sort"); - this.sort.serialize(generator, mapper); - - } - if (this.numberOfShards != null) { - generator.writeKey("number_of_shards"); - generator.write(this.numberOfShards); - - } - if (this.numberOfReplicas != null) { - generator.writeKey("number_of_replicas"); - generator.write(this.numberOfReplicas); - - } - if (this.numberOfRoutingShards != null) { - generator.writeKey("number_of_routing_shards"); - generator.write(this.numberOfRoutingShards); - - } - if (this.checkOnStartup != null) { - generator.writeKey("check_on_startup"); - this.checkOnStartup.serialize(generator, mapper); - } - if (this.codec != null) { - generator.writeKey("codec"); - generator.write(this.codec); - - } - if (this.routingPartitionSize != null) { - generator.writeKey("routing_partition_size"); - generator.write(this.routingPartitionSize); - - } - if (this.loadFixedBitsetFiltersEagerly != null) { - generator.writeKey("load_fixed_bitset_filters_eagerly"); - generator.write(this.loadFixedBitsetFiltersEagerly); - - } - if (this.hidden != null) { - generator.writeKey("hidden"); - generator.write(this.hidden); - - } - if (this.autoExpandReplicas != null) { - generator.writeKey("auto_expand_replicas"); - generator.write(this.autoExpandReplicas); - - } - if (this.merge != null) { - generator.writeKey("merge"); - this.merge.serialize(generator, mapper); - - } - if (this.search != null) { - generator.writeKey("search"); - this.search.serialize(generator, mapper); - - } - if (this.refreshInterval != null) { - generator.writeKey("refresh_interval"); - this.refreshInterval.serialize(generator, mapper); - - } - if (this.maxResultWindow != null) { - generator.writeKey("max_result_window"); - generator.write(this.maxResultWindow); - - } - if (this.maxInnerResultWindow != null) { - generator.writeKey("max_inner_result_window"); - generator.write(this.maxInnerResultWindow); - - } - if (this.maxRescoreWindow != null) { - generator.writeKey("max_rescore_window"); - generator.write(this.maxRescoreWindow); - - } - if (this.maxDocvalueFieldsSearch != null) { - generator.writeKey("max_docvalue_fields_search"); - generator.write(this.maxDocvalueFieldsSearch); - - } - if (this.maxScriptFields != null) { - generator.writeKey("max_script_fields"); - generator.write(this.maxScriptFields); - - } - if (this.maxNgramDiff != null) { - generator.writeKey("max_ngram_diff"); - generator.write(this.maxNgramDiff); - - } - if (this.maxShingleDiff != null) { - generator.writeKey("max_shingle_diff"); - generator.write(this.maxShingleDiff); - - } - if (this.blocks != null) { - generator.writeKey("blocks"); - this.blocks.serialize(generator, mapper); - - } - if (this.maxRefreshListeners != null) { - generator.writeKey("max_refresh_listeners"); - generator.write(this.maxRefreshListeners); - - } - if (this.analyze != null) { - generator.writeKey("analyze"); - this.analyze.serialize(generator, mapper); - - } - if (this.highlight != null) { - generator.writeKey("highlight"); - this.highlight.serialize(generator, mapper); - - } - if (this.maxTermsCount != null) { - generator.writeKey("max_terms_count"); - generator.write(this.maxTermsCount); - - } - if (this.maxRegexLength != null) { - generator.writeKey("max_regex_length"); - generator.write(this.maxRegexLength); - - } - if (this.routing != null) { - generator.writeKey("routing"); - this.routing.serialize(generator, mapper); - - } - if (this.gcDeletes != null) { - generator.writeKey("gc_deletes"); - this.gcDeletes.serialize(generator, mapper); - - } - if (this.defaultPipeline != null) { - generator.writeKey("default_pipeline"); - generator.write(this.defaultPipeline); - - } - if (this.finalPipeline != null) { - generator.writeKey("final_pipeline"); - generator.write(this.finalPipeline); - - } - if (this.lifecycle != null) { - generator.writeKey("lifecycle"); - this.lifecycle.serialize(generator, mapper); - - } - if (this.providedName != null) { - generator.writeKey("provided_name"); - generator.write(this.providedName); - - } - if (this.creationDate != null) { - generator.writeKey("creation_date"); - generator.write(this.creationDate); - - } - if (this.creationDateString != null) { - generator.writeKey("creation_date_string"); - this.creationDateString.serialize(generator, mapper); - } - if (this.uuid != null) { - generator.writeKey("uuid"); - generator.write(this.uuid); - - } - if (this.version != null) { - generator.writeKey("version"); - this.version.serialize(generator, mapper); - - } - if (this.verifiedBeforeClose != null) { - generator.writeKey("verified_before_close"); - generator.write(this.verifiedBeforeClose); - - } - if (this.format != null) { - generator.writeKey("format"); - generator.write(this.format); - - } - if (this.maxSlicesPerScroll != null) { - generator.writeKey("max_slices_per_scroll"); - generator.write(this.maxSlicesPerScroll); - - } - if (this.translog != null) { - generator.writeKey("translog"); - this.translog.serialize(generator, mapper); - - } - if (this.queryString != null) { - generator.writeKey("query_string"); - this.queryString.serialize(generator, mapper); - - } - if (this.priority != null) { - generator.writeKey("priority"); - generator.write(this.priority); - - } - if (this.topMetricsMaxSize != null) { - generator.writeKey("top_metrics_max_size"); - generator.write(this.topMetricsMaxSize); - - } - if (this.analysis != null) { - generator.writeKey("analysis"); - this.analysis.serialize(generator, mapper); - - } - if (this.settings != null) { - generator.writeKey("settings"); - this.settings.serialize(generator, mapper); - - } - if (this.timeSeries != null) { - generator.writeKey("time_series"); - this.timeSeries.serialize(generator, mapper); - - } - if (this.queries != null) { - generator.writeKey("queries"); - this.queries.serialize(generator, mapper); - - } - if (ApiTypeHelper.isDefined(this.similarity)) { - generator.writeKey("similarity"); - generator.writeStartObject(); - for (Map.Entry item0 : this.similarity.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.mapping != null) { - generator.writeKey("mapping"); - this.mapping.serialize(generator, mapper); - - } - if (this.indexingSlowlog != null) { - generator.writeKey("indexing.slowlog"); - this.indexingSlowlog.serialize(generator, mapper); - - } - if (this.indexingPressure != null) { - generator.writeKey("indexing_pressure"); - this.indexingPressure.serialize(generator, mapper); - - } - if (this.store != null) { - generator.writeKey("store"); - this.store.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexSettings}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private Map otherSettings = new HashMap<>(); - - /** - * Additional settings not covered in this type. Unless these settings are - * defined by a plugin, please open an issue on the Elasticsearch API - * specification so that they can be added in a future release. - *

- * Adds all entries of map to otherSettings. - */ - public final Builder otherSettings(Map map) { - this.otherSettings = _mapPutAll(this.otherSettings, map); - return this; - } - - /** - * Additional settings not covered in this type. Unless these settings are - * defined by a plugin, please open an issue on the Elasticsearch API - * specification so that they can be added in a future release. - *

- * Adds an entry to otherSettings. - */ - public final Builder otherSettings(String key, JsonData value) { - this.otherSettings = _mapPut(this.otherSettings, key, value); - return this; - } - - @Nullable - private IndexSettings index; - - @Nullable - private String mode; - - @Nullable - private List routingPath; - - @Nullable - private SoftDeletes softDeletes; - - @Nullable - private IndexSegmentSort sort; - - @Nullable - private String numberOfShards; - - @Nullable - private String numberOfReplicas; - - @Nullable - private Integer numberOfRoutingShards; - - @Nullable - private IndexCheckOnStartup checkOnStartup; - - @Nullable - private String codec; - - @Nullable - private Integer routingPartitionSize; - - @Nullable - private Boolean loadFixedBitsetFiltersEagerly; - - @Nullable - private Boolean hidden; - - @Nullable - private String autoExpandReplicas; - - @Nullable - private Merge merge; - - @Nullable - private SettingsSearch search; - - @Nullable - private Time refreshInterval; - - @Nullable - private Integer maxResultWindow; - - @Nullable - private Integer maxInnerResultWindow; - - @Nullable - private Integer maxRescoreWindow; - - @Nullable - private Integer maxDocvalueFieldsSearch; - - @Nullable - private Integer maxScriptFields; - - @Nullable - private Integer maxNgramDiff; - - @Nullable - private Integer maxShingleDiff; - - @Nullable - private IndexSettingBlocks blocks; - - @Nullable - private Integer maxRefreshListeners; - - @Nullable - private SettingsAnalyze analyze; - - @Nullable - private SettingsHighlight highlight; - - @Nullable - private Integer maxTermsCount; - - @Nullable - private Integer maxRegexLength; - - @Nullable - private IndexRouting routing; - - @Nullable - private Time gcDeletes; - - @Nullable - private String defaultPipeline; - - @Nullable - private String finalPipeline; - - @Nullable - private IndexSettingsLifecycle lifecycle; - - @Nullable - private String providedName; - - @Nullable - private Long creationDate; - - @Nullable - private DateTime creationDateString; - - @Nullable - private String uuid; - - @Nullable - private IndexVersioning version; - - @Nullable - private Boolean verifiedBeforeClose; - - @Nullable - private String format; - - @Nullable - private Integer maxSlicesPerScroll; - - @Nullable - private Translog translog; - - @Nullable - private SettingsQueryString queryString; - - @Nullable - private String priority; - - @Nullable - private Integer topMetricsMaxSize; - - @Nullable - private IndexSettingsAnalysis analysis; - - @Nullable - private IndexSettings settings; - - @Nullable - private IndexSettingsTimeSeries timeSeries; - - @Nullable - private Queries queries; - - @Nullable - private Map similarity; - - @Nullable - private MappingLimitSettings mapping; - - @Nullable - private IndexingSlowlogSettings indexingSlowlog; - - @Nullable - private IndexingPressure indexingPressure; - - @Nullable - private Storage store; - - /** - * API name: {@code index} - */ - public final Builder index(@Nullable IndexSettings value) { - this.index = value; - return this; - } - - /** - * API name: {@code index} - */ - public final Builder index(Function> fn) { - return this.index(fn.apply(new IndexSettings.Builder()).build()); - } - - /** - * API name: {@code mode} - */ - public final Builder mode(@Nullable String value) { - this.mode = value; - return this; - } - - /** - * API name: {@code routing_path} - *

- * Adds all elements of list to routingPath. - */ - public final Builder routingPath(List list) { - this.routingPath = _listAddAll(this.routingPath, list); - return this; - } - - /** - * API name: {@code routing_path} - *

- * Adds one or more values to routingPath. - */ - public final Builder routingPath(String value, String... values) { - this.routingPath = _listAdd(this.routingPath, value, values); - return this; - } - - /** - * API name: {@code soft_deletes} - */ - public final Builder softDeletes(@Nullable SoftDeletes value) { - this.softDeletes = value; - return this; - } - - /** - * API name: {@code soft_deletes} - */ - public final Builder softDeletes(Function> fn) { - return this.softDeletes(fn.apply(new SoftDeletes.Builder()).build()); - } - - /** - * API name: {@code sort} - */ - public final Builder sort(@Nullable IndexSegmentSort value) { - this.sort = value; - return this; - } - - /** - * API name: {@code sort} - */ - public final Builder sort(Function> fn) { - return this.sort(fn.apply(new IndexSegmentSort.Builder()).build()); - } - - /** - * API name: {@code number_of_shards} - */ - public final Builder numberOfShards(@Nullable String value) { - this.numberOfShards = value; - return this; - } - - /** - * API name: {@code number_of_replicas} - */ - public final Builder numberOfReplicas(@Nullable String value) { - this.numberOfReplicas = value; - return this; - } - - /** - * API name: {@code number_of_routing_shards} - */ - public final Builder numberOfRoutingShards(@Nullable Integer value) { - this.numberOfRoutingShards = value; - return this; - } - - /** - * API name: {@code check_on_startup} - */ - public final Builder checkOnStartup(@Nullable IndexCheckOnStartup value) { - this.checkOnStartup = value; - return this; - } - - /** - * API name: {@code codec} - */ - public final Builder codec(@Nullable String value) { - this.codec = value; - return this; - } - - /** - * API name: {@code routing_partition_size} - */ - public final Builder routingPartitionSize(@Nullable Integer value) { - this.routingPartitionSize = value; - return this; - } - - /** - * API name: {@code load_fixed_bitset_filters_eagerly} - */ - public final Builder loadFixedBitsetFiltersEagerly(@Nullable Boolean value) { - this.loadFixedBitsetFiltersEagerly = value; - return this; - } - - /** - * API name: {@code hidden} - */ - public final Builder hidden(@Nullable Boolean value) { - this.hidden = value; - return this; - } - - /** - * API name: {@code auto_expand_replicas} - */ - public final Builder autoExpandReplicas(@Nullable String value) { - this.autoExpandReplicas = value; - return this; - } - - /** - * API name: {@code merge} - */ - public final Builder merge(@Nullable Merge value) { - this.merge = value; - return this; - } - - /** - * API name: {@code merge} - */ - public final Builder merge(Function> fn) { - return this.merge(fn.apply(new Merge.Builder()).build()); - } - - /** - * API name: {@code search} - */ - public final Builder search(@Nullable SettingsSearch value) { - this.search = value; - return this; - } - - /** - * API name: {@code search} - */ - public final Builder search(Function> fn) { - return this.search(fn.apply(new SettingsSearch.Builder()).build()); - } - - /** - * API name: {@code refresh_interval} - */ - public final Builder refreshInterval(@Nullable Time value) { - this.refreshInterval = value; - return this; - } - - /** - * API name: {@code refresh_interval} - */ - public final Builder refreshInterval(Function> fn) { - return this.refreshInterval(fn.apply(new Time.Builder()).build()); - } - - /** - * API name: {@code max_result_window} - */ - public final Builder maxResultWindow(@Nullable Integer value) { - this.maxResultWindow = value; - return this; - } - - /** - * API name: {@code max_inner_result_window} - */ - public final Builder maxInnerResultWindow(@Nullable Integer value) { - this.maxInnerResultWindow = value; - return this; - } - - /** - * API name: {@code max_rescore_window} - */ - public final Builder maxRescoreWindow(@Nullable Integer value) { - this.maxRescoreWindow = value; - return this; - } - - /** - * API name: {@code max_docvalue_fields_search} - */ - public final Builder maxDocvalueFieldsSearch(@Nullable Integer value) { - this.maxDocvalueFieldsSearch = value; - return this; - } - - /** - * API name: {@code max_script_fields} - */ - public final Builder maxScriptFields(@Nullable Integer value) { - this.maxScriptFields = value; - return this; - } - - /** - * API name: {@code max_ngram_diff} - */ - public final Builder maxNgramDiff(@Nullable Integer value) { - this.maxNgramDiff = value; - return this; - } - - /** - * API name: {@code max_shingle_diff} - */ - public final Builder maxShingleDiff(@Nullable Integer value) { - this.maxShingleDiff = value; - return this; - } - - /** - * API name: {@code blocks} - */ - public final Builder blocks(@Nullable IndexSettingBlocks value) { - this.blocks = value; - return this; - } - - /** - * API name: {@code blocks} - */ - public final Builder blocks(Function> fn) { - return this.blocks(fn.apply(new IndexSettingBlocks.Builder()).build()); - } - - /** - * API name: {@code max_refresh_listeners} - */ - public final Builder maxRefreshListeners(@Nullable Integer value) { - this.maxRefreshListeners = value; - return this; - } - - /** - * Settings to define analyzers, tokenizers, token filters and character - * filters. - *

- * API name: {@code analyze} - */ - public final Builder analyze(@Nullable SettingsAnalyze value) { - this.analyze = value; - return this; - } - - /** - * Settings to define analyzers, tokenizers, token filters and character - * filters. - *

- * API name: {@code analyze} - */ - public final Builder analyze(Function> fn) { - return this.analyze(fn.apply(new SettingsAnalyze.Builder()).build()); - } - - /** - * API name: {@code highlight} - */ - public final Builder highlight(@Nullable SettingsHighlight value) { - this.highlight = value; - return this; - } - - /** - * API name: {@code highlight} - */ - public final Builder highlight(Function> fn) { - return this.highlight(fn.apply(new SettingsHighlight.Builder()).build()); - } - - /** - * API name: {@code max_terms_count} - */ - public final Builder maxTermsCount(@Nullable Integer value) { - this.maxTermsCount = value; - return this; - } - - /** - * API name: {@code max_regex_length} - */ - public final Builder maxRegexLength(@Nullable Integer value) { - this.maxRegexLength = value; - return this; - } - - /** - * API name: {@code routing} - */ - public final Builder routing(@Nullable IndexRouting value) { - this.routing = value; - return this; - } - - /** - * API name: {@code routing} - */ - public final Builder routing(Function> fn) { - return this.routing(fn.apply(new IndexRouting.Builder()).build()); - } - - /** - * API name: {@code gc_deletes} - */ - public final Builder gcDeletes(@Nullable Time value) { - this.gcDeletes = value; - return this; - } - - /** - * API name: {@code gc_deletes} - */ - public final Builder gcDeletes(Function> fn) { - return this.gcDeletes(fn.apply(new Time.Builder()).build()); - } - - /** - * API name: {@code default_pipeline} - */ - public final Builder defaultPipeline(@Nullable String value) { - this.defaultPipeline = value; - return this; - } - - /** - * API name: {@code final_pipeline} - */ - public final Builder finalPipeline(@Nullable String value) { - this.finalPipeline = value; - return this; - } - - /** - * API name: {@code lifecycle} - */ - public final Builder lifecycle(@Nullable IndexSettingsLifecycle value) { - this.lifecycle = value; - return this; - } - - /** - * API name: {@code lifecycle} - */ - public final Builder lifecycle( - Function> fn) { - return this.lifecycle(fn.apply(new IndexSettingsLifecycle.Builder()).build()); - } - - /** - * API name: {@code provided_name} - */ - public final Builder providedName(@Nullable String value) { - this.providedName = value; - return this; - } - - /** - * API name: {@code creation_date} - */ - public final Builder creationDate(@Nullable Long value) { - this.creationDate = value; - return this; - } - - /** - * API name: {@code creation_date_string} - */ - public final Builder creationDateString(@Nullable DateTime value) { - this.creationDateString = value; - return this; - } - - /** - * API name: {@code uuid} - */ - public final Builder uuid(@Nullable String value) { - this.uuid = value; - return this; - } - - /** - * API name: {@code version} - */ - public final Builder version(@Nullable IndexVersioning value) { - this.version = value; - return this; - } - - /** - * API name: {@code version} - */ - public final Builder version(Function> fn) { - return this.version(fn.apply(new IndexVersioning.Builder()).build()); - } - - /** - * API name: {@code verified_before_close} - */ - public final Builder verifiedBeforeClose(@Nullable Boolean value) { - this.verifiedBeforeClose = value; - return this; - } - - /** - * API name: {@code format} - */ - public final Builder format(@Nullable String value) { - this.format = value; - return this; - } - - /** - * API name: {@code max_slices_per_scroll} - */ - public final Builder maxSlicesPerScroll(@Nullable Integer value) { - this.maxSlicesPerScroll = value; - return this; - } - - /** - * API name: {@code translog} - */ - public final Builder translog(@Nullable Translog value) { - this.translog = value; - return this; - } - - /** - * API name: {@code translog} - */ - public final Builder translog(Function> fn) { - return this.translog(fn.apply(new Translog.Builder()).build()); - } - - /** - * API name: {@code query_string} - */ - public final Builder queryString(@Nullable SettingsQueryString value) { - this.queryString = value; - return this; - } - - /** - * API name: {@code query_string} - */ - public final Builder queryString(Function> fn) { - return this.queryString(fn.apply(new SettingsQueryString.Builder()).build()); - } - - /** - * API name: {@code priority} - */ - public final Builder priority(@Nullable String value) { - this.priority = value; - return this; - } - - /** - * API name: {@code top_metrics_max_size} - */ - public final Builder topMetricsMaxSize(@Nullable Integer value) { - this.topMetricsMaxSize = value; - return this; - } - - /** - * API name: {@code analysis} - */ - public final Builder analysis(@Nullable IndexSettingsAnalysis value) { - this.analysis = value; - return this; - } - - /** - * API name: {@code analysis} - */ - public final Builder analysis( - Function> fn) { - return this.analysis(fn.apply(new IndexSettingsAnalysis.Builder()).build()); - } - - /** - * API name: {@code settings} - */ - public final Builder settings(@Nullable IndexSettings value) { - this.settings = value; - return this; - } - - /** - * API name: {@code settings} - */ - public final Builder settings(Function> fn) { - return this.settings(fn.apply(new IndexSettings.Builder()).build()); - } - - /** - * API name: {@code time_series} - */ - public final Builder timeSeries(@Nullable IndexSettingsTimeSeries value) { - this.timeSeries = value; - return this; - } - - /** - * API name: {@code time_series} - */ - public final Builder timeSeries( - Function> fn) { - return this.timeSeries(fn.apply(new IndexSettingsTimeSeries.Builder()).build()); - } - - /** - * API name: {@code queries} - */ - public final Builder queries(@Nullable Queries value) { - this.queries = value; - return this; - } - - /** - * API name: {@code queries} - */ - public final Builder queries(Function> fn) { - return this.queries(fn.apply(new Queries.Builder()).build()); - } - - /** - * Configure custom similarity settings to customize how search results are - * scored. - *

- * API name: {@code similarity} - *

- * Adds all entries of map to similarity. - */ - public final Builder similarity(Map map) { - this.similarity = _mapPutAll(this.similarity, map); - return this; - } - - /** - * Configure custom similarity settings to customize how search results are - * scored. - *

- * API name: {@code similarity} - *

- * Adds an entry to similarity. - */ - public final Builder similarity(String key, SettingsSimilarity value) { - this.similarity = _mapPut(this.similarity, key, value); - return this; - } - - /** - * Configure custom similarity settings to customize how search results are - * scored. - *

- * API name: {@code similarity} - *

- * Adds an entry to similarity using a builder lambda. - */ - public final Builder similarity(String key, - Function> fn) { - return similarity(key, fn.apply(new SettingsSimilarity.Builder()).build()); - } - - /** - * Enable or disable dynamic mapping for an index. - *

- * API name: {@code mapping} - */ - public final Builder mapping(@Nullable MappingLimitSettings value) { - this.mapping = value; - return this; - } - - /** - * Enable or disable dynamic mapping for an index. - *

- * API name: {@code mapping} - */ - public final Builder mapping(Function> fn) { - return this.mapping(fn.apply(new MappingLimitSettings.Builder()).build()); - } - - /** - * API name: {@code indexing.slowlog} - */ - public final Builder indexingSlowlog(@Nullable IndexingSlowlogSettings value) { - this.indexingSlowlog = value; - return this; - } - - /** - * API name: {@code indexing.slowlog} - */ - public final Builder indexingSlowlog( - Function> fn) { - return this.indexingSlowlog(fn.apply(new IndexingSlowlogSettings.Builder()).build()); - } - - /** - * Configure indexing back pressure limits. - *

- * API name: {@code indexing_pressure} - */ - public final Builder indexingPressure(@Nullable IndexingPressure value) { - this.indexingPressure = value; - return this; - } - - /** - * Configure indexing back pressure limits. - *

- * API name: {@code indexing_pressure} - */ - public final Builder indexingPressure(Function> fn) { - return this.indexingPressure(fn.apply(new IndexingPressure.Builder()).build()); - } - - /** - * The store module allows you to control how index data is stored and accessed - * on disk. - *

- * API name: {@code store} - */ - public final Builder store(@Nullable Storage value) { - this.store = value; - return this; - } - - /** - * The store module allows you to control how index data is stored and accessed - * on disk. - *

- * API name: {@code store} - */ - public final Builder store(Function> fn) { - return this.store(fn.apply(new Storage.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexSettings}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexSettings build() { - _checkSingleUse(); - - return new IndexSettings(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexSettings} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - IndexSettings::setupIndexSettingsDeserializer); - - protected static void setupIndexSettingsDeserializer(ObjectDeserializer op) { - - op.add(Builder::index, IndexSettings._DESERIALIZER, "index"); - op.add(Builder::mode, JsonpDeserializer.stringDeserializer(), "mode"); - op.add(Builder::routingPath, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "routing_path"); - op.add(Builder::softDeletes, SoftDeletes._DESERIALIZER, "soft_deletes"); - op.add(Builder::sort, IndexSegmentSort._DESERIALIZER, "sort"); - op.add(Builder::numberOfShards, JsonpDeserializer.stringDeserializer(), "number_of_shards"); - op.add(Builder::numberOfReplicas, JsonpDeserializer.stringDeserializer(), "number_of_replicas"); - op.add(Builder::numberOfRoutingShards, JsonpDeserializer.integerDeserializer(), "number_of_routing_shards"); - op.add(Builder::checkOnStartup, IndexCheckOnStartup._DESERIALIZER, "check_on_startup"); - op.add(Builder::codec, JsonpDeserializer.stringDeserializer(), "codec"); - op.add(Builder::routingPartitionSize, JsonpDeserializer.integerDeserializer(), "routing_partition_size"); - op.add(Builder::loadFixedBitsetFiltersEagerly, JsonpDeserializer.booleanDeserializer(), - "load_fixed_bitset_filters_eagerly"); - op.add(Builder::hidden, JsonpDeserializer.booleanDeserializer(), "hidden"); - op.add(Builder::autoExpandReplicas, JsonpDeserializer.stringDeserializer(), "auto_expand_replicas"); - op.add(Builder::merge, Merge._DESERIALIZER, "merge"); - op.add(Builder::search, SettingsSearch._DESERIALIZER, "search"); - op.add(Builder::refreshInterval, Time._DESERIALIZER, "refresh_interval"); - op.add(Builder::maxResultWindow, JsonpDeserializer.integerDeserializer(), "max_result_window"); - op.add(Builder::maxInnerResultWindow, JsonpDeserializer.integerDeserializer(), "max_inner_result_window"); - op.add(Builder::maxRescoreWindow, JsonpDeserializer.integerDeserializer(), "max_rescore_window"); - op.add(Builder::maxDocvalueFieldsSearch, JsonpDeserializer.integerDeserializer(), "max_docvalue_fields_search"); - op.add(Builder::maxScriptFields, JsonpDeserializer.integerDeserializer(), "max_script_fields"); - op.add(Builder::maxNgramDiff, JsonpDeserializer.integerDeserializer(), "max_ngram_diff"); - op.add(Builder::maxShingleDiff, JsonpDeserializer.integerDeserializer(), "max_shingle_diff"); - op.add(Builder::blocks, IndexSettingBlocks._DESERIALIZER, "blocks"); - op.add(Builder::maxRefreshListeners, JsonpDeserializer.integerDeserializer(), "max_refresh_listeners"); - op.add(Builder::analyze, SettingsAnalyze._DESERIALIZER, "analyze"); - op.add(Builder::highlight, SettingsHighlight._DESERIALIZER, "highlight"); - op.add(Builder::maxTermsCount, JsonpDeserializer.integerDeserializer(), "max_terms_count"); - op.add(Builder::maxRegexLength, JsonpDeserializer.integerDeserializer(), "max_regex_length"); - op.add(Builder::routing, IndexRouting._DESERIALIZER, "routing"); - op.add(Builder::gcDeletes, Time._DESERIALIZER, "gc_deletes"); - op.add(Builder::defaultPipeline, JsonpDeserializer.stringDeserializer(), "default_pipeline"); - op.add(Builder::finalPipeline, JsonpDeserializer.stringDeserializer(), "final_pipeline"); - op.add(Builder::lifecycle, IndexSettingsLifecycle._DESERIALIZER, "lifecycle"); - op.add(Builder::providedName, JsonpDeserializer.stringDeserializer(), "provided_name"); - op.add(Builder::creationDate, JsonpDeserializer.longDeserializer(), "creation_date"); - op.add(Builder::creationDateString, DateTime._DESERIALIZER, "creation_date_string"); - op.add(Builder::uuid, JsonpDeserializer.stringDeserializer(), "uuid"); - op.add(Builder::version, IndexVersioning._DESERIALIZER, "version"); - op.add(Builder::verifiedBeforeClose, JsonpDeserializer.booleanDeserializer(), "verified_before_close"); - op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format"); - op.add(Builder::maxSlicesPerScroll, JsonpDeserializer.integerDeserializer(), "max_slices_per_scroll"); - op.add(Builder::translog, Translog._DESERIALIZER, "translog"); - op.add(Builder::queryString, SettingsQueryString._DESERIALIZER, "query_string"); - op.add(Builder::priority, JsonpDeserializer.stringDeserializer(), "priority"); - op.add(Builder::topMetricsMaxSize, JsonpDeserializer.integerDeserializer(), "top_metrics_max_size"); - op.add(Builder::analysis, IndexSettingsAnalysis._DESERIALIZER, "analysis"); - op.add(Builder::settings, IndexSettings._DESERIALIZER, "settings"); - op.add(Builder::timeSeries, IndexSettingsTimeSeries._DESERIALIZER, "time_series"); - op.add(Builder::queries, Queries._DESERIALIZER, "queries"); - op.add(Builder::similarity, JsonpDeserializer.stringMapDeserializer(SettingsSimilarity._DESERIALIZER), - "similarity"); - op.add(Builder::mapping, MappingLimitSettings._DESERIALIZER, "mapping"); - op.add(Builder::indexingSlowlog, IndexingSlowlogSettings._DESERIALIZER, "indexing.slowlog"); - op.add(Builder::indexingPressure, IndexingPressure._DESERIALIZER, "indexing_pressure"); - op.add(Builder::store, Storage._DESERIALIZER, "store"); - - op.setUnknownFieldHandler((builder, name, parser, mapper) -> { - builder.otherSettings(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); - }); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsAnalysis.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsAnalysis.java deleted file mode 100644 index c2ff07403..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsAnalysis.java +++ /dev/null @@ -1,409 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.analysis.Analyzer; -import co.elastic.clients.elasticsearch._types.analysis.CharFilter; -import co.elastic.clients.elasticsearch._types.analysis.Normalizer; -import co.elastic.clients.elasticsearch._types.analysis.TokenFilter; -import co.elastic.clients.elasticsearch._types.analysis.Tokenizer; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexSettingsAnalysis - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexSettingsAnalysis implements JsonpSerializable { - private final Map analyzer; - - private final Map charFilter; - - private final Map filter; - - private final Map normalizer; - - private final Map tokenizer; - - // --------------------------------------------------------------------------------------------- - - private IndexSettingsAnalysis(Builder builder) { - - this.analyzer = ApiTypeHelper.unmodifiable(builder.analyzer); - this.charFilter = ApiTypeHelper.unmodifiable(builder.charFilter); - this.filter = ApiTypeHelper.unmodifiable(builder.filter); - this.normalizer = ApiTypeHelper.unmodifiable(builder.normalizer); - this.tokenizer = ApiTypeHelper.unmodifiable(builder.tokenizer); - - } - - public static IndexSettingsAnalysis of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code analyzer} - */ - public final Map analyzer() { - return this.analyzer; - } - - /** - * API name: {@code char_filter} - */ - public final Map charFilter() { - return this.charFilter; - } - - /** - * API name: {@code filter} - */ - public final Map filter() { - return this.filter; - } - - /** - * API name: {@code normalizer} - */ - public final Map normalizer() { - return this.normalizer; - } - - /** - * API name: {@code tokenizer} - */ - public final Map tokenizer() { - return this.tokenizer; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.analyzer)) { - generator.writeKey("analyzer"); - generator.writeStartObject(); - for (Map.Entry item0 : this.analyzer.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.charFilter)) { - generator.writeKey("char_filter"); - generator.writeStartObject(); - for (Map.Entry item0 : this.charFilter.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.filter)) { - generator.writeKey("filter"); - generator.writeStartObject(); - for (Map.Entry item0 : this.filter.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.normalizer)) { - generator.writeKey("normalizer"); - generator.writeStartObject(); - for (Map.Entry item0 : this.normalizer.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.tokenizer)) { - generator.writeKey("tokenizer"); - generator.writeStartObject(); - for (Map.Entry item0 : this.tokenizer.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexSettingsAnalysis}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Map analyzer; - - @Nullable - private Map charFilter; - - @Nullable - private Map filter; - - @Nullable - private Map normalizer; - - @Nullable - private Map tokenizer; - - /** - * API name: {@code analyzer} - *

- * Adds all entries of map to analyzer. - */ - public final Builder analyzer(Map map) { - this.analyzer = _mapPutAll(this.analyzer, map); - return this; - } - - /** - * API name: {@code analyzer} - *

- * Adds an entry to analyzer. - */ - public final Builder analyzer(String key, Analyzer value) { - this.analyzer = _mapPut(this.analyzer, key, value); - return this; - } - - /** - * API name: {@code analyzer} - *

- * Adds an entry to analyzer using a builder lambda. - */ - public final Builder analyzer(String key, Function> fn) { - return analyzer(key, fn.apply(new Analyzer.Builder()).build()); - } - - /** - * API name: {@code char_filter} - *

- * Adds all entries of map to charFilter. - */ - public final Builder charFilter(Map map) { - this.charFilter = _mapPutAll(this.charFilter, map); - return this; - } - - /** - * API name: {@code char_filter} - *

- * Adds an entry to charFilter. - */ - public final Builder charFilter(String key, CharFilter value) { - this.charFilter = _mapPut(this.charFilter, key, value); - return this; - } - - /** - * API name: {@code char_filter} - *

- * Adds an entry to charFilter using a builder lambda. - */ - public final Builder charFilter(String key, Function> fn) { - return charFilter(key, fn.apply(new CharFilter.Builder()).build()); - } - - /** - * API name: {@code filter} - *

- * Adds all entries of map to filter. - */ - public final Builder filter(Map map) { - this.filter = _mapPutAll(this.filter, map); - return this; - } - - /** - * API name: {@code filter} - *

- * Adds an entry to filter. - */ - public final Builder filter(String key, TokenFilter value) { - this.filter = _mapPut(this.filter, key, value); - return this; - } - - /** - * API name: {@code filter} - *

- * Adds an entry to filter using a builder lambda. - */ - public final Builder filter(String key, Function> fn) { - return filter(key, fn.apply(new TokenFilter.Builder()).build()); - } - - /** - * API name: {@code normalizer} - *

- * Adds all entries of map to normalizer. - */ - public final Builder normalizer(Map map) { - this.normalizer = _mapPutAll(this.normalizer, map); - return this; - } - - /** - * API name: {@code normalizer} - *

- * Adds an entry to normalizer. - */ - public final Builder normalizer(String key, Normalizer value) { - this.normalizer = _mapPut(this.normalizer, key, value); - return this; - } - - /** - * API name: {@code normalizer} - *

- * Adds an entry to normalizer using a builder lambda. - */ - public final Builder normalizer(String key, Function> fn) { - return normalizer(key, fn.apply(new Normalizer.Builder()).build()); - } - - /** - * API name: {@code tokenizer} - *

- * Adds all entries of map to tokenizer. - */ - public final Builder tokenizer(Map map) { - this.tokenizer = _mapPutAll(this.tokenizer, map); - return this; - } - - /** - * API name: {@code tokenizer} - *

- * Adds an entry to tokenizer. - */ - public final Builder tokenizer(String key, Tokenizer value) { - this.tokenizer = _mapPut(this.tokenizer, key, value); - return this; - } - - /** - * API name: {@code tokenizer} - *

- * Adds an entry to tokenizer using a builder lambda. - */ - public final Builder tokenizer(String key, Function> fn) { - return tokenizer(key, fn.apply(new Tokenizer.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexSettingsAnalysis}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexSettingsAnalysis build() { - _checkSingleUse(); - - return new IndexSettingsAnalysis(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexSettingsAnalysis} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndexSettingsAnalysis::setupIndexSettingsAnalysisDeserializer); - - protected static void setupIndexSettingsAnalysisDeserializer(ObjectDeserializer op) { - - op.add(Builder::analyzer, JsonpDeserializer.stringMapDeserializer(Analyzer._DESERIALIZER), "analyzer"); - op.add(Builder::charFilter, JsonpDeserializer.stringMapDeserializer(CharFilter._DESERIALIZER), "char_filter"); - op.add(Builder::filter, JsonpDeserializer.stringMapDeserializer(TokenFilter._DESERIALIZER), "filter"); - op.add(Builder::normalizer, JsonpDeserializer.stringMapDeserializer(Normalizer._DESERIALIZER), "normalizer"); - op.add(Builder::tokenizer, JsonpDeserializer.stringMapDeserializer(Tokenizer._DESERIALIZER), "tokenizer"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsLifecycle.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsLifecycle.java deleted file mode 100644 index 045ac9807..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsLifecycle.java +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexSettingsLifecycle - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexSettingsLifecycle implements JsonpSerializable { - @Nullable - private final String name; - - @Nullable - private final Boolean indexingComplete; - - @Nullable - private final Long originationDate; - - @Nullable - private final Boolean parseOriginationDate; - - @Nullable - private final IndexSettingsLifecycleStep step; - - @Nullable - private final String rolloverAlias; - - // --------------------------------------------------------------------------------------------- - - private IndexSettingsLifecycle(Builder builder) { - - this.name = builder.name; - this.indexingComplete = builder.indexingComplete; - this.originationDate = builder.originationDate; - this.parseOriginationDate = builder.parseOriginationDate; - this.step = builder.step; - this.rolloverAlias = builder.rolloverAlias; - - } - - public static IndexSettingsLifecycle of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * The name of the policy to use to manage the index. For information about how - * Elasticsearch applies policy changes, see Policy updates. - *

- * API name: {@code name} - */ - @Nullable - public final String name() { - return this.name; - } - - /** - * Indicates whether or not the index has been rolled over. Automatically set to - * true when ILM completes the rollover action. You can explicitly set it to - * skip rollover. - *

- * API name: {@code indexing_complete} - */ - @Nullable - public final Boolean indexingComplete() { - return this.indexingComplete; - } - - /** - * If specified, this is the timestamp used to calculate the index age for its - * phase transitions. Use this setting if you create a new index that contains - * old data and want to use the original creation date to calculate the index - * age. Specified as a Unix epoch value in milliseconds. - *

- * API name: {@code origination_date} - */ - @Nullable - public final Long originationDate() { - return this.originationDate; - } - - /** - * Set to true to parse the origination date from the index name. This - * origination date is used to calculate the index age for its phase - * transitions. The index name must match the pattern ^.*-{date_format}-\d+, - * where the date_format is yyyy.MM.dd and the trailing digits are optional. An - * index that was rolled over would normally match the full format, for example - * logs-2016.10.31-000002). If the index name doesn’t match the pattern, index - * creation fails. - *

- * API name: {@code parse_origination_date} - */ - @Nullable - public final Boolean parseOriginationDate() { - return this.parseOriginationDate; - } - - /** - * API name: {@code step} - */ - @Nullable - public final IndexSettingsLifecycleStep step() { - return this.step; - } - - /** - * The index alias to update when the index rolls over. Specify when using a - * policy that contains a rollover action. When the index rolls over, the alias - * is updated to reflect that the index is no longer the write index. For more - * information about rolling indices, see Rollover. - *

- * API name: {@code rollover_alias} - */ - @Nullable - public final String rolloverAlias() { - return this.rolloverAlias; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.name != null) { - generator.writeKey("name"); - generator.write(this.name); - - } - if (this.indexingComplete != null) { - generator.writeKey("indexing_complete"); - generator.write(this.indexingComplete); - - } - if (this.originationDate != null) { - generator.writeKey("origination_date"); - generator.write(this.originationDate); - - } - if (this.parseOriginationDate != null) { - generator.writeKey("parse_origination_date"); - generator.write(this.parseOriginationDate); - - } - if (this.step != null) { - generator.writeKey("step"); - this.step.serialize(generator, mapper); - - } - if (this.rolloverAlias != null) { - generator.writeKey("rollover_alias"); - generator.write(this.rolloverAlias); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexSettingsLifecycle}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private String name; - - @Nullable - private Boolean indexingComplete; - - @Nullable - private Long originationDate; - - @Nullable - private Boolean parseOriginationDate; - - @Nullable - private IndexSettingsLifecycleStep step; - - @Nullable - private String rolloverAlias; - - /** - * The name of the policy to use to manage the index. For information about how - * Elasticsearch applies policy changes, see Policy updates. - *

- * API name: {@code name} - */ - public final Builder name(@Nullable String value) { - this.name = value; - return this; - } - - /** - * Indicates whether or not the index has been rolled over. Automatically set to - * true when ILM completes the rollover action. You can explicitly set it to - * skip rollover. - *

- * API name: {@code indexing_complete} - */ - public final Builder indexingComplete(@Nullable Boolean value) { - this.indexingComplete = value; - return this; - } - - /** - * If specified, this is the timestamp used to calculate the index age for its - * phase transitions. Use this setting if you create a new index that contains - * old data and want to use the original creation date to calculate the index - * age. Specified as a Unix epoch value in milliseconds. - *

- * API name: {@code origination_date} - */ - public final Builder originationDate(@Nullable Long value) { - this.originationDate = value; - return this; - } - - /** - * Set to true to parse the origination date from the index name. This - * origination date is used to calculate the index age for its phase - * transitions. The index name must match the pattern ^.*-{date_format}-\d+, - * where the date_format is yyyy.MM.dd and the trailing digits are optional. An - * index that was rolled over would normally match the full format, for example - * logs-2016.10.31-000002). If the index name doesn’t match the pattern, index - * creation fails. - *

- * API name: {@code parse_origination_date} - */ - public final Builder parseOriginationDate(@Nullable Boolean value) { - this.parseOriginationDate = value; - return this; - } - - /** - * API name: {@code step} - */ - public final Builder step(@Nullable IndexSettingsLifecycleStep value) { - this.step = value; - return this; - } - - /** - * API name: {@code step} - */ - public final Builder step( - Function> fn) { - return this.step(fn.apply(new IndexSettingsLifecycleStep.Builder()).build()); - } - - /** - * The index alias to update when the index rolls over. Specify when using a - * policy that contains a rollover action. When the index rolls over, the alias - * is updated to reflect that the index is no longer the write index. For more - * information about rolling indices, see Rollover. - *

- * API name: {@code rollover_alias} - */ - public final Builder rolloverAlias(@Nullable String value) { - this.rolloverAlias = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexSettingsLifecycle}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexSettingsLifecycle build() { - _checkSingleUse(); - - return new IndexSettingsLifecycle(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexSettingsLifecycle} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndexSettingsLifecycle::setupIndexSettingsLifecycleDeserializer); - - protected static void setupIndexSettingsLifecycleDeserializer( - ObjectDeserializer op) { - - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - op.add(Builder::indexingComplete, JsonpDeserializer.booleanDeserializer(), "indexing_complete"); - op.add(Builder::originationDate, JsonpDeserializer.longDeserializer(), "origination_date"); - op.add(Builder::parseOriginationDate, JsonpDeserializer.booleanDeserializer(), "parse_origination_date"); - op.add(Builder::step, IndexSettingsLifecycleStep._DESERIALIZER, "step"); - op.add(Builder::rolloverAlias, JsonpDeserializer.stringDeserializer(), "rollover_alias"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsLifecycleStep.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsLifecycleStep.java deleted file mode 100644 index d48d7e19d..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsLifecycleStep.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexSettingsLifecycleStep - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexSettingsLifecycleStep implements JsonpSerializable { - @Nullable - private final Time waitTimeThreshold; - - // --------------------------------------------------------------------------------------------- - - private IndexSettingsLifecycleStep(Builder builder) { - - this.waitTimeThreshold = builder.waitTimeThreshold; - - } - - public static IndexSettingsLifecycleStep of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Time to wait for the cluster to resolve allocation issues during an ILM - * shrink action. Must be greater than 1h (1 hour). See Shard allocation for - * shrink. - *

- * API name: {@code wait_time_threshold} - */ - @Nullable - public final Time waitTimeThreshold() { - return this.waitTimeThreshold; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.waitTimeThreshold != null) { - generator.writeKey("wait_time_threshold"); - this.waitTimeThreshold.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexSettingsLifecycleStep}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Time waitTimeThreshold; - - /** - * Time to wait for the cluster to resolve allocation issues during an ILM - * shrink action. Must be greater than 1h (1 hour). See Shard allocation for - * shrink. - *

- * API name: {@code wait_time_threshold} - */ - public final Builder waitTimeThreshold(@Nullable Time value) { - this.waitTimeThreshold = value; - return this; - } - - /** - * Time to wait for the cluster to resolve allocation issues during an ILM - * shrink action. Must be greater than 1h (1 hour). See Shard allocation for - * shrink. - *

- * API name: {@code wait_time_threshold} - */ - public final Builder waitTimeThreshold(Function> fn) { - return this.waitTimeThreshold(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexSettingsLifecycleStep}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexSettingsLifecycleStep build() { - _checkSingleUse(); - - return new IndexSettingsLifecycleStep(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexSettingsLifecycleStep} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndexSettingsLifecycleStep::setupIndexSettingsLifecycleStepDeserializer); - - protected static void setupIndexSettingsLifecycleStepDeserializer( - ObjectDeserializer op) { - - op.add(Builder::waitTimeThreshold, Time._DESERIALIZER, "wait_time_threshold"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsTimeSeries.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsTimeSeries.java deleted file mode 100644 index 85d2288cf..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsTimeSeries.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.DateTime; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexSettingsTimeSeries - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexSettingsTimeSeries implements JsonpSerializable { - @Nullable - private final DateTime endTime; - - @Nullable - private final DateTime startTime; - - // --------------------------------------------------------------------------------------------- - - private IndexSettingsTimeSeries(Builder builder) { - - this.endTime = builder.endTime; - this.startTime = builder.startTime; - - } - - public static IndexSettingsTimeSeries of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code end_time} - */ - @Nullable - public final DateTime endTime() { - return this.endTime; - } - - /** - * API name: {@code start_time} - */ - @Nullable - public final DateTime startTime() { - return this.startTime; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.endTime != null) { - generator.writeKey("end_time"); - this.endTime.serialize(generator, mapper); - } - if (this.startTime != null) { - generator.writeKey("start_time"); - this.startTime.serialize(generator, mapper); - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexSettingsTimeSeries}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private DateTime endTime; - - @Nullable - private DateTime startTime; - - /** - * API name: {@code end_time} - */ - public final Builder endTime(@Nullable DateTime value) { - this.endTime = value; - return this; - } - - /** - * API name: {@code start_time} - */ - public final Builder startTime(@Nullable DateTime value) { - this.startTime = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexSettingsTimeSeries}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexSettingsTimeSeries build() { - _checkSingleUse(); - - return new IndexSettingsTimeSeries(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexSettingsTimeSeries} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndexSettingsTimeSeries::setupIndexSettingsTimeSeriesDeserializer); - - protected static void setupIndexSettingsTimeSeriesDeserializer( - ObjectDeserializer op) { - - op.add(Builder::endTime, DateTime._DESERIALIZER, "end_time"); - op.add(Builder::startTime, DateTime._DESERIALIZER, "start_time"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexState.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexState.java deleted file mode 100644 index b787c554a..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexState.java +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexState - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexState implements JsonpSerializable { - private final Map aliases; - - @Nullable - private final TypeMapping mappings; - - @Nullable - private final IndexSettings settings; - - @Nullable - private final IndexSettings defaults; - - @Nullable - private final String dataStream; - - @Nullable - private final DataStreamLifecycle lifecycle; - - // --------------------------------------------------------------------------------------------- - - private IndexState(Builder builder) { - - this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); - this.mappings = builder.mappings; - this.settings = builder.settings; - this.defaults = builder.defaults; - this.dataStream = builder.dataStream; - this.lifecycle = builder.lifecycle; - - } - - public static IndexState of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code aliases} - */ - public final Map aliases() { - return this.aliases; - } - - /** - * API name: {@code mappings} - */ - @Nullable - public final TypeMapping mappings() { - return this.mappings; - } - - /** - * API name: {@code settings} - */ - @Nullable - public final IndexSettings settings() { - return this.settings; - } - - /** - * Default settings, included when the request's include_default is - * true. - *

- * API name: {@code defaults} - */ - @Nullable - public final IndexSettings defaults() { - return this.defaults; - } - - /** - * API name: {@code data_stream} - */ - @Nullable - public final String dataStream() { - return this.dataStream; - } - - /** - * Data stream lifecycle applicable if this is a data stream. - *

- * API name: {@code lifecycle} - */ - @Nullable - public final DataStreamLifecycle lifecycle() { - return this.lifecycle; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.aliases)) { - generator.writeKey("aliases"); - generator.writeStartObject(); - for (Map.Entry item0 : this.aliases.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.mappings != null) { - generator.writeKey("mappings"); - this.mappings.serialize(generator, mapper); - - } - if (this.settings != null) { - generator.writeKey("settings"); - this.settings.serialize(generator, mapper); - - } - if (this.defaults != null) { - generator.writeKey("defaults"); - this.defaults.serialize(generator, mapper); - - } - if (this.dataStream != null) { - generator.writeKey("data_stream"); - generator.write(this.dataStream); - - } - if (this.lifecycle != null) { - generator.writeKey("lifecycle"); - this.lifecycle.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexState}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private Map aliases; - - @Nullable - private TypeMapping mappings; - - @Nullable - private IndexSettings settings; - - @Nullable - private IndexSettings defaults; - - @Nullable - private String dataStream; - - @Nullable - private DataStreamLifecycle lifecycle; - - /** - * API name: {@code aliases} - *

- * Adds all entries of map to aliases. - */ - public final Builder aliases(Map map) { - this.aliases = _mapPutAll(this.aliases, map); - return this; - } - - /** - * API name: {@code aliases} - *

- * Adds an entry to aliases. - */ - public final Builder aliases(String key, Alias value) { - this.aliases = _mapPut(this.aliases, key, value); - return this; - } - - /** - * API name: {@code aliases} - *

- * Adds an entry to aliases using a builder lambda. - */ - public final Builder aliases(String key, Function> fn) { - return aliases(key, fn.apply(new Alias.Builder()).build()); - } - - /** - * API name: {@code mappings} - */ - public final Builder mappings(@Nullable TypeMapping value) { - this.mappings = value; - return this; - } - - /** - * API name: {@code mappings} - */ - public final Builder mappings(Function> fn) { - return this.mappings(fn.apply(new TypeMapping.Builder()).build()); - } - - /** - * API name: {@code settings} - */ - public final Builder settings(@Nullable IndexSettings value) { - this.settings = value; - return this; - } - - /** - * API name: {@code settings} - */ - public final Builder settings(Function> fn) { - return this.settings(fn.apply(new IndexSettings.Builder()).build()); - } - - /** - * Default settings, included when the request's include_default is - * true. - *

- * API name: {@code defaults} - */ - public final Builder defaults(@Nullable IndexSettings value) { - this.defaults = value; - return this; - } - - /** - * Default settings, included when the request's include_default is - * true. - *

- * API name: {@code defaults} - */ - public final Builder defaults(Function> fn) { - return this.defaults(fn.apply(new IndexSettings.Builder()).build()); - } - - /** - * API name: {@code data_stream} - */ - public final Builder dataStream(@Nullable String value) { - this.dataStream = value; - return this; - } - - /** - * Data stream lifecycle applicable if this is a data stream. - *

- * API name: {@code lifecycle} - */ - public final Builder lifecycle(@Nullable DataStreamLifecycle value) { - this.lifecycle = value; - return this; - } - - /** - * Data stream lifecycle applicable if this is a data stream. - *

- * API name: {@code lifecycle} - */ - public final Builder lifecycle(Function> fn) { - return this.lifecycle(fn.apply(new DataStreamLifecycle.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexState}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexState build() { - _checkSingleUse(); - - return new IndexState(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexState} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - IndexState::setupIndexStateDeserializer); - - protected static void setupIndexStateDeserializer(ObjectDeserializer op) { - - op.add(Builder::aliases, JsonpDeserializer.stringMapDeserializer(Alias._DESERIALIZER), "aliases"); - op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings"); - op.add(Builder::settings, IndexSettings._DESERIALIZER, "settings"); - op.add(Builder::defaults, IndexSettings._DESERIALIZER, "defaults"); - op.add(Builder::dataStream, JsonpDeserializer.stringDeserializer(), "data_stream"); - op.add(Builder::lifecycle, DataStreamLifecycle._DESERIALIZER, "lifecycle"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplate.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplate.java deleted file mode 100644 index 638061f29..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplate.java +++ /dev/null @@ -1,494 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Long; -import java.lang.String; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexTemplate - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexTemplate implements JsonpSerializable { - private final List indexPatterns; - - private final List composedOf; - - @Nullable - private final IndexTemplateSummary template; - - @Nullable - private final Long version; - - @Nullable - private final Long priority; - - private final Map meta; - - @Nullable - private final Boolean allowAutoCreate; - - @Nullable - private final IndexTemplateDataStreamConfiguration dataStream; - - // --------------------------------------------------------------------------------------------- - - private IndexTemplate(Builder builder) { - - this.indexPatterns = ApiTypeHelper.unmodifiableRequired(builder.indexPatterns, this, "indexPatterns"); - this.composedOf = ApiTypeHelper.unmodifiableRequired(builder.composedOf, this, "composedOf"); - this.template = builder.template; - this.version = builder.version; - this.priority = builder.priority; - this.meta = ApiTypeHelper.unmodifiable(builder.meta); - this.allowAutoCreate = builder.allowAutoCreate; - this.dataStream = builder.dataStream; - - } - - public static IndexTemplate of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Name of the index template. - *

- * API name: {@code index_patterns} - */ - public final List indexPatterns() { - return this.indexPatterns; - } - - /** - * Required - An ordered list of component template names. Component templates - * are merged in the order specified, meaning that the last component template - * specified has the highest precedence. - *

- * API name: {@code composed_of} - */ - public final List composedOf() { - return this.composedOf; - } - - /** - * Template to be applied. It may optionally include an aliases, - * mappings, or settings configuration. - *

- * API name: {@code template} - */ - @Nullable - public final IndexTemplateSummary template() { - return this.template; - } - - /** - * Version number used to manage index templates externally. This number is not - * automatically generated by Elasticsearch. - *

- * API name: {@code version} - */ - @Nullable - public final Long version() { - return this.version; - } - - /** - * Priority to determine index template precedence when a new data stream or - * index is created. The index template with the highest priority is chosen. If - * no priority is specified the template is treated as though it is of priority - * 0 (lowest priority). This number is not automatically generated by - * Elasticsearch. - *

- * API name: {@code priority} - */ - @Nullable - public final Long priority() { - return this.priority; - } - - /** - * Optional user metadata about the index template. May have any contents. This - * map is not automatically generated by Elasticsearch. - *

- * API name: {@code _meta} - */ - public final Map meta() { - return this.meta; - } - - /** - * API name: {@code allow_auto_create} - */ - @Nullable - public final Boolean allowAutoCreate() { - return this.allowAutoCreate; - } - - /** - * If this object is included, the template is used to create data streams and - * their backing indices. Supports an empty object. Data streams require a - * matching index template with a data_stream object. - *

- * API name: {@code data_stream} - */ - @Nullable - public final IndexTemplateDataStreamConfiguration dataStream() { - return this.dataStream; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.indexPatterns)) { - generator.writeKey("index_patterns"); - generator.writeStartArray(); - for (String item0 : this.indexPatterns) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.composedOf)) { - generator.writeKey("composed_of"); - generator.writeStartArray(); - for (String item0 : this.composedOf) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (this.template != null) { - generator.writeKey("template"); - this.template.serialize(generator, mapper); - - } - if (this.version != null) { - generator.writeKey("version"); - generator.write(this.version); - - } - if (this.priority != null) { - generator.writeKey("priority"); - generator.write(this.priority); - - } - if (ApiTypeHelper.isDefined(this.meta)) { - generator.writeKey("_meta"); - generator.writeStartObject(); - for (Map.Entry item0 : this.meta.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.allowAutoCreate != null) { - generator.writeKey("allow_auto_create"); - generator.write(this.allowAutoCreate); - - } - if (this.dataStream != null) { - generator.writeKey("data_stream"); - this.dataStream.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexTemplate}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private List indexPatterns; - - private List composedOf; - - @Nullable - private IndexTemplateSummary template; - - @Nullable - private Long version; - - @Nullable - private Long priority; - - @Nullable - private Map meta; - - @Nullable - private Boolean allowAutoCreate; - - @Nullable - private IndexTemplateDataStreamConfiguration dataStream; - - /** - * Required - Name of the index template. - *

- * API name: {@code index_patterns} - *

- * Adds all elements of list to indexPatterns. - */ - public final Builder indexPatterns(List list) { - this.indexPatterns = _listAddAll(this.indexPatterns, list); - return this; - } - - /** - * Required - Name of the index template. - *

- * API name: {@code index_patterns} - *

- * Adds one or more values to indexPatterns. - */ - public final Builder indexPatterns(String value, String... values) { - this.indexPatterns = _listAdd(this.indexPatterns, value, values); - return this; - } - - /** - * Required - An ordered list of component template names. Component templates - * are merged in the order specified, meaning that the last component template - * specified has the highest precedence. - *

- * API name: {@code composed_of} - *

- * Adds all elements of list to composedOf. - */ - public final Builder composedOf(List list) { - this.composedOf = _listAddAll(this.composedOf, list); - return this; - } - - /** - * Required - An ordered list of component template names. Component templates - * are merged in the order specified, meaning that the last component template - * specified has the highest precedence. - *

- * API name: {@code composed_of} - *

- * Adds one or more values to composedOf. - */ - public final Builder composedOf(String value, String... values) { - this.composedOf = _listAdd(this.composedOf, value, values); - return this; - } - - /** - * Template to be applied. It may optionally include an aliases, - * mappings, or settings configuration. - *

- * API name: {@code template} - */ - public final Builder template(@Nullable IndexTemplateSummary value) { - this.template = value; - return this; - } - - /** - * Template to be applied. It may optionally include an aliases, - * mappings, or settings configuration. - *

- * API name: {@code template} - */ - public final Builder template(Function> fn) { - return this.template(fn.apply(new IndexTemplateSummary.Builder()).build()); - } - - /** - * Version number used to manage index templates externally. This number is not - * automatically generated by Elasticsearch. - *

- * API name: {@code version} - */ - public final Builder version(@Nullable Long value) { - this.version = value; - return this; - } - - /** - * Priority to determine index template precedence when a new data stream or - * index is created. The index template with the highest priority is chosen. If - * no priority is specified the template is treated as though it is of priority - * 0 (lowest priority). This number is not automatically generated by - * Elasticsearch. - *

- * API name: {@code priority} - */ - public final Builder priority(@Nullable Long value) { - this.priority = value; - return this; - } - - /** - * Optional user metadata about the index template. May have any contents. This - * map is not automatically generated by Elasticsearch. - *

- * API name: {@code _meta} - *

- * Adds all entries of map to meta. - */ - public final Builder meta(Map map) { - this.meta = _mapPutAll(this.meta, map); - return this; - } - - /** - * Optional user metadata about the index template. May have any contents. This - * map is not automatically generated by Elasticsearch. - *

- * API name: {@code _meta} - *

- * Adds an entry to meta. - */ - public final Builder meta(String key, JsonData value) { - this.meta = _mapPut(this.meta, key, value); - return this; - } - - /** - * API name: {@code allow_auto_create} - */ - public final Builder allowAutoCreate(@Nullable Boolean value) { - this.allowAutoCreate = value; - return this; - } - - /** - * If this object is included, the template is used to create data streams and - * their backing indices. Supports an empty object. Data streams require a - * matching index template with a data_stream object. - *

- * API name: {@code data_stream} - */ - public final Builder dataStream(@Nullable IndexTemplateDataStreamConfiguration value) { - this.dataStream = value; - return this; - } - - /** - * If this object is included, the template is used to create data streams and - * their backing indices. Supports an empty object. Data streams require a - * matching index template with a data_stream object. - *

- * API name: {@code data_stream} - */ - public final Builder dataStream( - Function> fn) { - return this.dataStream(fn.apply(new IndexTemplateDataStreamConfiguration.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexTemplate}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexTemplate build() { - _checkSingleUse(); - - return new IndexTemplate(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexTemplate} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - IndexTemplate::setupIndexTemplateDeserializer); - - protected static void setupIndexTemplateDeserializer(ObjectDeserializer op) { - - op.add(Builder::indexPatterns, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "index_patterns"); - op.add(Builder::composedOf, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "composed_of"); - op.add(Builder::template, IndexTemplateSummary._DESERIALIZER, "template"); - op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version"); - op.add(Builder::priority, JsonpDeserializer.longDeserializer(), "priority"); - op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta"); - op.add(Builder::allowAutoCreate, JsonpDeserializer.booleanDeserializer(), "allow_auto_create"); - op.add(Builder::dataStream, IndexTemplateDataStreamConfiguration._DESERIALIZER, "data_stream"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplateDataStreamConfiguration.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplateDataStreamConfiguration.java deleted file mode 100644 index db010925a..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplateDataStreamConfiguration.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexTemplateDataStreamConfiguration - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexTemplateDataStreamConfiguration implements JsonpSerializable { - @Nullable - private final Boolean hidden; - - @Nullable - private final Boolean allowCustomRouting; - - // --------------------------------------------------------------------------------------------- - - private IndexTemplateDataStreamConfiguration(Builder builder) { - - this.hidden = builder.hidden; - this.allowCustomRouting = builder.allowCustomRouting; - - } - - public static IndexTemplateDataStreamConfiguration of( - Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If true, the data stream is hidden. - *

- * API name: {@code hidden} - */ - @Nullable - public final Boolean hidden() { - return this.hidden; - } - - /** - * If true, the data stream supports custom routing. - *

- * API name: {@code allow_custom_routing} - */ - @Nullable - public final Boolean allowCustomRouting() { - return this.allowCustomRouting; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.hidden != null) { - generator.writeKey("hidden"); - generator.write(this.hidden); - - } - if (this.allowCustomRouting != null) { - generator.writeKey("allow_custom_routing"); - generator.write(this.allowCustomRouting); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexTemplateDataStreamConfiguration}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Boolean hidden; - - @Nullable - private Boolean allowCustomRouting; - - /** - * If true, the data stream is hidden. - *

- * API name: {@code hidden} - */ - public final Builder hidden(@Nullable Boolean value) { - this.hidden = value; - return this; - } - - /** - * If true, the data stream supports custom routing. - *

- * API name: {@code allow_custom_routing} - */ - public final Builder allowCustomRouting(@Nullable Boolean value) { - this.allowCustomRouting = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexTemplateDataStreamConfiguration}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexTemplateDataStreamConfiguration build() { - _checkSingleUse(); - - return new IndexTemplateDataStreamConfiguration(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexTemplateDataStreamConfiguration} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, - IndexTemplateDataStreamConfiguration::setupIndexTemplateDataStreamConfigurationDeserializer); - - protected static void setupIndexTemplateDataStreamConfigurationDeserializer( - ObjectDeserializer op) { - - op.add(Builder::hidden, JsonpDeserializer.booleanDeserializer(), "hidden"); - op.add(Builder::allowCustomRouting, JsonpDeserializer.booleanDeserializer(), "allow_custom_routing"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplateSummary.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplateSummary.java deleted file mode 100644 index cccd8686e..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplateSummary.java +++ /dev/null @@ -1,333 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexTemplateSummary - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexTemplateSummary implements JsonpSerializable { - private final Map aliases; - - @Nullable - private final TypeMapping mappings; - - @Nullable - private final IndexSettings settings; - - @Nullable - private final DataStreamLifecycleWithRollover lifecycle; - - // --------------------------------------------------------------------------------------------- - - private IndexTemplateSummary(Builder builder) { - - this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); - this.mappings = builder.mappings; - this.settings = builder.settings; - this.lifecycle = builder.lifecycle; - - } - - public static IndexTemplateSummary of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Aliases to add. If the index template includes a data_stream - * object, these are data stream aliases. Otherwise, these are index aliases. - * Data stream aliases ignore the index_routing, - * routing, and search_routing options. - *

- * API name: {@code aliases} - */ - public final Map aliases() { - return this.aliases; - } - - /** - * Mapping for fields in the index. If specified, this mapping can include field - * names, field data types, and mapping parameters. - *

- * API name: {@code mappings} - */ - @Nullable - public final TypeMapping mappings() { - return this.mappings; - } - - /** - * Configuration options for the index. - *

- * API name: {@code settings} - */ - @Nullable - public final IndexSettings settings() { - return this.settings; - } - - /** - * API name: {@code lifecycle} - */ - @Nullable - public final DataStreamLifecycleWithRollover lifecycle() { - return this.lifecycle; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.aliases)) { - generator.writeKey("aliases"); - generator.writeStartObject(); - for (Map.Entry item0 : this.aliases.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.mappings != null) { - generator.writeKey("mappings"); - this.mappings.serialize(generator, mapper); - - } - if (this.settings != null) { - generator.writeKey("settings"); - this.settings.serialize(generator, mapper); - - } - if (this.lifecycle != null) { - generator.writeKey("lifecycle"); - this.lifecycle.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexTemplateSummary}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Map aliases; - - @Nullable - private TypeMapping mappings; - - @Nullable - private IndexSettings settings; - - @Nullable - private DataStreamLifecycleWithRollover lifecycle; - - /** - * Aliases to add. If the index template includes a data_stream - * object, these are data stream aliases. Otherwise, these are index aliases. - * Data stream aliases ignore the index_routing, - * routing, and search_routing options. - *

- * API name: {@code aliases} - *

- * Adds all entries of map to aliases. - */ - public final Builder aliases(Map map) { - this.aliases = _mapPutAll(this.aliases, map); - return this; - } - - /** - * Aliases to add. If the index template includes a data_stream - * object, these are data stream aliases. Otherwise, these are index aliases. - * Data stream aliases ignore the index_routing, - * routing, and search_routing options. - *

- * API name: {@code aliases} - *

- * Adds an entry to aliases. - */ - public final Builder aliases(String key, Alias value) { - this.aliases = _mapPut(this.aliases, key, value); - return this; - } - - /** - * Aliases to add. If the index template includes a data_stream - * object, these are data stream aliases. Otherwise, these are index aliases. - * Data stream aliases ignore the index_routing, - * routing, and search_routing options. - *

- * API name: {@code aliases} - *

- * Adds an entry to aliases using a builder lambda. - */ - public final Builder aliases(String key, Function> fn) { - return aliases(key, fn.apply(new Alias.Builder()).build()); - } - - /** - * Mapping for fields in the index. If specified, this mapping can include field - * names, field data types, and mapping parameters. - *

- * API name: {@code mappings} - */ - public final Builder mappings(@Nullable TypeMapping value) { - this.mappings = value; - return this; - } - - /** - * Mapping for fields in the index. If specified, this mapping can include field - * names, field data types, and mapping parameters. - *

- * API name: {@code mappings} - */ - public final Builder mappings(Function> fn) { - return this.mappings(fn.apply(new TypeMapping.Builder()).build()); - } - - /** - * Configuration options for the index. - *

- * API name: {@code settings} - */ - public final Builder settings(@Nullable IndexSettings value) { - this.settings = value; - return this; - } - - /** - * Configuration options for the index. - *

- * API name: {@code settings} - */ - public final Builder settings(Function> fn) { - return this.settings(fn.apply(new IndexSettings.Builder()).build()); - } - - /** - * API name: {@code lifecycle} - */ - public final Builder lifecycle(@Nullable DataStreamLifecycleWithRollover value) { - this.lifecycle = value; - return this; - } - - /** - * API name: {@code lifecycle} - */ - public final Builder lifecycle( - Function> fn) { - return this.lifecycle(fn.apply(new DataStreamLifecycleWithRollover.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexTemplateSummary}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexTemplateSummary build() { - _checkSingleUse(); - - return new IndexTemplateSummary(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexTemplateSummary} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndexTemplateSummary::setupIndexTemplateSummaryDeserializer); - - protected static void setupIndexTemplateSummaryDeserializer(ObjectDeserializer op) { - - op.add(Builder::aliases, JsonpDeserializer.stringMapDeserializer(Alias._DESERIALIZER), "aliases"); - op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings"); - op.add(Builder::settings, IndexSettings._DESERIALIZER, "settings"); - op.add(Builder::lifecycle, DataStreamLifecycleWithRollover._DESERIALIZER, "lifecycle"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexVersioning.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexVersioning.java deleted file mode 100644 index 5a3a1527a..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexVersioning.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexVersioning - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexVersioning implements JsonpSerializable { - @Nullable - private final String created; - - @Nullable - private final String createdString; - - // --------------------------------------------------------------------------------------------- - - private IndexVersioning(Builder builder) { - - this.created = builder.created; - this.createdString = builder.createdString; - - } - - public static IndexVersioning of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code created} - */ - @Nullable - public final String created() { - return this.created; - } - - /** - * API name: {@code created_string} - */ - @Nullable - public final String createdString() { - return this.createdString; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.created != null) { - generator.writeKey("created"); - generator.write(this.created); - - } - if (this.createdString != null) { - generator.writeKey("created_string"); - generator.write(this.createdString); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexVersioning}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private String created; - - @Nullable - private String createdString; - - /** - * API name: {@code created} - */ - public final Builder created(@Nullable String value) { - this.created = value; - return this; - } - - /** - * API name: {@code created_string} - */ - public final Builder createdString(@Nullable String value) { - this.createdString = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexVersioning}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexVersioning build() { - _checkSingleUse(); - - return new IndexVersioning(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexVersioning} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - IndexVersioning::setupIndexVersioningDeserializer); - - protected static void setupIndexVersioningDeserializer(ObjectDeserializer op) { - - op.add(Builder::created, JsonpDeserializer.stringDeserializer(), "created"); - op.add(Builder::createdString, JsonpDeserializer.stringDeserializer(), "created_string"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingPressure.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingPressure.java deleted file mode 100644 index 5d51352ce..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingPressure.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexingPressure - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexingPressure implements JsonpSerializable { - private final IndexingPressureMemory memory; - - // --------------------------------------------------------------------------------------------- - - private IndexingPressure(Builder builder) { - - this.memory = ApiTypeHelper.requireNonNull(builder.memory, this, "memory"); - - } - - public static IndexingPressure of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code memory} - */ - public final IndexingPressureMemory memory() { - return this.memory; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("memory"); - this.memory.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexingPressure}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private IndexingPressureMemory memory; - - /** - * Required - API name: {@code memory} - */ - public final Builder memory(IndexingPressureMemory value) { - this.memory = value; - return this; - } - - /** - * Required - API name: {@code memory} - */ - public final Builder memory( - Function> fn) { - return this.memory(fn.apply(new IndexingPressureMemory.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexingPressure}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexingPressure build() { - _checkSingleUse(); - - return new IndexingPressure(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexingPressure} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - IndexingPressure::setupIndexingPressureDeserializer); - - protected static void setupIndexingPressureDeserializer(ObjectDeserializer op) { - - op.add(Builder::memory, IndexingPressureMemory._DESERIALIZER, "memory"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingPressureMemory.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingPressureMemory.java deleted file mode 100644 index bba23689f..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingPressureMemory.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexingPressureMemory - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexingPressureMemory implements JsonpSerializable { - @Nullable - private final Integer limit; - - // --------------------------------------------------------------------------------------------- - - private IndexingPressureMemory(Builder builder) { - - this.limit = builder.limit; - - } - - public static IndexingPressureMemory of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Number of outstanding bytes that may be consumed by indexing requests. When - * this limit is reached or exceeded, the node will reject new coordinating and - * primary operations. When replica operations consume 1.5x this limit, the node - * will reject new replica operations. Defaults to 10% of the heap. - *

- * API name: {@code limit} - */ - @Nullable - public final Integer limit() { - return this.limit; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.limit != null) { - generator.writeKey("limit"); - generator.write(this.limit); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexingPressureMemory}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Integer limit; - - /** - * Number of outstanding bytes that may be consumed by indexing requests. When - * this limit is reached or exceeded, the node will reject new coordinating and - * primary operations. When replica operations consume 1.5x this limit, the node - * will reject new replica operations. Defaults to 10% of the heap. - *

- * API name: {@code limit} - */ - public final Builder limit(@Nullable Integer value) { - this.limit = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexingPressureMemory}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexingPressureMemory build() { - _checkSingleUse(); - - return new IndexingPressureMemory(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexingPressureMemory} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndexingPressureMemory::setupIndexingPressureMemoryDeserializer); - - protected static void setupIndexingPressureMemoryDeserializer( - ObjectDeserializer op) { - - op.add(Builder::limit, JsonpDeserializer.integerDeserializer(), "limit"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingSlowlogSettings.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingSlowlogSettings.java deleted file mode 100644 index abb2011eb..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingSlowlogSettings.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Integer; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexingSlowlogSettings - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexingSlowlogSettings implements JsonpSerializable { - @Nullable - private final String level; - - @Nullable - private final Integer source; - - @Nullable - private final Boolean reformat; - - @Nullable - private final IndexingSlowlogTresholds threshold; - - // --------------------------------------------------------------------------------------------- - - private IndexingSlowlogSettings(Builder builder) { - - this.level = builder.level; - this.source = builder.source; - this.reformat = builder.reformat; - this.threshold = builder.threshold; - - } - - public static IndexingSlowlogSettings of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code level} - */ - @Nullable - public final String level() { - return this.level; - } - - /** - * API name: {@code source} - */ - @Nullable - public final Integer source() { - return this.source; - } - - /** - * API name: {@code reformat} - */ - @Nullable - public final Boolean reformat() { - return this.reformat; - } - - /** - * API name: {@code threshold} - */ - @Nullable - public final IndexingSlowlogTresholds threshold() { - return this.threshold; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.level != null) { - generator.writeKey("level"); - generator.write(this.level); - - } - if (this.source != null) { - generator.writeKey("source"); - generator.write(this.source); - - } - if (this.reformat != null) { - generator.writeKey("reformat"); - generator.write(this.reformat); - - } - if (this.threshold != null) { - generator.writeKey("threshold"); - this.threshold.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexingSlowlogSettings}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private String level; - - @Nullable - private Integer source; - - @Nullable - private Boolean reformat; - - @Nullable - private IndexingSlowlogTresholds threshold; - - /** - * API name: {@code level} - */ - public final Builder level(@Nullable String value) { - this.level = value; - return this; - } - - /** - * API name: {@code source} - */ - public final Builder source(@Nullable Integer value) { - this.source = value; - return this; - } - - /** - * API name: {@code reformat} - */ - public final Builder reformat(@Nullable Boolean value) { - this.reformat = value; - return this; - } - - /** - * API name: {@code threshold} - */ - public final Builder threshold(@Nullable IndexingSlowlogTresholds value) { - this.threshold = value; - return this; - } - - /** - * API name: {@code threshold} - */ - public final Builder threshold( - Function> fn) { - return this.threshold(fn.apply(new IndexingSlowlogTresholds.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexingSlowlogSettings}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexingSlowlogSettings build() { - _checkSingleUse(); - - return new IndexingSlowlogSettings(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexingSlowlogSettings} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndexingSlowlogSettings::setupIndexingSlowlogSettingsDeserializer); - - protected static void setupIndexingSlowlogSettingsDeserializer( - ObjectDeserializer op) { - - op.add(Builder::level, JsonpDeserializer.stringDeserializer(), "level"); - op.add(Builder::source, JsonpDeserializer.integerDeserializer(), "source"); - op.add(Builder::reformat, JsonpDeserializer.booleanDeserializer(), "reformat"); - op.add(Builder::threshold, IndexingSlowlogTresholds._DESERIALIZER, "threshold"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingSlowlogTresholds.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingSlowlogTresholds.java deleted file mode 100644 index b46b97a73..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingSlowlogTresholds.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.IndexingSlowlogTresholds - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexingSlowlogTresholds implements JsonpSerializable { - @Nullable - private final SlowlogTresholdLevels index; - - // --------------------------------------------------------------------------------------------- - - private IndexingSlowlogTresholds(Builder builder) { - - this.index = builder.index; - - } - - public static IndexingSlowlogTresholds of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * The indexing slow log, similar in functionality to the search slow log. The - * log file name ends with _index_indexing_slowlog.json. Log and - * the thresholds are configured in the same way as the search slowlog. - *

- * API name: {@code index} - */ - @Nullable - public final SlowlogTresholdLevels index() { - return this.index; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.index != null) { - generator.writeKey("index"); - this.index.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexingSlowlogTresholds}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private SlowlogTresholdLevels index; - - /** - * The indexing slow log, similar in functionality to the search slow log. The - * log file name ends with _index_indexing_slowlog.json. Log and - * the thresholds are configured in the same way as the search slowlog. - *

- * API name: {@code index} - */ - public final Builder index(@Nullable SlowlogTresholdLevels value) { - this.index = value; - return this; - } - - /** - * The indexing slow log, similar in functionality to the search slow log. The - * log file name ends with _index_indexing_slowlog.json. Log and - * the thresholds are configured in the same way as the search slowlog. - *

- * API name: {@code index} - */ - public final Builder index(Function> fn) { - return this.index(fn.apply(new SlowlogTresholdLevels.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexingSlowlogTresholds}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexingSlowlogTresholds build() { - _checkSingleUse(); - - return new IndexingSlowlogTresholds(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexingSlowlogTresholds} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndexingSlowlogTresholds::setupIndexingSlowlogTresholdsDeserializer); - - protected static void setupIndexingSlowlogTresholdsDeserializer( - ObjectDeserializer op) { - - op.add(Builder::index, SlowlogTresholdLevels._DESERIALIZER, "index"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ManagedBy.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ManagedBy.java deleted file mode 100644 index e76a4cd5c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ManagedBy.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum ManagedBy implements JsonEnum { - Ilm("Index Lifecycle Management"), - - Datastream("Data stream lifecycle"), - - Unmanaged("Unmanaged"), - - ; - - private final String jsonValue; - - ManagedBy(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - ManagedBy.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettings.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettings.java deleted file mode 100644 index f6848141d..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettings.java +++ /dev/null @@ -1,416 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.MappingLimitSettings - -/** - * Mapping Limit Settings - * - * @see Documentation - * on elastic.co - * @see API - * specification - */ -@JsonpDeserializable -public class MappingLimitSettings implements JsonpSerializable { - @Nullable - private final Boolean coerce; - - @Nullable - private final MappingLimitSettingsTotalFields totalFields; - - @Nullable - private final MappingLimitSettingsDepth depth; - - @Nullable - private final MappingLimitSettingsNestedFields nestedFields; - - @Nullable - private final MappingLimitSettingsNestedObjects nestedObjects; - - @Nullable - private final MappingLimitSettingsFieldNameLength fieldNameLength; - - @Nullable - private final MappingLimitSettingsDimensionFields dimensionFields; - - @Nullable - private final Boolean ignoreMalformed; - - // --------------------------------------------------------------------------------------------- - - private MappingLimitSettings(Builder builder) { - - this.coerce = builder.coerce; - this.totalFields = builder.totalFields; - this.depth = builder.depth; - this.nestedFields = builder.nestedFields; - this.nestedObjects = builder.nestedObjects; - this.fieldNameLength = builder.fieldNameLength; - this.dimensionFields = builder.dimensionFields; - this.ignoreMalformed = builder.ignoreMalformed; - - } - - public static MappingLimitSettings of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code coerce} - */ - @Nullable - public final Boolean coerce() { - return this.coerce; - } - - /** - * API name: {@code total_fields} - */ - @Nullable - public final MappingLimitSettingsTotalFields totalFields() { - return this.totalFields; - } - - /** - * API name: {@code depth} - */ - @Nullable - public final MappingLimitSettingsDepth depth() { - return this.depth; - } - - /** - * API name: {@code nested_fields} - */ - @Nullable - public final MappingLimitSettingsNestedFields nestedFields() { - return this.nestedFields; - } - - /** - * API name: {@code nested_objects} - */ - @Nullable - public final MappingLimitSettingsNestedObjects nestedObjects() { - return this.nestedObjects; - } - - /** - * API name: {@code field_name_length} - */ - @Nullable - public final MappingLimitSettingsFieldNameLength fieldNameLength() { - return this.fieldNameLength; - } - - /** - * API name: {@code dimension_fields} - */ - @Nullable - public final MappingLimitSettingsDimensionFields dimensionFields() { - return this.dimensionFields; - } - - /** - * API name: {@code ignore_malformed} - */ - @Nullable - public final Boolean ignoreMalformed() { - return this.ignoreMalformed; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.coerce != null) { - generator.writeKey("coerce"); - generator.write(this.coerce); - - } - if (this.totalFields != null) { - generator.writeKey("total_fields"); - this.totalFields.serialize(generator, mapper); - - } - if (this.depth != null) { - generator.writeKey("depth"); - this.depth.serialize(generator, mapper); - - } - if (this.nestedFields != null) { - generator.writeKey("nested_fields"); - this.nestedFields.serialize(generator, mapper); - - } - if (this.nestedObjects != null) { - generator.writeKey("nested_objects"); - this.nestedObjects.serialize(generator, mapper); - - } - if (this.fieldNameLength != null) { - generator.writeKey("field_name_length"); - this.fieldNameLength.serialize(generator, mapper); - - } - if (this.dimensionFields != null) { - generator.writeKey("dimension_fields"); - this.dimensionFields.serialize(generator, mapper); - - } - if (this.ignoreMalformed != null) { - generator.writeKey("ignore_malformed"); - generator.write(this.ignoreMalformed); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link MappingLimitSettings}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Boolean coerce; - - @Nullable - private MappingLimitSettingsTotalFields totalFields; - - @Nullable - private MappingLimitSettingsDepth depth; - - @Nullable - private MappingLimitSettingsNestedFields nestedFields; - - @Nullable - private MappingLimitSettingsNestedObjects nestedObjects; - - @Nullable - private MappingLimitSettingsFieldNameLength fieldNameLength; - - @Nullable - private MappingLimitSettingsDimensionFields dimensionFields; - - @Nullable - private Boolean ignoreMalformed; - - /** - * API name: {@code coerce} - */ - public final Builder coerce(@Nullable Boolean value) { - this.coerce = value; - return this; - } - - /** - * API name: {@code total_fields} - */ - public final Builder totalFields(@Nullable MappingLimitSettingsTotalFields value) { - this.totalFields = value; - return this; - } - - /** - * API name: {@code total_fields} - */ - public final Builder totalFields( - Function> fn) { - return this.totalFields(fn.apply(new MappingLimitSettingsTotalFields.Builder()).build()); - } - - /** - * API name: {@code depth} - */ - public final Builder depth(@Nullable MappingLimitSettingsDepth value) { - this.depth = value; - return this; - } - - /** - * API name: {@code depth} - */ - public final Builder depth( - Function> fn) { - return this.depth(fn.apply(new MappingLimitSettingsDepth.Builder()).build()); - } - - /** - * API name: {@code nested_fields} - */ - public final Builder nestedFields(@Nullable MappingLimitSettingsNestedFields value) { - this.nestedFields = value; - return this; - } - - /** - * API name: {@code nested_fields} - */ - public final Builder nestedFields( - Function> fn) { - return this.nestedFields(fn.apply(new MappingLimitSettingsNestedFields.Builder()).build()); - } - - /** - * API name: {@code nested_objects} - */ - public final Builder nestedObjects(@Nullable MappingLimitSettingsNestedObjects value) { - this.nestedObjects = value; - return this; - } - - /** - * API name: {@code nested_objects} - */ - public final Builder nestedObjects( - Function> fn) { - return this.nestedObjects(fn.apply(new MappingLimitSettingsNestedObjects.Builder()).build()); - } - - /** - * API name: {@code field_name_length} - */ - public final Builder fieldNameLength(@Nullable MappingLimitSettingsFieldNameLength value) { - this.fieldNameLength = value; - return this; - } - - /** - * API name: {@code field_name_length} - */ - public final Builder fieldNameLength( - Function> fn) { - return this.fieldNameLength(fn.apply(new MappingLimitSettingsFieldNameLength.Builder()).build()); - } - - /** - * API name: {@code dimension_fields} - */ - public final Builder dimensionFields(@Nullable MappingLimitSettingsDimensionFields value) { - this.dimensionFields = value; - return this; - } - - /** - * API name: {@code dimension_fields} - */ - public final Builder dimensionFields( - Function> fn) { - return this.dimensionFields(fn.apply(new MappingLimitSettingsDimensionFields.Builder()).build()); - } - - /** - * API name: {@code ignore_malformed} - */ - public final Builder ignoreMalformed(@Nullable Boolean value) { - this.ignoreMalformed = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link MappingLimitSettings}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public MappingLimitSettings build() { - _checkSingleUse(); - - return new MappingLimitSettings(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link MappingLimitSettings} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, MappingLimitSettings::setupMappingLimitSettingsDeserializer); - - protected static void setupMappingLimitSettingsDeserializer(ObjectDeserializer op) { - - op.add(Builder::coerce, JsonpDeserializer.booleanDeserializer(), "coerce"); - op.add(Builder::totalFields, MappingLimitSettingsTotalFields._DESERIALIZER, "total_fields"); - op.add(Builder::depth, MappingLimitSettingsDepth._DESERIALIZER, "depth"); - op.add(Builder::nestedFields, MappingLimitSettingsNestedFields._DESERIALIZER, "nested_fields"); - op.add(Builder::nestedObjects, MappingLimitSettingsNestedObjects._DESERIALIZER, "nested_objects"); - op.add(Builder::fieldNameLength, MappingLimitSettingsFieldNameLength._DESERIALIZER, "field_name_length"); - op.add(Builder::dimensionFields, MappingLimitSettingsDimensionFields._DESERIALIZER, "dimension_fields"); - op.add(Builder::ignoreMalformed, JsonpDeserializer.booleanDeserializer(), "ignore_malformed"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDepth.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDepth.java deleted file mode 100644 index 61b93c9ce..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDepth.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.MappingLimitSettingsDepth - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class MappingLimitSettingsDepth implements JsonpSerializable { - @Nullable - private final Long limit; - - // --------------------------------------------------------------------------------------------- - - private MappingLimitSettingsDepth(Builder builder) { - - this.limit = builder.limit; - - } - - public static MappingLimitSettingsDepth of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * The maximum depth for a field, which is measured as the number of inner - * objects. For instance, if all fields are defined at the root object level, - * then the depth is 1. If there is one object mapping, then the depth is 2, - * etc. - *

- * API name: {@code limit} - */ - @Nullable - public final Long limit() { - return this.limit; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.limit != null) { - generator.writeKey("limit"); - generator.write(this.limit); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link MappingLimitSettingsDepth}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Long limit; - - /** - * The maximum depth for a field, which is measured as the number of inner - * objects. For instance, if all fields are defined at the root object level, - * then the depth is 1. If there is one object mapping, then the depth is 2, - * etc. - *

- * API name: {@code limit} - */ - public final Builder limit(@Nullable Long value) { - this.limit = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link MappingLimitSettingsDepth}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public MappingLimitSettingsDepth build() { - _checkSingleUse(); - - return new MappingLimitSettingsDepth(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link MappingLimitSettingsDepth} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, MappingLimitSettingsDepth::setupMappingLimitSettingsDepthDeserializer); - - protected static void setupMappingLimitSettingsDepthDeserializer( - ObjectDeserializer op) { - - op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDimensionFields.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDimensionFields.java deleted file mode 100644 index 52de5458e..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDimensionFields.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.MappingLimitSettingsDimensionFields - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class MappingLimitSettingsDimensionFields implements JsonpSerializable { - @Nullable - private final Long limit; - - // --------------------------------------------------------------------------------------------- - - private MappingLimitSettingsDimensionFields(Builder builder) { - - this.limit = builder.limit; - - } - - public static MappingLimitSettingsDimensionFields of( - Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * [preview] This functionality is in technical preview and may be changed or - * removed in a future release. Elastic will work to fix any issues, but - * features in technical preview are not subject to the support SLA of official - * GA features. - *

- * API name: {@code limit} - */ - @Nullable - public final Long limit() { - return this.limit; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.limit != null) { - generator.writeKey("limit"); - generator.write(this.limit); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link MappingLimitSettingsDimensionFields}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Long limit; - - /** - * [preview] This functionality is in technical preview and may be changed or - * removed in a future release. Elastic will work to fix any issues, but - * features in technical preview are not subject to the support SLA of official - * GA features. - *

- * API name: {@code limit} - */ - public final Builder limit(@Nullable Long value) { - this.limit = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link MappingLimitSettingsDimensionFields}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public MappingLimitSettingsDimensionFields build() { - _checkSingleUse(); - - return new MappingLimitSettingsDimensionFields(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link MappingLimitSettingsDimensionFields} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, - MappingLimitSettingsDimensionFields::setupMappingLimitSettingsDimensionFieldsDeserializer); - - protected static void setupMappingLimitSettingsDimensionFieldsDeserializer( - ObjectDeserializer op) { - - op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsFieldNameLength.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsFieldNameLength.java deleted file mode 100644 index d268bd7f0..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsFieldNameLength.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.MappingLimitSettingsFieldNameLength - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class MappingLimitSettingsFieldNameLength implements JsonpSerializable { - @Nullable - private final Long limit; - - // --------------------------------------------------------------------------------------------- - - private MappingLimitSettingsFieldNameLength(Builder builder) { - - this.limit = builder.limit; - - } - - public static MappingLimitSettingsFieldNameLength of( - Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Setting for the maximum length of a field name. This setting isn’t really - * something that addresses mappings explosion but might still be useful if you - * want to limit the field length. It usually shouldn’t be necessary to set this - * setting. The default is okay unless a user starts to add a huge number of - * fields with really long names. Default is Long.MAX_VALUE (no - * limit). - *

- * API name: {@code limit} - */ - @Nullable - public final Long limit() { - return this.limit; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.limit != null) { - generator.writeKey("limit"); - generator.write(this.limit); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link MappingLimitSettingsFieldNameLength}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Long limit; - - /** - * Setting for the maximum length of a field name. This setting isn’t really - * something that addresses mappings explosion but might still be useful if you - * want to limit the field length. It usually shouldn’t be necessary to set this - * setting. The default is okay unless a user starts to add a huge number of - * fields with really long names. Default is Long.MAX_VALUE (no - * limit). - *

- * API name: {@code limit} - */ - public final Builder limit(@Nullable Long value) { - this.limit = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link MappingLimitSettingsFieldNameLength}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public MappingLimitSettingsFieldNameLength build() { - _checkSingleUse(); - - return new MappingLimitSettingsFieldNameLength(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link MappingLimitSettingsFieldNameLength} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, - MappingLimitSettingsFieldNameLength::setupMappingLimitSettingsFieldNameLengthDeserializer); - - protected static void setupMappingLimitSettingsFieldNameLengthDeserializer( - ObjectDeserializer op) { - - op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedFields.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedFields.java deleted file mode 100644 index 7bff31845..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedFields.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.MappingLimitSettingsNestedFields - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class MappingLimitSettingsNestedFields implements JsonpSerializable { - @Nullable - private final Long limit; - - // --------------------------------------------------------------------------------------------- - - private MappingLimitSettingsNestedFields(Builder builder) { - - this.limit = builder.limit; - - } - - public static MappingLimitSettingsNestedFields of( - Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * The maximum number of distinct nested mappings in an index. The nested type - * should only be used in special cases, when arrays of objects need to be - * queried independently of each other. To safeguard against poorly designed - * mappings, this setting limits the number of unique nested types per index. - *

- * API name: {@code limit} - */ - @Nullable - public final Long limit() { - return this.limit; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.limit != null) { - generator.writeKey("limit"); - generator.write(this.limit); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link MappingLimitSettingsNestedFields}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Long limit; - - /** - * The maximum number of distinct nested mappings in an index. The nested type - * should only be used in special cases, when arrays of objects need to be - * queried independently of each other. To safeguard against poorly designed - * mappings, this setting limits the number of unique nested types per index. - *

- * API name: {@code limit} - */ - public final Builder limit(@Nullable Long value) { - this.limit = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link MappingLimitSettingsNestedFields}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public MappingLimitSettingsNestedFields build() { - _checkSingleUse(); - - return new MappingLimitSettingsNestedFields(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link MappingLimitSettingsNestedFields} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, MappingLimitSettingsNestedFields::setupMappingLimitSettingsNestedFieldsDeserializer); - - protected static void setupMappingLimitSettingsNestedFieldsDeserializer( - ObjectDeserializer op) { - - op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedObjects.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedObjects.java deleted file mode 100644 index d29c6b76a..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedObjects.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.MappingLimitSettingsNestedObjects - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class MappingLimitSettingsNestedObjects implements JsonpSerializable { - @Nullable - private final Long limit; - - // --------------------------------------------------------------------------------------------- - - private MappingLimitSettingsNestedObjects(Builder builder) { - - this.limit = builder.limit; - - } - - public static MappingLimitSettingsNestedObjects of( - Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * The maximum number of nested JSON objects that a single document can contain - * across all nested types. This limit helps to prevent out of memory errors - * when a document contains too many nested objects. - *

- * API name: {@code limit} - */ - @Nullable - public final Long limit() { - return this.limit; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.limit != null) { - generator.writeKey("limit"); - generator.write(this.limit); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link MappingLimitSettingsNestedObjects}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Long limit; - - /** - * The maximum number of nested JSON objects that a single document can contain - * across all nested types. This limit helps to prevent out of memory errors - * when a document contains too many nested objects. - *

- * API name: {@code limit} - */ - public final Builder limit(@Nullable Long value) { - this.limit = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link MappingLimitSettingsNestedObjects}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public MappingLimitSettingsNestedObjects build() { - _checkSingleUse(); - - return new MappingLimitSettingsNestedObjects(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link MappingLimitSettingsNestedObjects} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, MappingLimitSettingsNestedObjects::setupMappingLimitSettingsNestedObjectsDeserializer); - - protected static void setupMappingLimitSettingsNestedObjectsDeserializer( - ObjectDeserializer op) { - - op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsTotalFields.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsTotalFields.java deleted file mode 100644 index ace492270..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsTotalFields.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Long; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.MappingLimitSettingsTotalFields - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class MappingLimitSettingsTotalFields implements JsonpSerializable { - @Nullable - private final Long limit; - - @Nullable - private final Boolean ignoreDynamicBeyondLimit; - - // --------------------------------------------------------------------------------------------- - - private MappingLimitSettingsTotalFields(Builder builder) { - - this.limit = builder.limit; - this.ignoreDynamicBeyondLimit = builder.ignoreDynamicBeyondLimit; - - } - - public static MappingLimitSettingsTotalFields of( - Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * The maximum number of fields in an index. Field and object mappings, as well - * as field aliases count towards this limit. The limit is in place to prevent - * mappings and searches from becoming too large. Higher values can lead to - * performance degradations and memory issues, especially in clusters with a - * high load or few resources. - *

- * API name: {@code limit} - */ - @Nullable - public final Long limit() { - return this.limit; - } - - /** - * This setting determines what happens when a dynamically mapped field would - * exceed the total fields limit. When set to false (the default), the index - * request of the document that tries to add a dynamic field to the mapping will - * fail with the message Limit of total fields [X] has been exceeded. When set - * to true, the index request will not fail. Instead, fields that would exceed - * the limit are not added to the mapping, similar to dynamic: false. The fields - * that were not added to the mapping will be added to the _ignored field. - *

- * API name: {@code ignore_dynamic_beyond_limit} - */ - @Nullable - public final Boolean ignoreDynamicBeyondLimit() { - return this.ignoreDynamicBeyondLimit; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.limit != null) { - generator.writeKey("limit"); - generator.write(this.limit); - - } - if (this.ignoreDynamicBeyondLimit != null) { - generator.writeKey("ignore_dynamic_beyond_limit"); - generator.write(this.ignoreDynamicBeyondLimit); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link MappingLimitSettingsTotalFields}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Long limit; - - @Nullable - private Boolean ignoreDynamicBeyondLimit; - - /** - * The maximum number of fields in an index. Field and object mappings, as well - * as field aliases count towards this limit. The limit is in place to prevent - * mappings and searches from becoming too large. Higher values can lead to - * performance degradations and memory issues, especially in clusters with a - * high load or few resources. - *

- * API name: {@code limit} - */ - public final Builder limit(@Nullable Long value) { - this.limit = value; - return this; - } - - /** - * This setting determines what happens when a dynamically mapped field would - * exceed the total fields limit. When set to false (the default), the index - * request of the document that tries to add a dynamic field to the mapping will - * fail with the message Limit of total fields [X] has been exceeded. When set - * to true, the index request will not fail. Instead, fields that would exceed - * the limit are not added to the mapping, similar to dynamic: false. The fields - * that were not added to the mapping will be added to the _ignored field. - *

- * API name: {@code ignore_dynamic_beyond_limit} - */ - public final Builder ignoreDynamicBeyondLimit(@Nullable Boolean value) { - this.ignoreDynamicBeyondLimit = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link MappingLimitSettingsTotalFields}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public MappingLimitSettingsTotalFields build() { - _checkSingleUse(); - - return new MappingLimitSettingsTotalFields(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link MappingLimitSettingsTotalFields} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, MappingLimitSettingsTotalFields::setupMappingLimitSettingsTotalFieldsDeserializer); - - protected static void setupMappingLimitSettingsTotalFieldsDeserializer( - ObjectDeserializer op) { - - op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); - op.add(Builder::ignoreDynamicBeyondLimit, JsonpDeserializer.booleanDeserializer(), - "ignore_dynamic_beyond_limit"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Merge.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Merge.java deleted file mode 100644 index d9e94b6c3..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Merge.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.Merge - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class Merge implements JsonpSerializable { - @Nullable - private final MergeScheduler scheduler; - - // --------------------------------------------------------------------------------------------- - - private Merge(Builder builder) { - - this.scheduler = builder.scheduler; - - } - - public static Merge of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code scheduler} - */ - @Nullable - public final MergeScheduler scheduler() { - return this.scheduler; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.scheduler != null) { - generator.writeKey("scheduler"); - this.scheduler.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link Merge}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private MergeScheduler scheduler; - - /** - * API name: {@code scheduler} - */ - public final Builder scheduler(@Nullable MergeScheduler value) { - this.scheduler = value; - return this; - } - - /** - * API name: {@code scheduler} - */ - public final Builder scheduler(Function> fn) { - return this.scheduler(fn.apply(new MergeScheduler.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link Merge}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public Merge build() { - _checkSingleUse(); - - return new Merge(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link Merge} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - Merge::setupMergeDeserializer); - - protected static void setupMergeDeserializer(ObjectDeserializer op) { - - op.add(Builder::scheduler, MergeScheduler._DESERIALIZER, "scheduler"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MergeScheduler.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MergeScheduler.java deleted file mode 100644 index caf86bbba..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MergeScheduler.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.MergeScheduler - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class MergeScheduler implements JsonpSerializable { - @Nullable - private final Integer maxThreadCount; - - @Nullable - private final Integer maxMergeCount; - - // --------------------------------------------------------------------------------------------- - - private MergeScheduler(Builder builder) { - - this.maxThreadCount = builder.maxThreadCount; - this.maxMergeCount = builder.maxMergeCount; - - } - - public static MergeScheduler of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code max_thread_count} - */ - @Nullable - public final Integer maxThreadCount() { - return this.maxThreadCount; - } - - /** - * API name: {@code max_merge_count} - */ - @Nullable - public final Integer maxMergeCount() { - return this.maxMergeCount; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.maxThreadCount != null) { - generator.writeKey("max_thread_count"); - generator.write(this.maxThreadCount); - - } - if (this.maxMergeCount != null) { - generator.writeKey("max_merge_count"); - generator.write(this.maxMergeCount); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link MergeScheduler}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private Integer maxThreadCount; - - @Nullable - private Integer maxMergeCount; - - /** - * API name: {@code max_thread_count} - */ - public final Builder maxThreadCount(@Nullable Integer value) { - this.maxThreadCount = value; - return this; - } - - /** - * API name: {@code max_merge_count} - */ - public final Builder maxMergeCount(@Nullable Integer value) { - this.maxMergeCount = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link MergeScheduler}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public MergeScheduler build() { - _checkSingleUse(); - - return new MergeScheduler(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link MergeScheduler} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - MergeScheduler::setupMergeSchedulerDeserializer); - - protected static void setupMergeSchedulerDeserializer(ObjectDeserializer op) { - - op.add(Builder::maxThreadCount, JsonpDeserializer.integerDeserializer(), "max_thread_count"); - op.add(Builder::maxMergeCount, JsonpDeserializer.integerDeserializer(), "max_merge_count"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MigrateToDataStreamRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MigrateToDataStreamRequest.java deleted file mode 100644 index 6ad2f1b32..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MigrateToDataStreamRequest.java +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.migrate_to_data_stream.Request - -/** - * Convert an index alias to a data stream. Converts an index alias to a data - * stream. You must have a matching index template that is data stream enabled. - * The alias must meet the following criteria: The alias must have a write - * index; All indices for the alias must have a @timestamp field - * mapping of a date or date_nanos field type; The - * alias must not have any filters; The alias must not use custom routing. If - * successful, the request removes the alias and creates a data stream with the - * same name. The indices for the alias become hidden backing indices for the - * stream. The write index for the alias becomes the write index for the stream. - * - * @see API - * specification - */ - -public class MigrateToDataStreamRequest extends RequestBase { - @Nullable - private final Time masterTimeout; - - private final String name; - - @Nullable - private final Time timeout; - - // --------------------------------------------------------------------------------------------- - - private MigrateToDataStreamRequest(Builder builder) { - - this.masterTimeout = builder.masterTimeout; - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.timeout = builder.timeout; - - } - - public static MigrateToDataStreamRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Required - Name of the index alias to convert to a data stream. - *

- * API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link MigrateToDataStreamRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Time masterTimeout; - - private String name; - - @Nullable - private Time timeout; - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - Name of the index alias to convert to a data stream. - *

- * API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link MigrateToDataStreamRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public MigrateToDataStreamRequest build() { - _checkSingleUse(); - - return new MigrateToDataStreamRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.migrate_to_data_stream}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.migrate_to_data_stream", - - // Request method - request -> { - return "POST"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_data_stream"); - buf.append("/_migrate"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - params.put("name", request.name); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, MigrateToDataStreamResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MigrateToDataStreamResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MigrateToDataStreamResponse.java deleted file mode 100644 index 93aa19093..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MigrateToDataStreamResponse.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.migrate_to_data_stream.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class MigrateToDataStreamResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private MigrateToDataStreamResponse(Builder builder) { - super(builder); - - } - - public static MigrateToDataStreamResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link MigrateToDataStreamResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link MigrateToDataStreamResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public MigrateToDataStreamResponse build() { - _checkSingleUse(); - - return new MigrateToDataStreamResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link MigrateToDataStreamResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, MigrateToDataStreamResponse::setupMigrateToDataStreamResponseDeserializer); - - protected static void setupMigrateToDataStreamResponseDeserializer( - ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ModifyDataStreamRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ModifyDataStreamRequest.java deleted file mode 100644 index 92b887ae5..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ModifyDataStreamRequest.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch.indices.modify_data_stream.Action; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.modify_data_stream.Request - -/** - * Update data streams. Performs one or more data stream modification actions in - * a single atomic operation. - * - * @see API - * specification - */ -@JsonpDeserializable -public class ModifyDataStreamRequest extends RequestBase implements JsonpSerializable { - private final List actions; - - // --------------------------------------------------------------------------------------------- - - private ModifyDataStreamRequest(Builder builder) { - - this.actions = ApiTypeHelper.unmodifiableRequired(builder.actions, this, "actions"); - - } - - public static ModifyDataStreamRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Actions to perform. - *

- * API name: {@code actions} - */ - public final List actions() { - return this.actions; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.actions)) { - generator.writeKey("actions"); - generator.writeStartArray(); - for (Action item0 : this.actions) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ModifyDataStreamRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - private List actions; - - /** - * Required - Actions to perform. - *

- * API name: {@code actions} - *

- * Adds all elements of list to actions. - */ - public final Builder actions(List list) { - this.actions = _listAddAll(this.actions, list); - return this; - } - - /** - * Required - Actions to perform. - *

- * API name: {@code actions} - *

- * Adds one or more values to actions. - */ - public final Builder actions(Action value, Action... values) { - this.actions = _listAdd(this.actions, value, values); - return this; - } - - /** - * Required - Actions to perform. - *

- * API name: {@code actions} - *

- * Adds a value to actions using a builder lambda. - */ - public final Builder actions(Function> fn) { - return actions(fn.apply(new Action.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ModifyDataStreamRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ModifyDataStreamRequest build() { - _checkSingleUse(); - - return new ModifyDataStreamRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ModifyDataStreamRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ModifyDataStreamRequest::setupModifyDataStreamRequestDeserializer); - - protected static void setupModifyDataStreamRequestDeserializer( - ObjectDeserializer op) { - - op.add(Builder::actions, JsonpDeserializer.arrayDeserializer(Action._DESERIALIZER), "actions"); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.modify_data_stream}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.modify_data_stream", - - // Request method - request -> { - return "POST"; - - }, - - // Request path - request -> { - return "/_data_stream/_modify"; - - }, - - // Path parameters - request -> { - return Collections.emptyMap(); - }, - - // Request parameters - request -> { - return Collections.emptyMap(); - - }, SimpleEndpoint.emptyMap(), true, ModifyDataStreamResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ModifyDataStreamResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ModifyDataStreamResponse.java deleted file mode 100644 index d3664f088..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ModifyDataStreamResponse.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.modify_data_stream.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ModifyDataStreamResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private ModifyDataStreamResponse(Builder builder) { - super(builder); - - } - - public static ModifyDataStreamResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ModifyDataStreamResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ModifyDataStreamResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ModifyDataStreamResponse build() { - _checkSingleUse(); - - return new ModifyDataStreamResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ModifyDataStreamResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ModifyDataStreamResponse::setupModifyDataStreamResponseDeserializer); - - protected static void setupModifyDataStreamResponseDeserializer( - ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/NumericFielddata.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/NumericFielddata.java deleted file mode 100644 index 836147ce0..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/NumericFielddata.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.NumericFielddata - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class NumericFielddata implements JsonpSerializable { - private final NumericFielddataFormat format; - - // --------------------------------------------------------------------------------------------- - - private NumericFielddata(Builder builder) { - - this.format = ApiTypeHelper.requireNonNull(builder.format, this, "format"); - - } - - public static NumericFielddata of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code format} - */ - public final NumericFielddataFormat format() { - return this.format; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("format"); - this.format.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link NumericFielddata}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private NumericFielddataFormat format; - - /** - * Required - API name: {@code format} - */ - public final Builder format(NumericFielddataFormat value) { - this.format = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link NumericFielddata}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public NumericFielddata build() { - _checkSingleUse(); - - return new NumericFielddata(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link NumericFielddata} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - NumericFielddata::setupNumericFielddataDeserializer); - - protected static void setupNumericFielddataDeserializer(ObjectDeserializer op) { - - op.add(Builder::format, NumericFielddataFormat._DESERIALIZER, "format"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/NumericFielddataFormat.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/NumericFielddataFormat.java deleted file mode 100644 index 187639a8f..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/NumericFielddataFormat.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum NumericFielddataFormat implements JsonEnum { - Array("array"), - - Disabled("disabled"), - - ; - - private final String jsonValue; - - NumericFielddataFormat(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - NumericFielddataFormat.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutAliasRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutAliasRequest.java deleted file mode 100644 index 75f743d04..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutAliasRequest.java +++ /dev/null @@ -1,559 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.elasticsearch._types.query_dsl.Query; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.put_alias.Request - -/** - * Create or update an alias. Adds a data stream or index to an alias. - * - * @see API - * specification - */ -@JsonpDeserializable -public class PutAliasRequest extends RequestBase implements JsonpSerializable { - @Nullable - private final Query filter; - - private final List index; - - @Nullable - private final String indexRouting; - - @Nullable - private final Boolean isWriteIndex; - - @Nullable - private final Time masterTimeout; - - private final String name; - - @Nullable - private final String routing; - - @Nullable - private final String searchRouting; - - @Nullable - private final Time timeout; - - // --------------------------------------------------------------------------------------------- - - private PutAliasRequest(Builder builder) { - - this.filter = builder.filter; - this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); - this.indexRouting = builder.indexRouting; - this.isWriteIndex = builder.isWriteIndex; - this.masterTimeout = builder.masterTimeout; - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.routing = builder.routing; - this.searchRouting = builder.searchRouting; - this.timeout = builder.timeout; - - } - - public static PutAliasRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Query used to limit documents the alias can access. - *

- * API name: {@code filter} - */ - @Nullable - public final Query filter() { - return this.filter; - } - - /** - * Required - Comma-separated list of data streams or indices to add. Supports - * wildcards (*). Wildcard patterns that match both data streams - * and indices return an error. - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - /** - * Value used to route indexing operations to a specific shard. If specified, - * this overwrites the routing value for indexing operations. Data - * stream aliases don’t support this parameter. - *

- * API name: {@code index_routing} - */ - @Nullable - public final String indexRouting() { - return this.indexRouting; - } - - /** - * If true, sets the write index or data stream for the alias. If - * an alias points to multiple indices or data streams and - * is_write_index isn’t set, the alias rejects write requests. If - * an index alias points to one index and is_write_index isn’t set, - * the index automatically acts as the write index. Data stream aliases don’t - * automatically set a write data stream, even if the alias points to one data - * stream. - *

- * API name: {@code is_write_index} - */ - @Nullable - public final Boolean isWriteIndex() { - return this.isWriteIndex; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Required - Alias to update. If the alias doesn’t exist, the request creates - * it. Index alias names support date math. - *

- * API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Value used to route indexing and search operations to a specific shard. Data - * stream aliases don’t support this parameter. - *

- * API name: {@code routing} - */ - @Nullable - public final String routing() { - return this.routing; - } - - /** - * Value used to route search operations to a specific shard. If specified, this - * overwrites the routing value for search operations. Data stream - * aliases don’t support this parameter. - *

- * API name: {@code search_routing} - */ - @Nullable - public final String searchRouting() { - return this.searchRouting; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.filter != null) { - generator.writeKey("filter"); - this.filter.serialize(generator, mapper); - - } - if (this.indexRouting != null) { - generator.writeKey("index_routing"); - generator.write(this.indexRouting); - - } - if (this.isWriteIndex != null) { - generator.writeKey("is_write_index"); - generator.write(this.isWriteIndex); - - } - if (this.routing != null) { - generator.writeKey("routing"); - generator.write(this.routing); - - } - if (this.searchRouting != null) { - generator.writeKey("search_routing"); - generator.write(this.searchRouting); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PutAliasRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { - @Nullable - private Query filter; - - private List index; - - @Nullable - private String indexRouting; - - @Nullable - private Boolean isWriteIndex; - - @Nullable - private Time masterTimeout; - - private String name; - - @Nullable - private String routing; - - @Nullable - private String searchRouting; - - @Nullable - private Time timeout; - - /** - * Query used to limit documents the alias can access. - *

- * API name: {@code filter} - */ - public final Builder filter(@Nullable Query value) { - this.filter = value; - return this; - } - - /** - * Query used to limit documents the alias can access. - *

- * API name: {@code filter} - */ - public final Builder filter(Function> fn) { - return this.filter(fn.apply(new Query.Builder()).build()); - } - - /** - * Required - Comma-separated list of data streams or indices to add. Supports - * wildcards (*). Wildcard patterns that match both data streams - * and indices return an error. - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * Required - Comma-separated list of data streams or indices to add. Supports - * wildcards (*). Wildcard patterns that match both data streams - * and indices return an error. - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - /** - * Value used to route indexing operations to a specific shard. If specified, - * this overwrites the routing value for indexing operations. Data - * stream aliases don’t support this parameter. - *

- * API name: {@code index_routing} - */ - public final Builder indexRouting(@Nullable String value) { - this.indexRouting = value; - return this; - } - - /** - * If true, sets the write index or data stream for the alias. If - * an alias points to multiple indices or data streams and - * is_write_index isn’t set, the alias rejects write requests. If - * an index alias points to one index and is_write_index isn’t set, - * the index automatically acts as the write index. Data stream aliases don’t - * automatically set a write data stream, even if the alias points to one data - * stream. - *

- * API name: {@code is_write_index} - */ - public final Builder isWriteIndex(@Nullable Boolean value) { - this.isWriteIndex = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - Alias to update. If the alias doesn’t exist, the request creates - * it. Index alias names support date math. - *

- * API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Value used to route indexing and search operations to a specific shard. Data - * stream aliases don’t support this parameter. - *

- * API name: {@code routing} - */ - public final Builder routing(@Nullable String value) { - this.routing = value; - return this; - } - - /** - * Value used to route search operations to a specific shard. If specified, this - * overwrites the routing value for search operations. Data stream - * aliases don’t support this parameter. - *

- * API name: {@code search_routing} - */ - public final Builder searchRouting(@Nullable String value) { - this.searchRouting = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PutAliasRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PutAliasRequest build() { - _checkSingleUse(); - - return new PutAliasRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PutAliasRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - PutAliasRequest::setupPutAliasRequestDeserializer); - - protected static void setupPutAliasRequestDeserializer(ObjectDeserializer op) { - - op.add(Builder::filter, Query._DESERIALIZER, "filter"); - op.add(Builder::indexRouting, JsonpDeserializer.stringDeserializer(), "index_routing"); - op.add(Builder::isWriteIndex, JsonpDeserializer.booleanDeserializer(), "is_write_index"); - op.add(Builder::routing, JsonpDeserializer.stringDeserializer(), "routing"); - op.add(Builder::searchRouting, JsonpDeserializer.stringDeserializer(), "search_routing"); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.put_alias}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.put_alias", - - // Request method - request -> { - return "PUT"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - final int _index = 1 << 1; - - int propsSet = 0; - - propsSet |= _name; - propsSet |= _index; - - if (propsSet == (_index | _name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_alias"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name, buf); - return buf.toString(); - } - if (propsSet == (_index | _name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_aliases"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - final int _index = 1 << 1; - - int propsSet = 0; - - propsSet |= _name; - propsSet |= _index; - - if (propsSet == (_index | _name)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - params.put("name", request.name); - } - if (propsSet == (_index | _name)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - params.put("name", request.name); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), true, PutAliasResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutAliasResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutAliasResponse.java deleted file mode 100644 index 40cbac33b..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutAliasResponse.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.put_alias.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class PutAliasResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private PutAliasResponse(Builder builder) { - super(builder); - - } - - public static PutAliasResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PutAliasResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PutAliasResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PutAliasResponse build() { - _checkSingleUse(); - - return new PutAliasResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PutAliasResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - PutAliasResponse::setupPutAliasResponseDeserializer); - - protected static void setupPutAliasResponseDeserializer(ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutDataLifecycleRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutDataLifecycleRequest.java deleted file mode 100644 index 00ad95dc1..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutDataLifecycleRequest.java +++ /dev/null @@ -1,474 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.put_data_lifecycle.Request - -/** - * Update data stream lifecycles. Update the data stream lifecycle of the - * specified data streams. - * - * @see API - * specification - */ -@JsonpDeserializable -public class PutDataLifecycleRequest extends RequestBase implements JsonpSerializable { - @Nullable - private final Time dataRetention; - - @Nullable - private final DataStreamLifecycleDownsampling downsampling; - - private final List expandWildcards; - - @Nullable - private final Time masterTimeout; - - private final List name; - - @Nullable - private final Time timeout; - - // --------------------------------------------------------------------------------------------- - - private PutDataLifecycleRequest(Builder builder) { - - this.dataRetention = builder.dataRetention; - this.downsampling = builder.downsampling; - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.masterTimeout = builder.masterTimeout; - this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); - this.timeout = builder.timeout; - - } - - public static PutDataLifecycleRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If defined, every document added to this data stream will be stored at least - * for this time frame. Any time after this duration the document could be - * deleted. When empty, every document in this data stream will be stored - * indefinitely. - *

- * API name: {@code data_retention} - */ - @Nullable - public final Time dataRetention() { - return this.dataRetention; - } - - /** - * If defined, every backing index will execute the configured downsampling - * configuration after the backing index is not the data stream write index - * anymore. - *

- * API name: {@code downsampling} - */ - @Nullable - public final DataStreamLifecycleDownsampling downsampling() { - return this.downsampling; - } - - /** - * Type of data stream that wildcard patterns can match. Supports - * comma-separated values, such as open,hidden. Valid values are: - * all, hidden, open, - * closed, none. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Required - Comma-separated list of data streams used to limit the request. - * Supports wildcards (*). To target all data streams use - * * or _all. - *

- * API name: {@code name} - */ - public final List name() { - return this.name; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.dataRetention != null) { - generator.writeKey("data_retention"); - this.dataRetention.serialize(generator, mapper); - - } - if (this.downsampling != null) { - generator.writeKey("downsampling"); - this.downsampling.serialize(generator, mapper); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PutDataLifecycleRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Time dataRetention; - - @Nullable - private DataStreamLifecycleDownsampling downsampling; - - @Nullable - private List expandWildcards; - - @Nullable - private Time masterTimeout; - - private List name; - - @Nullable - private Time timeout; - - /** - * If defined, every document added to this data stream will be stored at least - * for this time frame. Any time after this duration the document could be - * deleted. When empty, every document in this data stream will be stored - * indefinitely. - *

- * API name: {@code data_retention} - */ - public final Builder dataRetention(@Nullable Time value) { - this.dataRetention = value; - return this; - } - - /** - * If defined, every document added to this data stream will be stored at least - * for this time frame. Any time after this duration the document could be - * deleted. When empty, every document in this data stream will be stored - * indefinitely. - *

- * API name: {@code data_retention} - */ - public final Builder dataRetention(Function> fn) { - return this.dataRetention(fn.apply(new Time.Builder()).build()); - } - - /** - * If defined, every backing index will execute the configured downsampling - * configuration after the backing index is not the data stream write index - * anymore. - *

- * API name: {@code downsampling} - */ - public final Builder downsampling(@Nullable DataStreamLifecycleDownsampling value) { - this.downsampling = value; - return this; - } - - /** - * If defined, every backing index will execute the configured downsampling - * configuration after the backing index is not the data stream write index - * anymore. - *

- * API name: {@code downsampling} - */ - public final Builder downsampling( - Function> fn) { - return this.downsampling(fn.apply(new DataStreamLifecycleDownsampling.Builder()).build()); - } - - /** - * Type of data stream that wildcard patterns can match. Supports - * comma-separated values, such as open,hidden. Valid values are: - * all, hidden, open, - * closed, none. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Type of data stream that wildcard patterns can match. Supports - * comma-separated values, such as open,hidden. Valid values are: - * all, hidden, open, - * closed, none. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - Comma-separated list of data streams used to limit the request. - * Supports wildcards (*). To target all data streams use - * * or _all. - *

- * API name: {@code name} - *

- * Adds all elements of list to name. - */ - public final Builder name(List list) { - this.name = _listAddAll(this.name, list); - return this; - } - - /** - * Required - Comma-separated list of data streams used to limit the request. - * Supports wildcards (*). To target all data streams use - * * or _all. - *

- * API name: {@code name} - *

- * Adds one or more values to name. - */ - public final Builder name(String value, String... values) { - this.name = _listAdd(this.name, value, values); - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PutDataLifecycleRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PutDataLifecycleRequest build() { - _checkSingleUse(); - - return new PutDataLifecycleRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PutDataLifecycleRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, PutDataLifecycleRequest::setupPutDataLifecycleRequestDeserializer); - - protected static void setupPutDataLifecycleRequestDeserializer( - ObjectDeserializer op) { - - op.add(Builder::dataRetention, Time._DESERIALIZER, "data_retention"); - op.add(Builder::downsampling, DataStreamLifecycleDownsampling._DESERIALIZER, "downsampling"); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.put_data_lifecycle}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.put_data_lifecycle", - - // Request method - request -> { - return "PUT"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_data_stream"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_lifecycle"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), true, PutDataLifecycleResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutDataLifecycleResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutDataLifecycleResponse.java deleted file mode 100644 index b88e96fe0..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutDataLifecycleResponse.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.put_data_lifecycle.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class PutDataLifecycleResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private PutDataLifecycleResponse(Builder builder) { - super(builder); - - } - - public static PutDataLifecycleResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PutDataLifecycleResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PutDataLifecycleResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PutDataLifecycleResponse build() { - _checkSingleUse(); - - return new PutDataLifecycleResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PutDataLifecycleResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, PutDataLifecycleResponse::setupPutDataLifecycleResponseDeserializer); - - protected static void setupPutDataLifecycleResponseDeserializer( - ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndexTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndexTemplateRequest.java deleted file mode 100644 index f0ea33bcb..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndexTemplateRequest.java +++ /dev/null @@ -1,791 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.elasticsearch.indices.put_index_template.IndexTemplateMapping; -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Long; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.put_index_template.Request - -/** - * Create or update an index template. Index templates define settings, - * mappings, and aliases that can be applied automatically to new indices. - * - * @see API - * specification - */ -@JsonpDeserializable -public class PutIndexTemplateRequest extends RequestBase implements JsonpSerializable { - private final Map meta; - - @Nullable - private final Boolean allowAutoCreate; - - @Nullable - private final String cause; - - private final List composedOf; - - @Nullable - private final Boolean create; - - @Nullable - private final DataStreamVisibility dataStream; - - @Nullable - private final Boolean deprecated; - - private final List ignoreMissingComponentTemplates; - - private final List indexPatterns; - - @Nullable - private final Time masterTimeout; - - private final String name; - - @Nullable - private final Long priority; - - @Nullable - private final IndexTemplateMapping template; - - @Nullable - private final Long version; - - // --------------------------------------------------------------------------------------------- - - private PutIndexTemplateRequest(Builder builder) { - - this.meta = ApiTypeHelper.unmodifiable(builder.meta); - this.allowAutoCreate = builder.allowAutoCreate; - this.cause = builder.cause; - this.composedOf = ApiTypeHelper.unmodifiable(builder.composedOf); - this.create = builder.create; - this.dataStream = builder.dataStream; - this.deprecated = builder.deprecated; - this.ignoreMissingComponentTemplates = ApiTypeHelper.unmodifiable(builder.ignoreMissingComponentTemplates); - this.indexPatterns = ApiTypeHelper.unmodifiable(builder.indexPatterns); - this.masterTimeout = builder.masterTimeout; - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.priority = builder.priority; - this.template = builder.template; - this.version = builder.version; - - } - - public static PutIndexTemplateRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Optional user metadata about the index template. May have any contents. This - * map is not automatically generated by Elasticsearch. - *

- * API name: {@code _meta} - */ - public final Map meta() { - return this.meta; - } - - /** - * This setting overrides the value of the action.auto_create_index - * cluster setting. If set to true in a template, then indices can - * be automatically created using that template even if auto-creation of indices - * is disabled via actions.auto_create_index. If set to - * false, then indices or data streams matching the template must - * always be explicitly created, and may never be automatically created. - *

- * API name: {@code allow_auto_create} - */ - @Nullable - public final Boolean allowAutoCreate() { - return this.allowAutoCreate; - } - - /** - * User defined reason for creating/updating the index template - *

- * API name: {@code cause} - */ - @Nullable - public final String cause() { - return this.cause; - } - - /** - * An ordered list of component template names. Component templates are merged - * in the order specified, meaning that the last component template specified - * has the highest precedence. - *

- * API name: {@code composed_of} - */ - public final List composedOf() { - return this.composedOf; - } - - /** - * If true, this request cannot replace or update existing index - * templates. - *

- * API name: {@code create} - */ - @Nullable - public final Boolean create() { - return this.create; - } - - /** - * If this object is included, the template is used to create data streams and - * their backing indices. Supports an empty object. Data streams require a - * matching index template with a data_stream object. - *

- * API name: {@code data_stream} - */ - @Nullable - public final DataStreamVisibility dataStream() { - return this.dataStream; - } - - /** - * Marks this index template as deprecated. When creating or updating a - * non-deprecated index template that uses deprecated components, Elasticsearch - * will emit a deprecation warning. - *

- * API name: {@code deprecated} - */ - @Nullable - public final Boolean deprecated() { - return this.deprecated; - } - - /** - * The configuration option ignore_missing_component_templates can be used when - * an index template references a component template that might not exist - *

- * API name: {@code ignore_missing_component_templates} - */ - public final List ignoreMissingComponentTemplates() { - return this.ignoreMissingComponentTemplates; - } - - /** - * Name of the index template to create. - *

- * API name: {@code index_patterns} - */ - public final List indexPatterns() { - return this.indexPatterns; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Required - Index or template name - *

- * API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Priority to determine index template precedence when a new data stream or - * index is created. The index template with the highest priority is chosen. If - * no priority is specified the template is treated as though it is of priority - * 0 (lowest priority). This number is not automatically generated by - * Elasticsearch. - *

- * API name: {@code priority} - */ - @Nullable - public final Long priority() { - return this.priority; - } - - /** - * Template to be applied. It may optionally include an aliases, - * mappings, or settings configuration. - *

- * API name: {@code template} - */ - @Nullable - public final IndexTemplateMapping template() { - return this.template; - } - - /** - * Version number used to manage index templates externally. This number is not - * automatically generated by Elasticsearch. - *

- * API name: {@code version} - */ - @Nullable - public final Long version() { - return this.version; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.meta)) { - generator.writeKey("_meta"); - generator.writeStartObject(); - for (Map.Entry item0 : this.meta.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.allowAutoCreate != null) { - generator.writeKey("allow_auto_create"); - generator.write(this.allowAutoCreate); - - } - if (ApiTypeHelper.isDefined(this.composedOf)) { - generator.writeKey("composed_of"); - generator.writeStartArray(); - for (String item0 : this.composedOf) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (this.dataStream != null) { - generator.writeKey("data_stream"); - this.dataStream.serialize(generator, mapper); - - } - if (this.deprecated != null) { - generator.writeKey("deprecated"); - generator.write(this.deprecated); - - } - if (ApiTypeHelper.isDefined(this.ignoreMissingComponentTemplates)) { - generator.writeKey("ignore_missing_component_templates"); - generator.writeStartArray(); - for (String item0 : this.ignoreMissingComponentTemplates) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.indexPatterns)) { - generator.writeKey("index_patterns"); - generator.writeStartArray(); - for (String item0 : this.indexPatterns) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (this.priority != null) { - generator.writeKey("priority"); - generator.write(this.priority); - - } - if (this.template != null) { - generator.writeKey("template"); - this.template.serialize(generator, mapper); - - } - if (this.version != null) { - generator.writeKey("version"); - generator.write(this.version); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PutIndexTemplateRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Map meta; - - @Nullable - private Boolean allowAutoCreate; - - @Nullable - private String cause; - - @Nullable - private List composedOf; - - @Nullable - private Boolean create; - - @Nullable - private DataStreamVisibility dataStream; - - @Nullable - private Boolean deprecated; - - @Nullable - private List ignoreMissingComponentTemplates; - - @Nullable - private List indexPatterns; - - @Nullable - private Time masterTimeout; - - private String name; - - @Nullable - private Long priority; - - @Nullable - private IndexTemplateMapping template; - - @Nullable - private Long version; - - /** - * Optional user metadata about the index template. May have any contents. This - * map is not automatically generated by Elasticsearch. - *

- * API name: {@code _meta} - *

- * Adds all entries of map to meta. - */ - public final Builder meta(Map map) { - this.meta = _mapPutAll(this.meta, map); - return this; - } - - /** - * Optional user metadata about the index template. May have any contents. This - * map is not automatically generated by Elasticsearch. - *

- * API name: {@code _meta} - *

- * Adds an entry to meta. - */ - public final Builder meta(String key, JsonData value) { - this.meta = _mapPut(this.meta, key, value); - return this; - } - - /** - * This setting overrides the value of the action.auto_create_index - * cluster setting. If set to true in a template, then indices can - * be automatically created using that template even if auto-creation of indices - * is disabled via actions.auto_create_index. If set to - * false, then indices or data streams matching the template must - * always be explicitly created, and may never be automatically created. - *

- * API name: {@code allow_auto_create} - */ - public final Builder allowAutoCreate(@Nullable Boolean value) { - this.allowAutoCreate = value; - return this; - } - - /** - * User defined reason for creating/updating the index template - *

- * API name: {@code cause} - */ - public final Builder cause(@Nullable String value) { - this.cause = value; - return this; - } - - /** - * An ordered list of component template names. Component templates are merged - * in the order specified, meaning that the last component template specified - * has the highest precedence. - *

- * API name: {@code composed_of} - *

- * Adds all elements of list to composedOf. - */ - public final Builder composedOf(List list) { - this.composedOf = _listAddAll(this.composedOf, list); - return this; - } - - /** - * An ordered list of component template names. Component templates are merged - * in the order specified, meaning that the last component template specified - * has the highest precedence. - *

- * API name: {@code composed_of} - *

- * Adds one or more values to composedOf. - */ - public final Builder composedOf(String value, String... values) { - this.composedOf = _listAdd(this.composedOf, value, values); - return this; - } - - /** - * If true, this request cannot replace or update existing index - * templates. - *

- * API name: {@code create} - */ - public final Builder create(@Nullable Boolean value) { - this.create = value; - return this; - } - - /** - * If this object is included, the template is used to create data streams and - * their backing indices. Supports an empty object. Data streams require a - * matching index template with a data_stream object. - *

- * API name: {@code data_stream} - */ - public final Builder dataStream(@Nullable DataStreamVisibility value) { - this.dataStream = value; - return this; - } - - /** - * If this object is included, the template is used to create data streams and - * their backing indices. Supports an empty object. Data streams require a - * matching index template with a data_stream object. - *

- * API name: {@code data_stream} - */ - public final Builder dataStream( - Function> fn) { - return this.dataStream(fn.apply(new DataStreamVisibility.Builder()).build()); - } - - /** - * Marks this index template as deprecated. When creating or updating a - * non-deprecated index template that uses deprecated components, Elasticsearch - * will emit a deprecation warning. - *

- * API name: {@code deprecated} - */ - public final Builder deprecated(@Nullable Boolean value) { - this.deprecated = value; - return this; - } - - /** - * The configuration option ignore_missing_component_templates can be used when - * an index template references a component template that might not exist - *

- * API name: {@code ignore_missing_component_templates} - *

- * Adds all elements of list to - * ignoreMissingComponentTemplates. - */ - public final Builder ignoreMissingComponentTemplates(List list) { - this.ignoreMissingComponentTemplates = _listAddAll(this.ignoreMissingComponentTemplates, list); - return this; - } - - /** - * The configuration option ignore_missing_component_templates can be used when - * an index template references a component template that might not exist - *

- * API name: {@code ignore_missing_component_templates} - *

- * Adds one or more values to ignoreMissingComponentTemplates. - */ - public final Builder ignoreMissingComponentTemplates(String value, String... values) { - this.ignoreMissingComponentTemplates = _listAdd(this.ignoreMissingComponentTemplates, value, values); - return this; - } - - /** - * Name of the index template to create. - *

- * API name: {@code index_patterns} - *

- * Adds all elements of list to indexPatterns. - */ - public final Builder indexPatterns(List list) { - this.indexPatterns = _listAddAll(this.indexPatterns, list); - return this; - } - - /** - * Name of the index template to create. - *

- * API name: {@code index_patterns} - *

- * Adds one or more values to indexPatterns. - */ - public final Builder indexPatterns(String value, String... values) { - this.indexPatterns = _listAdd(this.indexPatterns, value, values); - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - Index or template name - *

- * API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Priority to determine index template precedence when a new data stream or - * index is created. The index template with the highest priority is chosen. If - * no priority is specified the template is treated as though it is of priority - * 0 (lowest priority). This number is not automatically generated by - * Elasticsearch. - *

- * API name: {@code priority} - */ - public final Builder priority(@Nullable Long value) { - this.priority = value; - return this; - } - - /** - * Template to be applied. It may optionally include an aliases, - * mappings, or settings configuration. - *

- * API name: {@code template} - */ - public final Builder template(@Nullable IndexTemplateMapping value) { - this.template = value; - return this; - } - - /** - * Template to be applied. It may optionally include an aliases, - * mappings, or settings configuration. - *

- * API name: {@code template} - */ - public final Builder template(Function> fn) { - return this.template(fn.apply(new IndexTemplateMapping.Builder()).build()); - } - - /** - * Version number used to manage index templates externally. This number is not - * automatically generated by Elasticsearch. - *

- * API name: {@code version} - */ - public final Builder version(@Nullable Long value) { - this.version = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PutIndexTemplateRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PutIndexTemplateRequest build() { - _checkSingleUse(); - - return new PutIndexTemplateRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PutIndexTemplateRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, PutIndexTemplateRequest::setupPutIndexTemplateRequestDeserializer); - - protected static void setupPutIndexTemplateRequestDeserializer( - ObjectDeserializer op) { - - op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta"); - op.add(Builder::allowAutoCreate, JsonpDeserializer.booleanDeserializer(), "allow_auto_create"); - op.add(Builder::composedOf, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "composed_of"); - op.add(Builder::dataStream, DataStreamVisibility._DESERIALIZER, "data_stream"); - op.add(Builder::deprecated, JsonpDeserializer.booleanDeserializer(), "deprecated"); - op.add(Builder::ignoreMissingComponentTemplates, - JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "ignore_missing_component_templates"); - op.add(Builder::indexPatterns, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "index_patterns"); - op.add(Builder::priority, JsonpDeserializer.longDeserializer(), "priority"); - op.add(Builder::template, IndexTemplateMapping._DESERIALIZER, "template"); - op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version"); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.put_index_template}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.put_index_template", - - // Request method - request -> { - return "PUT"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_index_template"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - params.put("name", request.name); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.create != null) { - params.put("create", String.valueOf(request.create)); - } - if (request.cause != null) { - params.put("cause", request.cause); - } - return params; - - }, SimpleEndpoint.emptyMap(), true, PutIndexTemplateResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndexTemplateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndexTemplateResponse.java deleted file mode 100644 index 461d66aa8..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndexTemplateResponse.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.put_index_template.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class PutIndexTemplateResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private PutIndexTemplateResponse(Builder builder) { - super(builder); - - } - - public static PutIndexTemplateResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PutIndexTemplateResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PutIndexTemplateResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PutIndexTemplateResponse build() { - _checkSingleUse(); - - return new PutIndexTemplateResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PutIndexTemplateResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, PutIndexTemplateResponse::setupPutIndexTemplateResponseDeserializer); - - protected static void setupPutIndexTemplateResponseDeserializer( - ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndicesSettingsRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndicesSettingsRequest.java deleted file mode 100644 index 860a3a0ff..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndicesSettingsRequest.java +++ /dev/null @@ -1,538 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import jakarta.json.stream.JsonParser; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.put_settings.Request - -/** - * Update index settings. Changes dynamic index settings in real time. For data - * streams, index setting changes are applied to all backing indices by default. - * - * @see API - * specification - */ -@JsonpDeserializable -public class PutIndicesSettingsRequest extends RequestBase implements JsonpSerializable { - @Nullable - private final Boolean allowNoIndices; - - private final List expandWildcards; - - @Nullable - private final Boolean flatSettings; - - @Nullable - private final Boolean ignoreUnavailable; - - private final List index; - - @Nullable - private final Time masterTimeout; - - @Nullable - private final Boolean preserveExisting; - - @Nullable - private final Time timeout; - - private final IndexSettings settings; - - // --------------------------------------------------------------------------------------------- - - private PutIndicesSettingsRequest(Builder builder) { - - this.allowNoIndices = builder.allowNoIndices; - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.flatSettings = builder.flatSettings; - this.ignoreUnavailable = builder.ignoreUnavailable; - this.index = ApiTypeHelper.unmodifiable(builder.index); - this.masterTimeout = builder.masterTimeout; - this.preserveExisting = builder.preserveExisting; - this.timeout = builder.timeout; - this.settings = ApiTypeHelper.requireNonNull(builder.settings, this, "settings"); - - } - - public static PutIndicesSettingsRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. For example, a request targeting foo*,bar* returns an - * error if an index starts with foo but no index starts with - * bar. - *

- * API name: {@code allow_no_indices} - */ - @Nullable - public final Boolean allowNoIndices() { - return this.allowNoIndices; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * If true, returns settings in flat format. - *

- * API name: {@code flat_settings} - */ - @Nullable - public final Boolean flatSettings() { - return this.flatSettings; - } - - /** - * If true, returns settings in flat format. - *

- * API name: {@code ignore_unavailable} - */ - @Nullable - public final Boolean ignoreUnavailable() { - return this.ignoreUnavailable; - } - - /** - * Comma-separated list of data streams, indices, and aliases used to limit the - * request. Supports wildcards (*). To target all data streams and - * indices, omit this parameter or use * or _all. - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * If true, existing index settings remain unchanged. - *

- * API name: {@code preserve_existing} - */ - @Nullable - public final Boolean preserveExisting() { - return this.preserveExisting; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - /** - * Required - Request body. - */ - public final IndexSettings settings() { - return this.settings; - } - - /** - * Serialize this value to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - this.settings.serialize(generator, mapper); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PutIndicesSettingsRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Boolean allowNoIndices; - - @Nullable - private List expandWildcards; - - @Nullable - private Boolean flatSettings; - - @Nullable - private Boolean ignoreUnavailable; - - @Nullable - private List index; - - @Nullable - private Time masterTimeout; - - @Nullable - private Boolean preserveExisting; - - @Nullable - private Time timeout; - - private IndexSettings settings; - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. For example, a request targeting foo*,bar* returns an - * error if an index starts with foo but no index starts with - * bar. - *

- * API name: {@code allow_no_indices} - */ - public final Builder allowNoIndices(@Nullable Boolean value) { - this.allowNoIndices = value; - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * If true, returns settings in flat format. - *

- * API name: {@code flat_settings} - */ - public final Builder flatSettings(@Nullable Boolean value) { - this.flatSettings = value; - return this; - } - - /** - * If true, returns settings in flat format. - *

- * API name: {@code ignore_unavailable} - */ - public final Builder ignoreUnavailable(@Nullable Boolean value) { - this.ignoreUnavailable = value; - return this; - } - - /** - * Comma-separated list of data streams, indices, and aliases used to limit the - * request. Supports wildcards (*). To target all data streams and - * indices, omit this parameter or use * or _all. - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * Comma-separated list of data streams, indices, and aliases used to limit the - * request. Supports wildcards (*). To target all data streams and - * indices, omit this parameter or use * or _all. - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * If true, existing index settings remain unchanged. - *

- * API name: {@code preserve_existing} - */ - public final Builder preserveExisting(@Nullable Boolean value) { - this.preserveExisting = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - Request body. - */ - public final Builder settings(IndexSettings value) { - this.settings = value; - return this; - } - - /** - * Required - Request body. - */ - public final Builder settings(Function> fn) { - return this.settings(fn.apply(new IndexSettings.Builder()).build()); - } - - @Override - public Builder withJson(JsonParser parser, JsonpMapper mapper) { - - @SuppressWarnings("unchecked") - IndexSettings value = (IndexSettings) IndexSettings._DESERIALIZER.deserialize(parser, mapper); - return this.settings(value); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PutIndicesSettingsRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PutIndicesSettingsRequest build() { - _checkSingleUse(); - - return new PutIndicesSettingsRequest(this); - } - } - - public static final JsonpDeserializer _DESERIALIZER = createPutIndicesSettingsRequestDeserializer(); - protected static JsonpDeserializer createPutIndicesSettingsRequestDeserializer() { - - JsonpDeserializer valueDeserializer = IndexSettings._DESERIALIZER; - - return JsonpDeserializer.of(valueDeserializer.acceptedEvents(), (parser, mapper, event) -> new Builder() - .settings(valueDeserializer.deserialize(parser, mapper, event)).build()); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.put_settings}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.put_settings", - - // Request method - request -> { - return "PUT"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.index())) - propsSet |= _index; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_settings"); - return buf.toString(); - } - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_settings"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _index = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.index())) - propsSet |= _index; - - if (propsSet == 0) { - } - if (propsSet == (_index)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.preserveExisting != null) { - params.put("preserve_existing", String.valueOf(request.preserveExisting)); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), true, PutIndicesSettingsResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndicesSettingsResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndicesSettingsResponse.java deleted file mode 100644 index 138fb4511..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndicesSettingsResponse.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.put_settings.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class PutIndicesSettingsResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private PutIndicesSettingsResponse(Builder builder) { - super(builder); - - } - - public static PutIndicesSettingsResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PutIndicesSettingsResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PutIndicesSettingsResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PutIndicesSettingsResponse build() { - _checkSingleUse(); - - return new PutIndicesSettingsResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PutIndicesSettingsResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, PutIndicesSettingsResponse::setupPutIndicesSettingsResponseDeserializer); - - protected static void setupPutIndicesSettingsResponseDeserializer( - ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutMappingRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutMappingRequest.java deleted file mode 100644 index f818dc02d..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutMappingRequest.java +++ /dev/null @@ -1,1030 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.elasticsearch._types.mapping.DynamicMapping; -import co.elastic.clients.elasticsearch._types.mapping.DynamicTemplate; -import co.elastic.clients.elasticsearch._types.mapping.FieldNamesField; -import co.elastic.clients.elasticsearch._types.mapping.Property; -import co.elastic.clients.elasticsearch._types.mapping.RoutingField; -import co.elastic.clients.elasticsearch._types.mapping.RuntimeField; -import co.elastic.clients.elasticsearch._types.mapping.SourceField; -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.put_mapping.Request - -/** - * Update field mappings. Adds new fields to an existing data stream or index. - * You can also use this API to change the search settings of existing fields. - * For data streams, these changes are applied to all backing indices by - * default. - * - * @see API - * specification - */ -@JsonpDeserializable -public class PutMappingRequest extends RequestBase implements JsonpSerializable { - @Nullable - private final FieldNamesField fieldNames; - - private final Map meta; - - @Nullable - private final RoutingField routing; - - @Nullable - private final SourceField source; - - @Nullable - private final Boolean allowNoIndices; - - @Nullable - private final Boolean dateDetection; - - @Nullable - private final DynamicMapping dynamic; - - private final List dynamicDateFormats; - - private final List> dynamicTemplates; - - private final List expandWildcards; - - @Nullable - private final Boolean ignoreUnavailable; - - private final List index; - - @Nullable - private final Time masterTimeout; - - @Nullable - private final Boolean numericDetection; - - private final Map properties; - - private final Map runtime; - - @Nullable - private final Time timeout; - - @Nullable - private final Boolean writeIndexOnly; - - // --------------------------------------------------------------------------------------------- - - private PutMappingRequest(Builder builder) { - - this.fieldNames = builder.fieldNames; - this.meta = ApiTypeHelper.unmodifiable(builder.meta); - this.routing = builder.routing; - this.source = builder.source; - this.allowNoIndices = builder.allowNoIndices; - this.dateDetection = builder.dateDetection; - this.dynamic = builder.dynamic; - this.dynamicDateFormats = ApiTypeHelper.unmodifiable(builder.dynamicDateFormats); - this.dynamicTemplates = ApiTypeHelper.unmodifiable(builder.dynamicTemplates); - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.ignoreUnavailable = builder.ignoreUnavailable; - this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); - this.masterTimeout = builder.masterTimeout; - this.numericDetection = builder.numericDetection; - this.properties = ApiTypeHelper.unmodifiable(builder.properties); - this.runtime = ApiTypeHelper.unmodifiable(builder.runtime); - this.timeout = builder.timeout; - this.writeIndexOnly = builder.writeIndexOnly; - - } - - public static PutMappingRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Control whether field names are enabled for the index. - *

- * API name: {@code _field_names} - */ - @Nullable - public final FieldNamesField fieldNames() { - return this.fieldNames; - } - - /** - * A mapping type can have custom meta data associated with it. These are not - * used at all by Elasticsearch, but can be used to store application-specific - * metadata. - *

- * API name: {@code _meta} - */ - public final Map meta() { - return this.meta; - } - - /** - * Enable making a routing value required on indexed documents. - *

- * API name: {@code _routing} - */ - @Nullable - public final RoutingField routing() { - return this.routing; - } - - /** - * Control whether the _source field is enabled on the index. - *

- * API name: {@code _source} - */ - @Nullable - public final SourceField source() { - return this.source; - } - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. - *

- * API name: {@code allow_no_indices} - */ - @Nullable - public final Boolean allowNoIndices() { - return this.allowNoIndices; - } - - /** - * Controls whether dynamic date detection is enabled. - *

- * API name: {@code date_detection} - */ - @Nullable - public final Boolean dateDetection() { - return this.dateDetection; - } - - /** - * Controls whether new fields are added dynamically. - *

- * API name: {@code dynamic} - */ - @Nullable - public final DynamicMapping dynamic() { - return this.dynamic; - } - - /** - * If date detection is enabled then new string fields are checked against - * 'dynamic_date_formats' and if the value matches then a new date field is - * added instead of string. - *

- * API name: {@code dynamic_date_formats} - */ - public final List dynamicDateFormats() { - return this.dynamicDateFormats; - } - - /** - * Specify dynamic templates for the mapping. - *

- * API name: {@code dynamic_templates} - */ - public final List> dynamicTemplates() { - return this.dynamicTemplates; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * If false, the request returns an error if it targets a missing - * or closed index. - *

- * API name: {@code ignore_unavailable} - */ - @Nullable - public final Boolean ignoreUnavailable() { - return this.ignoreUnavailable; - } - - /** - * Required - A comma-separated list of index names the mapping should be added - * to (supports wildcards); use _all or omit to add the mapping on - * all indices. - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Automatically map strings into numeric data types for all fields. - *

- * API name: {@code numeric_detection} - */ - @Nullable - public final Boolean numericDetection() { - return this.numericDetection; - } - - /** - * Mapping for a field. For new fields, this mapping can include: - *

    - *
  • Field name
  • - *
  • Field data type
  • - *
  • Mapping parameters
  • - *
- *

- * API name: {@code properties} - */ - public final Map properties() { - return this.properties; - } - - /** - * Mapping of runtime fields for the index. - *

- * API name: {@code runtime} - */ - public final Map runtime() { - return this.runtime; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - /** - * If true, the mappings are applied only to the current write - * index for the target. - *

- * API name: {@code write_index_only} - */ - @Nullable - public final Boolean writeIndexOnly() { - return this.writeIndexOnly; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.fieldNames != null) { - generator.writeKey("_field_names"); - this.fieldNames.serialize(generator, mapper); - - } - if (ApiTypeHelper.isDefined(this.meta)) { - generator.writeKey("_meta"); - generator.writeStartObject(); - for (Map.Entry item0 : this.meta.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.routing != null) { - generator.writeKey("_routing"); - this.routing.serialize(generator, mapper); - - } - if (this.source != null) { - generator.writeKey("_source"); - this.source.serialize(generator, mapper); - - } - if (this.dateDetection != null) { - generator.writeKey("date_detection"); - generator.write(this.dateDetection); - - } - if (this.dynamic != null) { - generator.writeKey("dynamic"); - this.dynamic.serialize(generator, mapper); - } - if (ApiTypeHelper.isDefined(this.dynamicDateFormats)) { - generator.writeKey("dynamic_date_formats"); - generator.writeStartArray(); - for (String item0 : this.dynamicDateFormats) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.dynamicTemplates)) { - generator.writeKey("dynamic_templates"); - generator.writeStartArray(); - for (Map item0 : this.dynamicTemplates) { - generator.writeStartObject(); - if (item0 != null) { - for (Map.Entry item1 : item0.entrySet()) { - generator.writeKey(item1.getKey()); - item1.getValue().serialize(generator, mapper); - - } - } - generator.writeEnd(); - - } - generator.writeEnd(); - - } - if (this.numericDetection != null) { - generator.writeKey("numeric_detection"); - generator.write(this.numericDetection); - - } - if (ApiTypeHelper.isDefined(this.properties)) { - generator.writeKey("properties"); - generator.writeStartObject(); - for (Map.Entry item0 : this.properties.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.runtime)) { - generator.writeKey("runtime"); - generator.writeStartObject(); - for (Map.Entry item0 : this.runtime.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PutMappingRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private FieldNamesField fieldNames; - - @Nullable - private Map meta; - - @Nullable - private RoutingField routing; - - @Nullable - private SourceField source; - - @Nullable - private Boolean allowNoIndices; - - @Nullable - private Boolean dateDetection; - - @Nullable - private DynamicMapping dynamic; - - @Nullable - private List dynamicDateFormats; - - @Nullable - private List> dynamicTemplates; - - @Nullable - private List expandWildcards; - - @Nullable - private Boolean ignoreUnavailable; - - private List index; - - @Nullable - private Time masterTimeout; - - @Nullable - private Boolean numericDetection; - - @Nullable - private Map properties; - - @Nullable - private Map runtime; - - @Nullable - private Time timeout; - - @Nullable - private Boolean writeIndexOnly; - - /** - * Control whether field names are enabled for the index. - *

- * API name: {@code _field_names} - */ - public final Builder fieldNames(@Nullable FieldNamesField value) { - this.fieldNames = value; - return this; - } - - /** - * Control whether field names are enabled for the index. - *

- * API name: {@code _field_names} - */ - public final Builder fieldNames(Function> fn) { - return this.fieldNames(fn.apply(new FieldNamesField.Builder()).build()); - } - - /** - * A mapping type can have custom meta data associated with it. These are not - * used at all by Elasticsearch, but can be used to store application-specific - * metadata. - *

- * API name: {@code _meta} - *

- * Adds all entries of map to meta. - */ - public final Builder meta(Map map) { - this.meta = _mapPutAll(this.meta, map); - return this; - } - - /** - * A mapping type can have custom meta data associated with it. These are not - * used at all by Elasticsearch, but can be used to store application-specific - * metadata. - *

- * API name: {@code _meta} - *

- * Adds an entry to meta. - */ - public final Builder meta(String key, JsonData value) { - this.meta = _mapPut(this.meta, key, value); - return this; - } - - /** - * Enable making a routing value required on indexed documents. - *

- * API name: {@code _routing} - */ - public final Builder routing(@Nullable RoutingField value) { - this.routing = value; - return this; - } - - /** - * Enable making a routing value required on indexed documents. - *

- * API name: {@code _routing} - */ - public final Builder routing(Function> fn) { - return this.routing(fn.apply(new RoutingField.Builder()).build()); - } - - /** - * Control whether the _source field is enabled on the index. - *

- * API name: {@code _source} - */ - public final Builder source(@Nullable SourceField value) { - this.source = value; - return this; - } - - /** - * Control whether the _source field is enabled on the index. - *

- * API name: {@code _source} - */ - public final Builder source(Function> fn) { - return this.source(fn.apply(new SourceField.Builder()).build()); - } - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. - *

- * API name: {@code allow_no_indices} - */ - public final Builder allowNoIndices(@Nullable Boolean value) { - this.allowNoIndices = value; - return this; - } - - /** - * Controls whether dynamic date detection is enabled. - *

- * API name: {@code date_detection} - */ - public final Builder dateDetection(@Nullable Boolean value) { - this.dateDetection = value; - return this; - } - - /** - * Controls whether new fields are added dynamically. - *

- * API name: {@code dynamic} - */ - public final Builder dynamic(@Nullable DynamicMapping value) { - this.dynamic = value; - return this; - } - - /** - * If date detection is enabled then new string fields are checked against - * 'dynamic_date_formats' and if the value matches then a new date field is - * added instead of string. - *

- * API name: {@code dynamic_date_formats} - *

- * Adds all elements of list to dynamicDateFormats. - */ - public final Builder dynamicDateFormats(List list) { - this.dynamicDateFormats = _listAddAll(this.dynamicDateFormats, list); - return this; - } - - /** - * If date detection is enabled then new string fields are checked against - * 'dynamic_date_formats' and if the value matches then a new date field is - * added instead of string. - *

- * API name: {@code dynamic_date_formats} - *

- * Adds one or more values to dynamicDateFormats. - */ - public final Builder dynamicDateFormats(String value, String... values) { - this.dynamicDateFormats = _listAdd(this.dynamicDateFormats, value, values); - return this; - } - - /** - * Specify dynamic templates for the mapping. - *

- * API name: {@code dynamic_templates} - *

- * Adds all elements of list to dynamicTemplates. - */ - public final Builder dynamicTemplates(List> list) { - this.dynamicTemplates = _listAddAll(this.dynamicTemplates, list); - return this; - } - - /** - * Specify dynamic templates for the mapping. - *

- * API name: {@code dynamic_templates} - *

- * Adds one or more values to dynamicTemplates. - */ - public final Builder dynamicTemplates(Map value, - Map... values) { - this.dynamicTemplates = _listAdd(this.dynamicTemplates, value, values); - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * If false, the request returns an error if it targets a missing - * or closed index. - *

- * API name: {@code ignore_unavailable} - */ - public final Builder ignoreUnavailable(@Nullable Boolean value) { - this.ignoreUnavailable = value; - return this; - } - - /** - * Required - A comma-separated list of index names the mapping should be added - * to (supports wildcards); use _all or omit to add the mapping on - * all indices. - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * Required - A comma-separated list of index names the mapping should be added - * to (supports wildcards); use _all or omit to add the mapping on - * all indices. - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Automatically map strings into numeric data types for all fields. - *

- * API name: {@code numeric_detection} - */ - public final Builder numericDetection(@Nullable Boolean value) { - this.numericDetection = value; - return this; - } - - /** - * Mapping for a field. For new fields, this mapping can include: - *

    - *
  • Field name
  • - *
  • Field data type
  • - *
  • Mapping parameters
  • - *
- *

- * API name: {@code properties} - *

- * Adds all entries of map to properties. - */ - public final Builder properties(Map map) { - this.properties = _mapPutAll(this.properties, map); - return this; - } - - /** - * Mapping for a field. For new fields, this mapping can include: - *

    - *
  • Field name
  • - *
  • Field data type
  • - *
  • Mapping parameters
  • - *
- *

- * API name: {@code properties} - *

- * Adds an entry to properties. - */ - public final Builder properties(String key, Property value) { - this.properties = _mapPut(this.properties, key, value); - return this; - } - - /** - * Mapping for a field. For new fields, this mapping can include: - *

    - *
  • Field name
  • - *
  • Field data type
  • - *
  • Mapping parameters
  • - *
- *

- * API name: {@code properties} - *

- * Adds an entry to properties using a builder lambda. - */ - public final Builder properties(String key, Function> fn) { - return properties(key, fn.apply(new Property.Builder()).build()); - } - - /** - * Mapping of runtime fields for the index. - *

- * API name: {@code runtime} - *

- * Adds all entries of map to runtime. - */ - public final Builder runtime(Map map) { - this.runtime = _mapPutAll(this.runtime, map); - return this; - } - - /** - * Mapping of runtime fields for the index. - *

- * API name: {@code runtime} - *

- * Adds an entry to runtime. - */ - public final Builder runtime(String key, RuntimeField value) { - this.runtime = _mapPut(this.runtime, key, value); - return this; - } - - /** - * Mapping of runtime fields for the index. - *

- * API name: {@code runtime} - *

- * Adds an entry to runtime using a builder lambda. - */ - public final Builder runtime(String key, Function> fn) { - return runtime(key, fn.apply(new RuntimeField.Builder()).build()); - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - /** - * If true, the mappings are applied only to the current write - * index for the target. - *

- * API name: {@code write_index_only} - */ - public final Builder writeIndexOnly(@Nullable Boolean value) { - this.writeIndexOnly = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PutMappingRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PutMappingRequest build() { - _checkSingleUse(); - - return new PutMappingRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PutMappingRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, PutMappingRequest::setupPutMappingRequestDeserializer); - - protected static void setupPutMappingRequestDeserializer(ObjectDeserializer op) { - - op.add(Builder::fieldNames, FieldNamesField._DESERIALIZER, "_field_names"); - op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta"); - op.add(Builder::routing, RoutingField._DESERIALIZER, "_routing"); - op.add(Builder::source, SourceField._DESERIALIZER, "_source"); - op.add(Builder::dateDetection, JsonpDeserializer.booleanDeserializer(), "date_detection"); - op.add(Builder::dynamic, DynamicMapping._DESERIALIZER, "dynamic"); - op.add(Builder::dynamicDateFormats, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "dynamic_date_formats"); - op.add(Builder::dynamicTemplates, JsonpDeserializer.arrayDeserializer( - JsonpDeserializer.stringMapDeserializer(DynamicTemplate._DESERIALIZER)), "dynamic_templates"); - op.add(Builder::numericDetection, JsonpDeserializer.booleanDeserializer(), "numeric_detection"); - op.add(Builder::properties, JsonpDeserializer.stringMapDeserializer(Property._DESERIALIZER), "properties"); - op.add(Builder::runtime, JsonpDeserializer.stringMapDeserializer(RuntimeField._DESERIALIZER), "runtime"); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.put_mapping}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.put_mapping", - - // Request method - request -> { - return "PUT"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_mapping"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.writeIndexOnly != null) { - params.put("write_index_only", String.valueOf(request.writeIndexOnly)); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), true, PutMappingResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutMappingResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutMappingResponse.java deleted file mode 100644 index be50ff1ee..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutMappingResponse.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.IndicesResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.put_mapping.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class PutMappingResponse extends IndicesResponseBase { - // --------------------------------------------------------------------------------------------- - - private PutMappingResponse(Builder builder) { - super(builder); - - } - - public static PutMappingResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PutMappingResponse}. - */ - - public static class Builder extends IndicesResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PutMappingResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PutMappingResponse build() { - _checkSingleUse(); - - return new PutMappingResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PutMappingResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, PutMappingResponse::setupPutMappingResponseDeserializer); - - protected static void setupPutMappingResponseDeserializer(ObjectDeserializer op) { - IndicesResponseBase.setupIndicesResponseBaseDeserializer(op); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutTemplateRequest.java deleted file mode 100644 index 5565de8d4..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutTemplateRequest.java +++ /dev/null @@ -1,591 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Integer; -import java.lang.Long; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.put_template.Request - -/** - * Create or update an index template. Index templates define settings, - * mappings, and aliases that can be applied automatically to new indices. - * - * @see API - * specification - */ -@JsonpDeserializable -public class PutTemplateRequest extends RequestBase implements JsonpSerializable { - private final Map aliases; - - @Nullable - private final String cause; - - @Nullable - private final Boolean create; - - private final List indexPatterns; - - @Nullable - private final TypeMapping mappings; - - @Nullable - private final Time masterTimeout; - - private final String name; - - @Nullable - private final Integer order; - - @Nullable - private final IndexSettings settings; - - @Nullable - private final Long version; - - // --------------------------------------------------------------------------------------------- - - private PutTemplateRequest(Builder builder) { - - this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); - this.cause = builder.cause; - this.create = builder.create; - this.indexPatterns = ApiTypeHelper.unmodifiable(builder.indexPatterns); - this.mappings = builder.mappings; - this.masterTimeout = builder.masterTimeout; - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.order = builder.order; - this.settings = builder.settings; - this.version = builder.version; - - } - - public static PutTemplateRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Aliases for the index. - *

- * API name: {@code aliases} - */ - public final Map aliases() { - return this.aliases; - } - - /** - * API name: {@code cause} - */ - @Nullable - public final String cause() { - return this.cause; - } - - /** - * If true, this request cannot replace or update existing index templates. - *

- * API name: {@code create} - */ - @Nullable - public final Boolean create() { - return this.create; - } - - /** - * Array of wildcard expressions used to match the names of indices during - * creation. - *

- * API name: {@code index_patterns} - */ - public final List indexPatterns() { - return this.indexPatterns; - } - - /** - * Mapping for fields in the index. - *

- * API name: {@code mappings} - */ - @Nullable - public final TypeMapping mappings() { - return this.mappings; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Required - The name of the template - *

- * API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Order in which Elasticsearch applies this template if index matches multiple - * templates. - *

- * Templates with lower 'order' values are merged first. Templates with higher - * 'order' values are merged later, overriding templates with lower values. - *

- * API name: {@code order} - */ - @Nullable - public final Integer order() { - return this.order; - } - - /** - * Configuration options for the index. - *

- * API name: {@code settings} - */ - @Nullable - public final IndexSettings settings() { - return this.settings; - } - - /** - * Version number used to manage index templates externally. This number is not - * automatically generated by Elasticsearch. - *

- * API name: {@code version} - */ - @Nullable - public final Long version() { - return this.version; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.aliases)) { - generator.writeKey("aliases"); - generator.writeStartObject(); - for (Map.Entry item0 : this.aliases.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.indexPatterns)) { - generator.writeKey("index_patterns"); - generator.writeStartArray(); - for (String item0 : this.indexPatterns) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (this.mappings != null) { - generator.writeKey("mappings"); - this.mappings.serialize(generator, mapper); - - } - if (this.order != null) { - generator.writeKey("order"); - generator.write(this.order); - - } - if (this.settings != null) { - generator.writeKey("settings"); - this.settings.serialize(generator, mapper); - - } - if (this.version != null) { - generator.writeKey("version"); - generator.write(this.version); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PutTemplateRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Map aliases; - - @Nullable - private String cause; - - @Nullable - private Boolean create; - - @Nullable - private List indexPatterns; - - @Nullable - private TypeMapping mappings; - - @Nullable - private Time masterTimeout; - - private String name; - - @Nullable - private Integer order; - - @Nullable - private IndexSettings settings; - - @Nullable - private Long version; - - /** - * Aliases for the index. - *

- * API name: {@code aliases} - *

- * Adds all entries of map to aliases. - */ - public final Builder aliases(Map map) { - this.aliases = _mapPutAll(this.aliases, map); - return this; - } - - /** - * Aliases for the index. - *

- * API name: {@code aliases} - *

- * Adds an entry to aliases. - */ - public final Builder aliases(String key, Alias value) { - this.aliases = _mapPut(this.aliases, key, value); - return this; - } - - /** - * Aliases for the index. - *

- * API name: {@code aliases} - *

- * Adds an entry to aliases using a builder lambda. - */ - public final Builder aliases(String key, Function> fn) { - return aliases(key, fn.apply(new Alias.Builder()).build()); - } - - /** - * API name: {@code cause} - */ - public final Builder cause(@Nullable String value) { - this.cause = value; - return this; - } - - /** - * If true, this request cannot replace or update existing index templates. - *

- * API name: {@code create} - */ - public final Builder create(@Nullable Boolean value) { - this.create = value; - return this; - } - - /** - * Array of wildcard expressions used to match the names of indices during - * creation. - *

- * API name: {@code index_patterns} - *

- * Adds all elements of list to indexPatterns. - */ - public final Builder indexPatterns(List list) { - this.indexPatterns = _listAddAll(this.indexPatterns, list); - return this; - } - - /** - * Array of wildcard expressions used to match the names of indices during - * creation. - *

- * API name: {@code index_patterns} - *

- * Adds one or more values to indexPatterns. - */ - public final Builder indexPatterns(String value, String... values) { - this.indexPatterns = _listAdd(this.indexPatterns, value, values); - return this; - } - - /** - * Mapping for fields in the index. - *

- * API name: {@code mappings} - */ - public final Builder mappings(@Nullable TypeMapping value) { - this.mappings = value; - return this; - } - - /** - * Mapping for fields in the index. - *

- * API name: {@code mappings} - */ - public final Builder mappings(Function> fn) { - return this.mappings(fn.apply(new TypeMapping.Builder()).build()); - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - The name of the template - *

- * API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Order in which Elasticsearch applies this template if index matches multiple - * templates. - *

- * Templates with lower 'order' values are merged first. Templates with higher - * 'order' values are merged later, overriding templates with lower values. - *

- * API name: {@code order} - */ - public final Builder order(@Nullable Integer value) { - this.order = value; - return this; - } - - /** - * Configuration options for the index. - *

- * API name: {@code settings} - */ - public final Builder settings(@Nullable IndexSettings value) { - this.settings = value; - return this; - } - - /** - * Configuration options for the index. - *

- * API name: {@code settings} - */ - public final Builder settings(Function> fn) { - return this.settings(fn.apply(new IndexSettings.Builder()).build()); - } - - /** - * Version number used to manage index templates externally. This number is not - * automatically generated by Elasticsearch. - *

- * API name: {@code version} - */ - public final Builder version(@Nullable Long value) { - this.version = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PutTemplateRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PutTemplateRequest build() { - _checkSingleUse(); - - return new PutTemplateRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PutTemplateRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, PutTemplateRequest::setupPutTemplateRequestDeserializer); - - protected static void setupPutTemplateRequestDeserializer(ObjectDeserializer op) { - - op.add(Builder::aliases, JsonpDeserializer.stringMapDeserializer(Alias._DESERIALIZER), "aliases"); - op.add(Builder::indexPatterns, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "index_patterns"); - op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings"); - op.add(Builder::order, JsonpDeserializer.integerDeserializer(), "order"); - op.add(Builder::settings, IndexSettings._DESERIALIZER, "settings"); - op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version"); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.put_template}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.put_template", - - // Request method - request -> { - return "PUT"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_template"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - params.put("name", request.name); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.create != null) { - params.put("create", String.valueOf(request.create)); - } - if (request.cause != null) { - params.put("cause", request.cause); - } - return params; - - }, SimpleEndpoint.emptyMap(), true, PutTemplateResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutTemplateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutTemplateResponse.java deleted file mode 100644 index dd12b6c88..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutTemplateResponse.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.put_template.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class PutTemplateResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private PutTemplateResponse(Builder builder) { - super(builder); - - } - - public static PutTemplateResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PutTemplateResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PutTemplateResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PutTemplateResponse build() { - _checkSingleUse(); - - return new PutTemplateResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PutTemplateResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, PutTemplateResponse::setupPutTemplateResponseDeserializer); - - protected static void setupPutTemplateResponseDeserializer(ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Queries.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Queries.java deleted file mode 100644 index f5db74497..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Queries.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.Queries - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class Queries implements JsonpSerializable { - @Nullable - private final CacheQueries cache; - - // --------------------------------------------------------------------------------------------- - - private Queries(Builder builder) { - - this.cache = builder.cache; - - } - - public static Queries of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code cache} - */ - @Nullable - public final CacheQueries cache() { - return this.cache; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.cache != null) { - generator.writeKey("cache"); - this.cache.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link Queries}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private CacheQueries cache; - - /** - * API name: {@code cache} - */ - public final Builder cache(@Nullable CacheQueries value) { - this.cache = value; - return this; - } - - /** - * API name: {@code cache} - */ - public final Builder cache(Function> fn) { - return this.cache(fn.apply(new CacheQueries.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link Queries}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public Queries build() { - _checkSingleUse(); - - return new Queries(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link Queries} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - Queries::setupQueriesDeserializer); - - protected static void setupQueriesDeserializer(ObjectDeserializer op) { - - op.add(Builder::cache, CacheQueries._DESERIALIZER, "cache"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RefreshRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RefreshRequest.java deleted file mode 100644 index 218b5a1c4..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RefreshRequest.java +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.refresh.Request - -/** - * Refresh an index. A refresh makes recent operations performed on one or more - * indices available for search. For data streams, the API runs the refresh - * operation on the stream’s backing indices. - * - * @see API - * specification - */ - -public class RefreshRequest extends RequestBase { - @Nullable - private final Boolean allowNoIndices; - - private final List expandWildcards; - - @Nullable - private final Boolean ignoreUnavailable; - - private final List index; - - // --------------------------------------------------------------------------------------------- - - private RefreshRequest(Builder builder) { - - this.allowNoIndices = builder.allowNoIndices; - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.ignoreUnavailable = builder.ignoreUnavailable; - this.index = ApiTypeHelper.unmodifiable(builder.index); - - } - - public static RefreshRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. - *

- * API name: {@code allow_no_indices} - */ - @Nullable - public final Boolean allowNoIndices() { - return this.allowNoIndices; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * If false, the request returns an error if it targets a missing - * or closed index. - *

- * API name: {@code ignore_unavailable} - */ - @Nullable - public final Boolean ignoreUnavailable() { - return this.ignoreUnavailable; - } - - /** - * Comma-separated list of data streams, indices, and aliases used to limit the - * request. Supports wildcards (*). To target all data streams and - * indices, omit this parameter or use * or _all. - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link RefreshRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { - @Nullable - private Boolean allowNoIndices; - - @Nullable - private List expandWildcards; - - @Nullable - private Boolean ignoreUnavailable; - - @Nullable - private List index; - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. - *

- * API name: {@code allow_no_indices} - */ - public final Builder allowNoIndices(@Nullable Boolean value) { - this.allowNoIndices = value; - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * If false, the request returns an error if it targets a missing - * or closed index. - *

- * API name: {@code ignore_unavailable} - */ - public final Builder ignoreUnavailable(@Nullable Boolean value) { - this.ignoreUnavailable = value; - return this; - } - - /** - * Comma-separated list of data streams, indices, and aliases used to limit the - * request. Supports wildcards (*). To target all data streams and - * indices, omit this parameter or use * or _all. - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * Comma-separated list of data streams, indices, and aliases used to limit the - * request. Supports wildcards (*). To target all data streams and - * indices, omit this parameter or use * or _all. - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link RefreshRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public RefreshRequest build() { - _checkSingleUse(); - - return new RefreshRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.refresh}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.refresh", - - // Request method - request -> { - return "POST"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.index())) - propsSet |= _index; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_refresh"); - return buf.toString(); - } - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_refresh"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _index = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.index())) - propsSet |= _index; - - if (propsSet == 0) { - } - if (propsSet == (_index)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, RefreshResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RefreshResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RefreshResponse.java deleted file mode 100644 index c000085e2..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RefreshResponse.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ShardsOperationResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.refresh.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class RefreshResponse extends ShardsOperationResponseBase { - // --------------------------------------------------------------------------------------------- - - private RefreshResponse(Builder builder) { - super(builder); - - } - - public static RefreshResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link RefreshResponse}. - */ - - public static class Builder extends ShardsOperationResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link RefreshResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public RefreshResponse build() { - _checkSingleUse(); - - return new RefreshResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link RefreshResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - RefreshResponse::setupRefreshResponseDeserializer); - - protected static void setupRefreshResponseDeserializer(ObjectDeserializer op) { - ShardsOperationResponseBase.setupShardsOperationResponseBaseDeserializer(op); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ResolveIndexRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ResolveIndexRequest.java deleted file mode 100644 index 1e6af297b..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ResolveIndexRequest.java +++ /dev/null @@ -1,340 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.resolve_index.Request - -/** - * Resolves the specified name(s) and/or index patterns for indices, aliases, - * and data streams. Multiple patterns and remote clusters are supported. - * - * @see API - * specification - */ - -public class ResolveIndexRequest extends RequestBase { - @Nullable - private final Boolean allowNoIndices; - - private final List expandWildcards; - - @Nullable - private final Boolean ignoreUnavailable; - - private final List name; - - // --------------------------------------------------------------------------------------------- - - private ResolveIndexRequest(Builder builder) { - - this.allowNoIndices = builder.allowNoIndices; - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.ignoreUnavailable = builder.ignoreUnavailable; - this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); - - } - - public static ResolveIndexRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. For example, a request targeting foo*,bar* returns an - * error if an index starts with foo but no index starts with - * bar. - *

- * API name: {@code allow_no_indices} - */ - @Nullable - public final Boolean allowNoIndices() { - return this.allowNoIndices; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * If false, the request returns an error if it targets a missing - * or closed index. - *

- * API name: {@code ignore_unavailable} - */ - @Nullable - public final Boolean ignoreUnavailable() { - return this.ignoreUnavailable; - } - - /** - * Required - Comma-separated name(s) or index pattern(s) of the indices, - * aliases, and data streams to resolve. Resources on remote clusters can be - * specified using the <cluster>:<name> - * syntax. - *

- * API name: {@code name} - */ - public final List name() { - return this.name; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ResolveIndexRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Boolean allowNoIndices; - - @Nullable - private List expandWildcards; - - @Nullable - private Boolean ignoreUnavailable; - - private List name; - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. For example, a request targeting foo*,bar* returns an - * error if an index starts with foo but no index starts with - * bar. - *

- * API name: {@code allow_no_indices} - */ - public final Builder allowNoIndices(@Nullable Boolean value) { - this.allowNoIndices = value; - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * If false, the request returns an error if it targets a missing - * or closed index. - *

- * API name: {@code ignore_unavailable} - */ - public final Builder ignoreUnavailable(@Nullable Boolean value) { - this.ignoreUnavailable = value; - return this; - } - - /** - * Required - Comma-separated name(s) or index pattern(s) of the indices, - * aliases, and data streams to resolve. Resources on remote clusters can be - * specified using the <cluster>:<name> - * syntax. - *

- * API name: {@code name} - *

- * Adds all elements of list to name. - */ - public final Builder name(List list) { - this.name = _listAddAll(this.name, list); - return this; - } - - /** - * Required - Comma-separated name(s) or index pattern(s) of the indices, - * aliases, and data streams to resolve. Resources on remote clusters can be - * specified using the <cluster>:<name> - * syntax. - *

- * API name: {@code name} - *

- * Adds one or more values to name. - */ - public final Builder name(String value, String... values) { - this.name = _listAdd(this.name, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ResolveIndexRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ResolveIndexRequest build() { - _checkSingleUse(); - - return new ResolveIndexRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.resolve_index}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.resolve_index", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_resolve"); - buf.append("/index"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, ResolveIndexResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ResolveIndexResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ResolveIndexResponse.java deleted file mode 100644 index 789d67994..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ResolveIndexResponse.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch.indices.resolve_index.ResolveIndexAliasItem; -import co.elastic.clients.elasticsearch.indices.resolve_index.ResolveIndexDataStreamsItem; -import co.elastic.clients.elasticsearch.indices.resolve_index.ResolveIndexItem; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.resolve_index.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ResolveIndexResponse implements JsonpSerializable { - private final List indices; - - private final List aliases; - - private final List dataStreams; - - // --------------------------------------------------------------------------------------------- - - private ResolveIndexResponse(Builder builder) { - - this.indices = ApiTypeHelper.unmodifiableRequired(builder.indices, this, "indices"); - this.aliases = ApiTypeHelper.unmodifiableRequired(builder.aliases, this, "aliases"); - this.dataStreams = ApiTypeHelper.unmodifiableRequired(builder.dataStreams, this, "dataStreams"); - - } - - public static ResolveIndexResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code indices} - */ - public final List indices() { - return this.indices; - } - - /** - * Required - API name: {@code aliases} - */ - public final List aliases() { - return this.aliases; - } - - /** - * Required - API name: {@code data_streams} - */ - public final List dataStreams() { - return this.dataStreams; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.indices)) { - generator.writeKey("indices"); - generator.writeStartArray(); - for (ResolveIndexItem item0 : this.indices) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.aliases)) { - generator.writeKey("aliases"); - generator.writeStartArray(); - for (ResolveIndexAliasItem item0 : this.aliases) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.dataStreams)) { - generator.writeKey("data_streams"); - generator.writeStartArray(); - for (ResolveIndexDataStreamsItem item0 : this.dataStreams) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ResolveIndexResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private List indices; - - private List aliases; - - private List dataStreams; - - /** - * Required - API name: {@code indices} - *

- * Adds all elements of list to indices. - */ - public final Builder indices(List list) { - this.indices = _listAddAll(this.indices, list); - return this; - } - - /** - * Required - API name: {@code indices} - *

- * Adds one or more values to indices. - */ - public final Builder indices(ResolveIndexItem value, ResolveIndexItem... values) { - this.indices = _listAdd(this.indices, value, values); - return this; - } - - /** - * Required - API name: {@code indices} - *

- * Adds a value to indices using a builder lambda. - */ - public final Builder indices(Function> fn) { - return indices(fn.apply(new ResolveIndexItem.Builder()).build()); - } - - /** - * Required - API name: {@code aliases} - *

- * Adds all elements of list to aliases. - */ - public final Builder aliases(List list) { - this.aliases = _listAddAll(this.aliases, list); - return this; - } - - /** - * Required - API name: {@code aliases} - *

- * Adds one or more values to aliases. - */ - public final Builder aliases(ResolveIndexAliasItem value, ResolveIndexAliasItem... values) { - this.aliases = _listAdd(this.aliases, value, values); - return this; - } - - /** - * Required - API name: {@code aliases} - *

- * Adds a value to aliases using a builder lambda. - */ - public final Builder aliases(Function> fn) { - return aliases(fn.apply(new ResolveIndexAliasItem.Builder()).build()); - } - - /** - * Required - API name: {@code data_streams} - *

- * Adds all elements of list to dataStreams. - */ - public final Builder dataStreams(List list) { - this.dataStreams = _listAddAll(this.dataStreams, list); - return this; - } - - /** - * Required - API name: {@code data_streams} - *

- * Adds one or more values to dataStreams. - */ - public final Builder dataStreams(ResolveIndexDataStreamsItem value, ResolveIndexDataStreamsItem... values) { - this.dataStreams = _listAdd(this.dataStreams, value, values); - return this; - } - - /** - * Required - API name: {@code data_streams} - *

- * Adds a value to dataStreams using a builder lambda. - */ - public final Builder dataStreams( - Function> fn) { - return dataStreams(fn.apply(new ResolveIndexDataStreamsItem.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ResolveIndexResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ResolveIndexResponse build() { - _checkSingleUse(); - - return new ResolveIndexResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ResolveIndexResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ResolveIndexResponse::setupResolveIndexResponseDeserializer); - - protected static void setupResolveIndexResponseDeserializer(ObjectDeserializer op) { - - op.add(Builder::indices, JsonpDeserializer.arrayDeserializer(ResolveIndexItem._DESERIALIZER), "indices"); - op.add(Builder::aliases, JsonpDeserializer.arrayDeserializer(ResolveIndexAliasItem._DESERIALIZER), "aliases"); - op.add(Builder::dataStreams, JsonpDeserializer.arrayDeserializer(ResolveIndexDataStreamsItem._DESERIALIZER), - "data_streams"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RetentionLease.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RetentionLease.java deleted file mode 100644 index 0111463c2..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RetentionLease.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.RetentionLease - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class RetentionLease implements JsonpSerializable { - private final Time period; - - // --------------------------------------------------------------------------------------------- - - private RetentionLease(Builder builder) { - - this.period = ApiTypeHelper.requireNonNull(builder.period, this, "period"); - - } - - public static RetentionLease of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code period} - */ - public final Time period() { - return this.period; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("period"); - this.period.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link RetentionLease}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Time period; - - /** - * Required - API name: {@code period} - */ - public final Builder period(Time value) { - this.period = value; - return this; - } - - /** - * Required - API name: {@code period} - */ - public final Builder period(Function> fn) { - return this.period(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link RetentionLease}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public RetentionLease build() { - _checkSingleUse(); - - return new RetentionLease(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link RetentionLease} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - RetentionLease::setupRetentionLeaseDeserializer); - - protected static void setupRetentionLeaseDeserializer(ObjectDeserializer op) { - - op.add(Builder::period, Time._DESERIALIZER, "period"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RolloverRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RolloverRequest.java deleted file mode 100644 index 6c6fb15d4..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RolloverRequest.java +++ /dev/null @@ -1,643 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.elasticsearch._types.WaitForActiveShards; -import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; -import co.elastic.clients.elasticsearch.indices.rollover.RolloverConditions; -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.rollover.Request - -/** - * Roll over to a new index. Creates a new index for a data stream or index - * alias. - * - * @see API - * specification - */ -@JsonpDeserializable -public class RolloverRequest extends RequestBase implements JsonpSerializable { - private final String alias; - - private final Map aliases; - - @Nullable - private final RolloverConditions conditions; - - @Nullable - private final Boolean dryRun; - - @Nullable - private final TypeMapping mappings; - - @Nullable - private final Time masterTimeout; - - @Nullable - private final String newIndex; - - private final Map settings; - - @Nullable - private final Time timeout; - - @Nullable - private final WaitForActiveShards waitForActiveShards; - - // --------------------------------------------------------------------------------------------- - - private RolloverRequest(Builder builder) { - - this.alias = ApiTypeHelper.requireNonNull(builder.alias, this, "alias"); - this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); - this.conditions = builder.conditions; - this.dryRun = builder.dryRun; - this.mappings = builder.mappings; - this.masterTimeout = builder.masterTimeout; - this.newIndex = builder.newIndex; - this.settings = ApiTypeHelper.unmodifiable(builder.settings); - this.timeout = builder.timeout; - this.waitForActiveShards = builder.waitForActiveShards; - - } - - public static RolloverRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Name of the data stream or index alias to roll over. - *

- * API name: {@code alias} - */ - public final String alias() { - return this.alias; - } - - /** - * Aliases for the target index. Data streams do not support this parameter. - *

- * API name: {@code aliases} - */ - public final Map aliases() { - return this.aliases; - } - - /** - * Conditions for the rollover. If specified, Elasticsearch only performs the - * rollover if the current index satisfies these conditions. If this parameter - * is not specified, Elasticsearch performs the rollover unconditionally. If - * conditions are specified, at least one of them must be a max_* - * condition. The index will rollover if any max_* condition is - * satisfied and all min_* conditions are satisfied. - *

- * API name: {@code conditions} - */ - @Nullable - public final RolloverConditions conditions() { - return this.conditions; - } - - /** - * If true, checks whether the current index satisfies the - * specified conditions but does not perform a rollover. - *

- * API name: {@code dry_run} - */ - @Nullable - public final Boolean dryRun() { - return this.dryRun; - } - - /** - * Mapping for fields in the index. If specified, this mapping can include field - * names, field data types, and mapping paramaters. - *

- * API name: {@code mappings} - */ - @Nullable - public final TypeMapping mappings() { - return this.mappings; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Name of the index to create. Supports date math. Data streams do not support - * this parameter. - *

- * API name: {@code new_index} - */ - @Nullable - public final String newIndex() { - return this.newIndex; - } - - /** - * Configuration options for the index. Data streams do not support this - * parameter. - *

- * API name: {@code settings} - */ - public final Map settings() { - return this.settings; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - /** - * The number of shard copies that must be active before proceeding with the - * operation. Set to all or any positive integer up to the total number of - * shards in the index (number_of_replicas+1). - *

- * API name: {@code wait_for_active_shards} - */ - @Nullable - public final WaitForActiveShards waitForActiveShards() { - return this.waitForActiveShards; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.aliases)) { - generator.writeKey("aliases"); - generator.writeStartObject(); - for (Map.Entry item0 : this.aliases.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.conditions != null) { - generator.writeKey("conditions"); - this.conditions.serialize(generator, mapper); - - } - if (this.mappings != null) { - generator.writeKey("mappings"); - this.mappings.serialize(generator, mapper); - - } - if (ApiTypeHelper.isDefined(this.settings)) { - generator.writeKey("settings"); - generator.writeStartObject(); - for (Map.Entry item0 : this.settings.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link RolloverRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { - private String alias; - - @Nullable - private Map aliases; - - @Nullable - private RolloverConditions conditions; - - @Nullable - private Boolean dryRun; - - @Nullable - private TypeMapping mappings; - - @Nullable - private Time masterTimeout; - - @Nullable - private String newIndex; - - @Nullable - private Map settings; - - @Nullable - private Time timeout; - - @Nullable - private WaitForActiveShards waitForActiveShards; - - /** - * Required - Name of the data stream or index alias to roll over. - *

- * API name: {@code alias} - */ - public final Builder alias(String value) { - this.alias = value; - return this; - } - - /** - * Aliases for the target index. Data streams do not support this parameter. - *

- * API name: {@code aliases} - *

- * Adds all entries of map to aliases. - */ - public final Builder aliases(Map map) { - this.aliases = _mapPutAll(this.aliases, map); - return this; - } - - /** - * Aliases for the target index. Data streams do not support this parameter. - *

- * API name: {@code aliases} - *

- * Adds an entry to aliases. - */ - public final Builder aliases(String key, Alias value) { - this.aliases = _mapPut(this.aliases, key, value); - return this; - } - - /** - * Aliases for the target index. Data streams do not support this parameter. - *

- * API name: {@code aliases} - *

- * Adds an entry to aliases using a builder lambda. - */ - public final Builder aliases(String key, Function> fn) { - return aliases(key, fn.apply(new Alias.Builder()).build()); - } - - /** - * Conditions for the rollover. If specified, Elasticsearch only performs the - * rollover if the current index satisfies these conditions. If this parameter - * is not specified, Elasticsearch performs the rollover unconditionally. If - * conditions are specified, at least one of them must be a max_* - * condition. The index will rollover if any max_* condition is - * satisfied and all min_* conditions are satisfied. - *

- * API name: {@code conditions} - */ - public final Builder conditions(@Nullable RolloverConditions value) { - this.conditions = value; - return this; - } - - /** - * Conditions for the rollover. If specified, Elasticsearch only performs the - * rollover if the current index satisfies these conditions. If this parameter - * is not specified, Elasticsearch performs the rollover unconditionally. If - * conditions are specified, at least one of them must be a max_* - * condition. The index will rollover if any max_* condition is - * satisfied and all min_* conditions are satisfied. - *

- * API name: {@code conditions} - */ - public final Builder conditions(Function> fn) { - return this.conditions(fn.apply(new RolloverConditions.Builder()).build()); - } - - /** - * If true, checks whether the current index satisfies the - * specified conditions but does not perform a rollover. - *

- * API name: {@code dry_run} - */ - public final Builder dryRun(@Nullable Boolean value) { - this.dryRun = value; - return this; - } - - /** - * Mapping for fields in the index. If specified, this mapping can include field - * names, field data types, and mapping paramaters. - *

- * API name: {@code mappings} - */ - public final Builder mappings(@Nullable TypeMapping value) { - this.mappings = value; - return this; - } - - /** - * Mapping for fields in the index. If specified, this mapping can include field - * names, field data types, and mapping paramaters. - *

- * API name: {@code mappings} - */ - public final Builder mappings(Function> fn) { - return this.mappings(fn.apply(new TypeMapping.Builder()).build()); - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Name of the index to create. Supports date math. Data streams do not support - * this parameter. - *

- * API name: {@code new_index} - */ - public final Builder newIndex(@Nullable String value) { - this.newIndex = value; - return this; - } - - /** - * Configuration options for the index. Data streams do not support this - * parameter. - *

- * API name: {@code settings} - *

- * Adds all entries of map to settings. - */ - public final Builder settings(Map map) { - this.settings = _mapPutAll(this.settings, map); - return this; - } - - /** - * Configuration options for the index. Data streams do not support this - * parameter. - *

- * API name: {@code settings} - *

- * Adds an entry to settings. - */ - public final Builder settings(String key, JsonData value) { - this.settings = _mapPut(this.settings, key, value); - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - /** - * The number of shard copies that must be active before proceeding with the - * operation. Set to all or any positive integer up to the total number of - * shards in the index (number_of_replicas+1). - *

- * API name: {@code wait_for_active_shards} - */ - public final Builder waitForActiveShards(@Nullable WaitForActiveShards value) { - this.waitForActiveShards = value; - return this; - } - - /** - * The number of shard copies that must be active before proceeding with the - * operation. Set to all or any positive integer up to the total number of - * shards in the index (number_of_replicas+1). - *

- * API name: {@code wait_for_active_shards} - */ - public final Builder waitForActiveShards( - Function> fn) { - return this.waitForActiveShards(fn.apply(new WaitForActiveShards.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link RolloverRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public RolloverRequest build() { - _checkSingleUse(); - - return new RolloverRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link RolloverRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - RolloverRequest::setupRolloverRequestDeserializer); - - protected static void setupRolloverRequestDeserializer(ObjectDeserializer op) { - - op.add(Builder::aliases, JsonpDeserializer.stringMapDeserializer(Alias._DESERIALIZER), "aliases"); - op.add(Builder::conditions, RolloverConditions._DESERIALIZER, "conditions"); - op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings"); - op.add(Builder::settings, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "settings"); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.rollover}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.rollover", - - // Request method - request -> { - return "POST"; - - }, - - // Request path - request -> { - final int _newIndex = 1 << 0; - final int _alias = 1 << 1; - - int propsSet = 0; - - if (request.newIndex() != null) - propsSet |= _newIndex; - propsSet |= _alias; - - if (propsSet == (_alias)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.alias, buf); - buf.append("/_rollover"); - return buf.toString(); - } - if (propsSet == (_alias | _newIndex)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.alias, buf); - buf.append("/_rollover"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.newIndex, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _newIndex = 1 << 0; - final int _alias = 1 << 1; - - int propsSet = 0; - - if (request.newIndex() != null) - propsSet |= _newIndex; - propsSet |= _alias; - - if (propsSet == (_alias)) { - params.put("alias", request.alias); - } - if (propsSet == (_alias | _newIndex)) { - params.put("alias", request.alias); - params.put("newIndex", request.newIndex); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.waitForActiveShards != null) { - params.put("wait_for_active_shards", request.waitForActiveShards._toJsonString()); - } - if (request.dryRun != null) { - params.put("dry_run", String.valueOf(request.dryRun)); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), true, RolloverResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RolloverResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RolloverResponse.java deleted file mode 100644 index 1e54c4672..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RolloverResponse.java +++ /dev/null @@ -1,321 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponse; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.rollover.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class RolloverResponse implements AcknowledgedResponse, JsonpSerializable { - private final boolean acknowledged; - - private final Map conditions; - - private final boolean dryRun; - - private final String newIndex; - - private final String oldIndex; - - private final boolean rolledOver; - - private final boolean shardsAcknowledged; - - // --------------------------------------------------------------------------------------------- - - private RolloverResponse(Builder builder) { - - this.acknowledged = ApiTypeHelper.requireNonNull(builder.acknowledged, this, "acknowledged"); - this.conditions = ApiTypeHelper.unmodifiableRequired(builder.conditions, this, "conditions"); - this.dryRun = ApiTypeHelper.requireNonNull(builder.dryRun, this, "dryRun"); - this.newIndex = ApiTypeHelper.requireNonNull(builder.newIndex, this, "newIndex"); - this.oldIndex = ApiTypeHelper.requireNonNull(builder.oldIndex, this, "oldIndex"); - this.rolledOver = ApiTypeHelper.requireNonNull(builder.rolledOver, this, "rolledOver"); - this.shardsAcknowledged = ApiTypeHelper.requireNonNull(builder.shardsAcknowledged, this, "shardsAcknowledged"); - - } - - public static RolloverResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code acknowledged} - */ - public final boolean acknowledged() { - return this.acknowledged; - } - - /** - * Required - API name: {@code conditions} - */ - public final Map conditions() { - return this.conditions; - } - - /** - * Required - API name: {@code dry_run} - */ - public final boolean dryRun() { - return this.dryRun; - } - - /** - * Required - API name: {@code new_index} - */ - public final String newIndex() { - return this.newIndex; - } - - /** - * Required - API name: {@code old_index} - */ - public final String oldIndex() { - return this.oldIndex; - } - - /** - * Required - API name: {@code rolled_over} - */ - public final boolean rolledOver() { - return this.rolledOver; - } - - /** - * Required - API name: {@code shards_acknowledged} - */ - public final boolean shardsAcknowledged() { - return this.shardsAcknowledged; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("acknowledged"); - generator.write(this.acknowledged); - - if (ApiTypeHelper.isDefined(this.conditions)) { - generator.writeKey("conditions"); - generator.writeStartObject(); - for (Map.Entry item0 : this.conditions.entrySet()) { - generator.writeKey(item0.getKey()); - generator.write(item0.getValue()); - - } - generator.writeEnd(); - - } - generator.writeKey("dry_run"); - generator.write(this.dryRun); - - generator.writeKey("new_index"); - generator.write(this.newIndex); - - generator.writeKey("old_index"); - generator.write(this.oldIndex); - - generator.writeKey("rolled_over"); - generator.write(this.rolledOver); - - generator.writeKey("shards_acknowledged"); - generator.write(this.shardsAcknowledged); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link RolloverResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Boolean acknowledged; - - private Map conditions; - - private Boolean dryRun; - - private String newIndex; - - private String oldIndex; - - private Boolean rolledOver; - - private Boolean shardsAcknowledged; - - /** - * Required - API name: {@code acknowledged} - */ - public final Builder acknowledged(boolean value) { - this.acknowledged = value; - return this; - } - - /** - * Required - API name: {@code conditions} - *

- * Adds all entries of map to conditions. - */ - public final Builder conditions(Map map) { - this.conditions = _mapPutAll(this.conditions, map); - return this; - } - - /** - * Required - API name: {@code conditions} - *

- * Adds an entry to conditions. - */ - public final Builder conditions(String key, Boolean value) { - this.conditions = _mapPut(this.conditions, key, value); - return this; - } - - /** - * Required - API name: {@code dry_run} - */ - public final Builder dryRun(boolean value) { - this.dryRun = value; - return this; - } - - /** - * Required - API name: {@code new_index} - */ - public final Builder newIndex(String value) { - this.newIndex = value; - return this; - } - - /** - * Required - API name: {@code old_index} - */ - public final Builder oldIndex(String value) { - this.oldIndex = value; - return this; - } - - /** - * Required - API name: {@code rolled_over} - */ - public final Builder rolledOver(boolean value) { - this.rolledOver = value; - return this; - } - - /** - * Required - API name: {@code shards_acknowledged} - */ - public final Builder shardsAcknowledged(boolean value) { - this.shardsAcknowledged = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link RolloverResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public RolloverResponse build() { - _checkSingleUse(); - - return new RolloverResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link RolloverResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - RolloverResponse::setupRolloverResponseDeserializer); - - protected static void setupRolloverResponseDeserializer(ObjectDeserializer op) { - - op.add(Builder::acknowledged, JsonpDeserializer.booleanDeserializer(), "acknowledged"); - op.add(Builder::conditions, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.booleanDeserializer()), - "conditions"); - op.add(Builder::dryRun, JsonpDeserializer.booleanDeserializer(), "dry_run"); - op.add(Builder::newIndex, JsonpDeserializer.stringDeserializer(), "new_index"); - op.add(Builder::oldIndex, JsonpDeserializer.stringDeserializer(), "old_index"); - op.add(Builder::rolledOver, JsonpDeserializer.booleanDeserializer(), "rolled_over"); - op.add(Builder::shardsAcknowledged, JsonpDeserializer.booleanDeserializer(), "shards_acknowledged"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SearchIdle.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SearchIdle.java deleted file mode 100644 index b0d492f77..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SearchIdle.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.SearchIdle - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SearchIdle implements JsonpSerializable { - @Nullable - private final Time after; - - // --------------------------------------------------------------------------------------------- - - private SearchIdle(Builder builder) { - - this.after = builder.after; - - } - - public static SearchIdle of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code after} - */ - @Nullable - public final Time after() { - return this.after; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.after != null) { - generator.writeKey("after"); - this.after.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SearchIdle}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private Time after; - - /** - * API name: {@code after} - */ - public final Builder after(@Nullable Time value) { - this.after = value; - return this; - } - - /** - * API name: {@code after} - */ - public final Builder after(Function> fn) { - return this.after(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SearchIdle}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SearchIdle build() { - _checkSingleUse(); - - return new SearchIdle(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SearchIdle} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - SearchIdle::setupSearchIdleDeserializer); - - protected static void setupSearchIdleDeserializer(ObjectDeserializer op) { - - op.add(Builder::after, Time._DESERIALIZER, "after"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortMissing.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortMissing.java deleted file mode 100644 index 7cfbf1b3a..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortMissing.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum SegmentSortMissing implements JsonEnum { - Last("_last"), - - First("_first"), - - ; - - private final String jsonValue; - - SegmentSortMissing(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - SegmentSortMissing.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortMode.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortMode.java deleted file mode 100644 index b2625620c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortMode.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum SegmentSortMode implements JsonEnum { - Min("min", "MIN"), - - Max("max", "MAX"), - - ; - - private final String jsonValue; - private final String[] aliases; - - SegmentSortMode(String jsonValue, String... aliases) { - this.jsonValue = jsonValue; - this.aliases = aliases; - } - - public String jsonValue() { - return this.jsonValue; - } - - public String[] aliases() { - return this.aliases; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - SegmentSortMode.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortOrder.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortOrder.java deleted file mode 100644 index 565f50904..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortOrder.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum SegmentSortOrder implements JsonEnum { - Asc("asc", "ASC"), - - Desc("desc", "DESC"), - - ; - - private final String jsonValue; - private final String[] aliases; - - SegmentSortOrder(String jsonValue, String... aliases) { - this.jsonValue = jsonValue; - this.aliases = aliases; - } - - public String jsonValue() { - return this.jsonValue; - } - - public String[] aliases() { - return this.aliases; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - SegmentSortOrder.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsAnalyze.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsAnalyze.java deleted file mode 100644 index eb547c319..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsAnalyze.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.SettingsAnalyze - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SettingsAnalyze implements JsonpSerializable { - @Nullable - private final Integer maxTokenCount; - - // --------------------------------------------------------------------------------------------- - - private SettingsAnalyze(Builder builder) { - - this.maxTokenCount = builder.maxTokenCount; - - } - - public static SettingsAnalyze of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code max_token_count} - */ - @Nullable - public final Integer maxTokenCount() { - return this.maxTokenCount; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.maxTokenCount != null) { - generator.writeKey("max_token_count"); - generator.write(this.maxTokenCount); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SettingsAnalyze}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private Integer maxTokenCount; - - /** - * API name: {@code max_token_count} - */ - public final Builder maxTokenCount(@Nullable Integer value) { - this.maxTokenCount = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SettingsAnalyze}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SettingsAnalyze build() { - _checkSingleUse(); - - return new SettingsAnalyze(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SettingsAnalyze} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - SettingsAnalyze::setupSettingsAnalyzeDeserializer); - - protected static void setupSettingsAnalyzeDeserializer(ObjectDeserializer op) { - - op.add(Builder::maxTokenCount, JsonpDeserializer.integerDeserializer(), "max_token_count"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsHighlight.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsHighlight.java deleted file mode 100644 index 5148f36e6..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsHighlight.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.SettingsHighlight - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SettingsHighlight implements JsonpSerializable { - @Nullable - private final Integer maxAnalyzedOffset; - - // --------------------------------------------------------------------------------------------- - - private SettingsHighlight(Builder builder) { - - this.maxAnalyzedOffset = builder.maxAnalyzedOffset; - - } - - public static SettingsHighlight of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code max_analyzed_offset} - */ - @Nullable - public final Integer maxAnalyzedOffset() { - return this.maxAnalyzedOffset; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.maxAnalyzedOffset != null) { - generator.writeKey("max_analyzed_offset"); - generator.write(this.maxAnalyzedOffset); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SettingsHighlight}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private Integer maxAnalyzedOffset; - - /** - * API name: {@code max_analyzed_offset} - */ - public final Builder maxAnalyzedOffset(@Nullable Integer value) { - this.maxAnalyzedOffset = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SettingsHighlight}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SettingsHighlight build() { - _checkSingleUse(); - - return new SettingsHighlight(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SettingsHighlight} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, SettingsHighlight::setupSettingsHighlightDeserializer); - - protected static void setupSettingsHighlightDeserializer(ObjectDeserializer op) { - - op.add(Builder::maxAnalyzedOffset, JsonpDeserializer.integerDeserializer(), "max_analyzed_offset"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsQueryString.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsQueryString.java deleted file mode 100644 index 4251c53c9..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsQueryString.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.SettingsQueryString - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SettingsQueryString implements JsonpSerializable { - private final boolean lenient; - - // --------------------------------------------------------------------------------------------- - - private SettingsQueryString(Builder builder) { - - this.lenient = ApiTypeHelper.requireNonNull(builder.lenient, this, "lenient"); - - } - - public static SettingsQueryString of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code lenient} - */ - public final boolean lenient() { - return this.lenient; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("lenient"); - generator.write(this.lenient); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SettingsQueryString}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private Boolean lenient; - - /** - * Required - API name: {@code lenient} - */ - public final Builder lenient(boolean value) { - this.lenient = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SettingsQueryString}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SettingsQueryString build() { - _checkSingleUse(); - - return new SettingsQueryString(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SettingsQueryString} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, SettingsQueryString::setupSettingsQueryStringDeserializer); - - protected static void setupSettingsQueryStringDeserializer(ObjectDeserializer op) { - - op.add(Builder::lenient, JsonpDeserializer.booleanDeserializer(), "lenient"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSearch.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSearch.java deleted file mode 100644 index 94ab24661..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSearch.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.SettingsSearch - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SettingsSearch implements JsonpSerializable { - @Nullable - private final SearchIdle idle; - - @Nullable - private final SlowlogSettings slowlog; - - // --------------------------------------------------------------------------------------------- - - private SettingsSearch(Builder builder) { - - this.idle = builder.idle; - this.slowlog = builder.slowlog; - - } - - public static SettingsSearch of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code idle} - */ - @Nullable - public final SearchIdle idle() { - return this.idle; - } - - /** - * API name: {@code slowlog} - */ - @Nullable - public final SlowlogSettings slowlog() { - return this.slowlog; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.idle != null) { - generator.writeKey("idle"); - this.idle.serialize(generator, mapper); - - } - if (this.slowlog != null) { - generator.writeKey("slowlog"); - this.slowlog.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SettingsSearch}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private SearchIdle idle; - - @Nullable - private SlowlogSettings slowlog; - - /** - * API name: {@code idle} - */ - public final Builder idle(@Nullable SearchIdle value) { - this.idle = value; - return this; - } - - /** - * API name: {@code idle} - */ - public final Builder idle(Function> fn) { - return this.idle(fn.apply(new SearchIdle.Builder()).build()); - } - - /** - * API name: {@code slowlog} - */ - public final Builder slowlog(@Nullable SlowlogSettings value) { - this.slowlog = value; - return this; - } - - /** - * API name: {@code slowlog} - */ - public final Builder slowlog(Function> fn) { - return this.slowlog(fn.apply(new SlowlogSettings.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SettingsSearch}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SettingsSearch build() { - _checkSingleUse(); - - return new SettingsSearch(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SettingsSearch} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - SettingsSearch::setupSettingsSearchDeserializer); - - protected static void setupSettingsSearchDeserializer(ObjectDeserializer op) { - - op.add(Builder::idle, SearchIdle._DESERIALIZER, "idle"); - op.add(Builder::slowlog, SlowlogSettings._DESERIALIZER, "slowlog"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarity.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarity.java deleted file mode 100644 index 60d6d0d0f..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarity.java +++ /dev/null @@ -1,410 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.TaggedUnion; -import co.elastic.clients.util.TaggedUnionUtils; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.SettingsSimilarity - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SettingsSimilarity - implements - TaggedUnion, - JsonpSerializable { - - /** - * {@link SettingsSimilarity} variant kinds. - * - * @see API - * specification - */ - - public enum Kind implements JsonEnum { - Bm25("BM25"), - - Boolean("boolean"), - - Dfi("DFI"), - - Dfr("DFR"), - - Ib("IB"), - - LMDirichlet("LMDirichlet"), - - LMJelinekMercer("LMJelinekMercer"), - - Scripted("scripted"), - - ; - - private final String jsonValue; - - Kind(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - } - - private final Kind _kind; - private final SettingsSimilarityVariant _value; - - @Override - public final Kind _kind() { - return _kind; - } - - @Override - public final SettingsSimilarityVariant _get() { - return _value; - } - - public SettingsSimilarity(SettingsSimilarityVariant value) { - - this._kind = ApiTypeHelper.requireNonNull(value._settingsSimilarityKind(), this, ""); - this._value = ApiTypeHelper.requireNonNull(value, this, ""); - - } - - private SettingsSimilarity(Builder builder) { - - this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); - this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); - - } - - public static SettingsSimilarity of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Is this variant instance of kind {@code BM25}? - */ - public boolean isBm25() { - return _kind == Kind.Bm25; - } - - /** - * Get the {@code BM25} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code BM25} kind. - */ - public SettingsSimilarityBm25 bm25() { - return TaggedUnionUtils.get(this, Kind.Bm25); - } - - /** - * Is this variant instance of kind {@code boolean}? - */ - public boolean isBoolean() { - return _kind == Kind.Boolean; - } - - /** - * Get the {@code boolean} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code boolean} kind. - */ - public SettingsSimilarityBoolean boolean_() { - return TaggedUnionUtils.get(this, Kind.Boolean); - } - - /** - * Is this variant instance of kind {@code DFI}? - */ - public boolean isDfi() { - return _kind == Kind.Dfi; - } - - /** - * Get the {@code DFI} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code DFI} kind. - */ - public SettingsSimilarityDfi dfi() { - return TaggedUnionUtils.get(this, Kind.Dfi); - } - - /** - * Is this variant instance of kind {@code DFR}? - */ - public boolean isDfr() { - return _kind == Kind.Dfr; - } - - /** - * Get the {@code DFR} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code DFR} kind. - */ - public SettingsSimilarityDfr dfr() { - return TaggedUnionUtils.get(this, Kind.Dfr); - } - - /** - * Is this variant instance of kind {@code IB}? - */ - public boolean isIb() { - return _kind == Kind.Ib; - } - - /** - * Get the {@code IB} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code IB} kind. - */ - public SettingsSimilarityIb ib() { - return TaggedUnionUtils.get(this, Kind.Ib); - } - - /** - * Is this variant instance of kind {@code LMDirichlet}? - */ - public boolean isLMDirichlet() { - return _kind == Kind.LMDirichlet; - } - - /** - * Get the {@code LMDirichlet} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code LMDirichlet} kind. - */ - public SettingsSimilarityLmd lmdirichlet() { - return TaggedUnionUtils.get(this, Kind.LMDirichlet); - } - - /** - * Is this variant instance of kind {@code LMJelinekMercer}? - */ - public boolean isLMJelinekMercer() { - return _kind == Kind.LMJelinekMercer; - } - - /** - * Get the {@code LMJelinekMercer} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code LMJelinekMercer} - * kind. - */ - public SettingsSimilarityLmj lmjelinekmercer() { - return TaggedUnionUtils.get(this, Kind.LMJelinekMercer); - } - - /** - * Is this variant instance of kind {@code scripted}? - */ - public boolean isScripted() { - return _kind == Kind.Scripted; - } - - /** - * Get the {@code scripted} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code scripted} kind. - */ - public SettingsSimilarityScripted scripted() { - return TaggedUnionUtils.get(this, Kind.Scripted); - } - - @Override - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - - mapper.serialize(_value, generator); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private Kind _kind; - private SettingsSimilarityVariant _value; - - @Override - protected Builder self() { - return this; - } - public ObjectBuilder bm25(SettingsSimilarityBm25 v) { - this._kind = Kind.Bm25; - this._value = v; - return this; - } - - public ObjectBuilder bm25( - Function> fn) { - return this.bm25(fn.apply(new SettingsSimilarityBm25.Builder()).build()); - } - - public ObjectBuilder boolean_(SettingsSimilarityBoolean v) { - this._kind = Kind.Boolean; - this._value = v; - return this; - } - - public ObjectBuilder boolean_( - Function> fn) { - return this.boolean_(fn.apply(new SettingsSimilarityBoolean.Builder()).build()); - } - - public ObjectBuilder dfi(SettingsSimilarityDfi v) { - this._kind = Kind.Dfi; - this._value = v; - return this; - } - - public ObjectBuilder dfi( - Function> fn) { - return this.dfi(fn.apply(new SettingsSimilarityDfi.Builder()).build()); - } - - public ObjectBuilder dfr(SettingsSimilarityDfr v) { - this._kind = Kind.Dfr; - this._value = v; - return this; - } - - public ObjectBuilder dfr( - Function> fn) { - return this.dfr(fn.apply(new SettingsSimilarityDfr.Builder()).build()); - } - - public ObjectBuilder ib(SettingsSimilarityIb v) { - this._kind = Kind.Ib; - this._value = v; - return this; - } - - public ObjectBuilder ib( - Function> fn) { - return this.ib(fn.apply(new SettingsSimilarityIb.Builder()).build()); - } - - public ObjectBuilder lmdirichlet(SettingsSimilarityLmd v) { - this._kind = Kind.LMDirichlet; - this._value = v; - return this; - } - - public ObjectBuilder lmdirichlet( - Function> fn) { - return this.lmdirichlet(fn.apply(new SettingsSimilarityLmd.Builder()).build()); - } - - public ObjectBuilder lmjelinekmercer(SettingsSimilarityLmj v) { - this._kind = Kind.LMJelinekMercer; - this._value = v; - return this; - } - - public ObjectBuilder lmjelinekmercer( - Function> fn) { - return this.lmjelinekmercer(fn.apply(new SettingsSimilarityLmj.Builder()).build()); - } - - public ObjectBuilder scripted(SettingsSimilarityScripted v) { - this._kind = Kind.Scripted; - this._value = v; - return this; - } - - public ObjectBuilder scripted( - Function> fn) { - return this.scripted(fn.apply(new SettingsSimilarityScripted.Builder()).build()); - } - - public SettingsSimilarity build() { - _checkSingleUse(); - return new SettingsSimilarity(this); - } - - } - - protected static void setupSettingsSimilarityDeserializer(ObjectDeserializer op) { - - op.add(Builder::bm25, SettingsSimilarityBm25._DESERIALIZER, "BM25"); - op.add(Builder::boolean_, SettingsSimilarityBoolean._DESERIALIZER, "boolean"); - op.add(Builder::dfi, SettingsSimilarityDfi._DESERIALIZER, "DFI"); - op.add(Builder::dfr, SettingsSimilarityDfr._DESERIALIZER, "DFR"); - op.add(Builder::ib, SettingsSimilarityIb._DESERIALIZER, "IB"); - op.add(Builder::lmdirichlet, SettingsSimilarityLmd._DESERIALIZER, "LMDirichlet"); - op.add(Builder::lmjelinekmercer, SettingsSimilarityLmj._DESERIALIZER, "LMJelinekMercer"); - op.add(Builder::scripted, SettingsSimilarityScripted._DESERIALIZER, "scripted"); - - op.setTypeProperty("type", null); - - } - - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, SettingsSimilarity::setupSettingsSimilarityDeserializer, Builder::build); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBm25.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBm25.java deleted file mode 100644 index 82ff73383..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBm25.java +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Double; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.SettingsSimilarityBm25 - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SettingsSimilarityBm25 implements SettingsSimilarityVariant, JsonpSerializable { - @Nullable - private final Double b; - - @Nullable - private final Boolean discountOverlaps; - - @Nullable - private final Double k1; - - // --------------------------------------------------------------------------------------------- - - private SettingsSimilarityBm25(Builder builder) { - - this.b = builder.b; - this.discountOverlaps = builder.discountOverlaps; - this.k1 = builder.k1; - - } - - public static SettingsSimilarityBm25 of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * SettingsSimilarity variant kind. - */ - @Override - public SettingsSimilarity.Kind _settingsSimilarityKind() { - return SettingsSimilarity.Kind.Bm25; - } - - /** - * API name: {@code b} - */ - @Nullable - public final Double b() { - return this.b; - } - - /** - * API name: {@code discount_overlaps} - */ - @Nullable - public final Boolean discountOverlaps() { - return this.discountOverlaps; - } - - /** - * API name: {@code k1} - */ - @Nullable - public final Double k1() { - return this.k1; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "BM25"); - - if (this.b != null) { - generator.writeKey("b"); - generator.write(this.b); - - } - if (this.discountOverlaps != null) { - generator.writeKey("discount_overlaps"); - generator.write(this.discountOverlaps); - - } - if (this.k1 != null) { - generator.writeKey("k1"); - generator.write(this.k1); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SettingsSimilarityBm25}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Double b; - - @Nullable - private Boolean discountOverlaps; - - @Nullable - private Double k1; - - /** - * API name: {@code b} - */ - public final Builder b(@Nullable Double value) { - this.b = value; - return this; - } - - /** - * API name: {@code discount_overlaps} - */ - public final Builder discountOverlaps(@Nullable Boolean value) { - this.discountOverlaps = value; - return this; - } - - /** - * API name: {@code k1} - */ - public final Builder k1(@Nullable Double value) { - this.k1 = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SettingsSimilarityBm25}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SettingsSimilarityBm25 build() { - _checkSingleUse(); - - return new SettingsSimilarityBm25(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SettingsSimilarityBm25} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, SettingsSimilarityBm25::setupSettingsSimilarityBm25Deserializer); - - protected static void setupSettingsSimilarityBm25Deserializer( - ObjectDeserializer op) { - - op.add(Builder::b, JsonpDeserializer.doubleDeserializer(), "b"); - op.add(Builder::discountOverlaps, JsonpDeserializer.booleanDeserializer(), "discount_overlaps"); - op.add(Builder::k1, JsonpDeserializer.doubleDeserializer(), "k1"); - - op.ignore("type"); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBoolean.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBoolean.java deleted file mode 100644 index e3016b8f1..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBoolean.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.SettingsSimilarityBoolean - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SettingsSimilarityBoolean implements SettingsSimilarityVariant, JsonpSerializable { - // --------------------------------------------------------------------------------------------- - - private SettingsSimilarityBoolean(Builder builder) { - - } - - public static SettingsSimilarityBoolean of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * SettingsSimilarity variant kind. - */ - @Override - public SettingsSimilarity.Kind _settingsSimilarityKind() { - return SettingsSimilarity.Kind.Boolean; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "boolean"); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SettingsSimilarityBoolean}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SettingsSimilarityBoolean}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SettingsSimilarityBoolean build() { - _checkSingleUse(); - - return new SettingsSimilarityBoolean(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SettingsSimilarityBoolean} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, SettingsSimilarityBoolean::setupSettingsSimilarityBooleanDeserializer); - - protected static void setupSettingsSimilarityBooleanDeserializer( - ObjectDeserializer op) { - - op.ignore("type"); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBuilders.java deleted file mode 100644 index 454f72af1..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBuilders.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.util.ObjectBuilder; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Builders for {@link SettingsSimilarity} variants. - */ -public class SettingsSimilarityBuilders { - private SettingsSimilarityBuilders() { - } - - /** - * Creates a builder for the {@link SettingsSimilarityBm25 BM25} - * {@code SettingsSimilarity} variant. - */ - public static SettingsSimilarityBm25.Builder bm25() { - return new SettingsSimilarityBm25.Builder(); - } - - /** - * Creates a SettingsSimilarity of the {@link SettingsSimilarityBm25 BM25} - * {@code SettingsSimilarity} variant. - */ - public static SettingsSimilarity bm25( - Function> fn) { - SettingsSimilarity.Builder builder = new SettingsSimilarity.Builder(); - builder.bm25(fn.apply(new SettingsSimilarityBm25.Builder()).build()); - return builder.build(); - } - - /** - * Creates a builder for the {@link SettingsSimilarityBoolean boolean} - * {@code SettingsSimilarity} variant. - */ - public static SettingsSimilarityBoolean.Builder boolean_() { - return new SettingsSimilarityBoolean.Builder(); - } - - /** - * Creates a SettingsSimilarity of the {@link SettingsSimilarityBoolean boolean} - * {@code SettingsSimilarity} variant. - */ - public static SettingsSimilarity boolean_( - Function> fn) { - SettingsSimilarity.Builder builder = new SettingsSimilarity.Builder(); - builder.boolean_(fn.apply(new SettingsSimilarityBoolean.Builder()).build()); - return builder.build(); - } - - /** - * Creates a builder for the {@link SettingsSimilarityDfi DFI} - * {@code SettingsSimilarity} variant. - */ - public static SettingsSimilarityDfi.Builder dfi() { - return new SettingsSimilarityDfi.Builder(); - } - - /** - * Creates a SettingsSimilarity of the {@link SettingsSimilarityDfi DFI} - * {@code SettingsSimilarity} variant. - */ - public static SettingsSimilarity dfi( - Function> fn) { - SettingsSimilarity.Builder builder = new SettingsSimilarity.Builder(); - builder.dfi(fn.apply(new SettingsSimilarityDfi.Builder()).build()); - return builder.build(); - } - - /** - * Creates a builder for the {@link SettingsSimilarityDfr DFR} - * {@code SettingsSimilarity} variant. - */ - public static SettingsSimilarityDfr.Builder dfr() { - return new SettingsSimilarityDfr.Builder(); - } - - /** - * Creates a SettingsSimilarity of the {@link SettingsSimilarityDfr DFR} - * {@code SettingsSimilarity} variant. - */ - public static SettingsSimilarity dfr( - Function> fn) { - SettingsSimilarity.Builder builder = new SettingsSimilarity.Builder(); - builder.dfr(fn.apply(new SettingsSimilarityDfr.Builder()).build()); - return builder.build(); - } - - /** - * Creates a builder for the {@link SettingsSimilarityIb IB} - * {@code SettingsSimilarity} variant. - */ - public static SettingsSimilarityIb.Builder ib() { - return new SettingsSimilarityIb.Builder(); - } - - /** - * Creates a SettingsSimilarity of the {@link SettingsSimilarityIb IB} - * {@code SettingsSimilarity} variant. - */ - public static SettingsSimilarity ib( - Function> fn) { - SettingsSimilarity.Builder builder = new SettingsSimilarity.Builder(); - builder.ib(fn.apply(new SettingsSimilarityIb.Builder()).build()); - return builder.build(); - } - - /** - * Creates a builder for the {@link SettingsSimilarityLmd LMDirichlet} - * {@code SettingsSimilarity} variant. - */ - public static SettingsSimilarityLmd.Builder lmdirichlet() { - return new SettingsSimilarityLmd.Builder(); - } - - /** - * Creates a SettingsSimilarity of the {@link SettingsSimilarityLmd LMDirichlet} - * {@code SettingsSimilarity} variant. - */ - public static SettingsSimilarity lmdirichlet( - Function> fn) { - SettingsSimilarity.Builder builder = new SettingsSimilarity.Builder(); - builder.lmdirichlet(fn.apply(new SettingsSimilarityLmd.Builder()).build()); - return builder.build(); - } - - /** - * Creates a builder for the {@link SettingsSimilarityLmj LMJelinekMercer} - * {@code SettingsSimilarity} variant. - */ - public static SettingsSimilarityLmj.Builder lmjelinekmercer() { - return new SettingsSimilarityLmj.Builder(); - } - - /** - * Creates a SettingsSimilarity of the {@link SettingsSimilarityLmj - * LMJelinekMercer} {@code SettingsSimilarity} variant. - */ - public static SettingsSimilarity lmjelinekmercer( - Function> fn) { - SettingsSimilarity.Builder builder = new SettingsSimilarity.Builder(); - builder.lmjelinekmercer(fn.apply(new SettingsSimilarityLmj.Builder()).build()); - return builder.build(); - } - - /** - * Creates a builder for the {@link SettingsSimilarityScripted scripted} - * {@code SettingsSimilarity} variant. - */ - public static SettingsSimilarityScripted.Builder scripted() { - return new SettingsSimilarityScripted.Builder(); - } - - /** - * Creates a SettingsSimilarity of the {@link SettingsSimilarityScripted - * scripted} {@code SettingsSimilarity} variant. - */ - public static SettingsSimilarity scripted( - Function> fn) { - SettingsSimilarity.Builder builder = new SettingsSimilarity.Builder(); - builder.scripted(fn.apply(new SettingsSimilarityScripted.Builder()).build()); - return builder.build(); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfi.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfi.java deleted file mode 100644 index 596a78bd3..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfi.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.DFIIndependenceMeasure; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.SettingsSimilarityDfi - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SettingsSimilarityDfi implements SettingsSimilarityVariant, JsonpSerializable { - private final DFIIndependenceMeasure independenceMeasure; - - // --------------------------------------------------------------------------------------------- - - private SettingsSimilarityDfi(Builder builder) { - - this.independenceMeasure = ApiTypeHelper.requireNonNull(builder.independenceMeasure, this, - "independenceMeasure"); - - } - - public static SettingsSimilarityDfi of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * SettingsSimilarity variant kind. - */ - @Override - public SettingsSimilarity.Kind _settingsSimilarityKind() { - return SettingsSimilarity.Kind.Dfi; - } - - /** - * Required - API name: {@code independence_measure} - */ - public final DFIIndependenceMeasure independenceMeasure() { - return this.independenceMeasure; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "DFI"); - - generator.writeKey("independence_measure"); - this.independenceMeasure.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SettingsSimilarityDfi}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private DFIIndependenceMeasure independenceMeasure; - - /** - * Required - API name: {@code independence_measure} - */ - public final Builder independenceMeasure(DFIIndependenceMeasure value) { - this.independenceMeasure = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SettingsSimilarityDfi}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SettingsSimilarityDfi build() { - _checkSingleUse(); - - return new SettingsSimilarityDfi(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SettingsSimilarityDfi} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, SettingsSimilarityDfi::setupSettingsSimilarityDfiDeserializer); - - protected static void setupSettingsSimilarityDfiDeserializer(ObjectDeserializer op) { - - op.add(Builder::independenceMeasure, DFIIndependenceMeasure._DESERIALIZER, "independence_measure"); - - op.ignore("type"); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfr.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfr.java deleted file mode 100644 index 9e022df97..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfr.java +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.DFRAfterEffect; -import co.elastic.clients.elasticsearch._types.DFRBasicModel; -import co.elastic.clients.elasticsearch._types.Normalization; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.SettingsSimilarityDfr - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SettingsSimilarityDfr implements SettingsSimilarityVariant, JsonpSerializable { - private final DFRAfterEffect afterEffect; - - private final DFRBasicModel basicModel; - - private final Normalization normalization; - - // --------------------------------------------------------------------------------------------- - - private SettingsSimilarityDfr(Builder builder) { - - this.afterEffect = ApiTypeHelper.requireNonNull(builder.afterEffect, this, "afterEffect"); - this.basicModel = ApiTypeHelper.requireNonNull(builder.basicModel, this, "basicModel"); - this.normalization = ApiTypeHelper.requireNonNull(builder.normalization, this, "normalization"); - - } - - public static SettingsSimilarityDfr of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * SettingsSimilarity variant kind. - */ - @Override - public SettingsSimilarity.Kind _settingsSimilarityKind() { - return SettingsSimilarity.Kind.Dfr; - } - - /** - * Required - API name: {@code after_effect} - */ - public final DFRAfterEffect afterEffect() { - return this.afterEffect; - } - - /** - * Required - API name: {@code basic_model} - */ - public final DFRBasicModel basicModel() { - return this.basicModel; - } - - /** - * Required - API name: {@code normalization} - */ - public final Normalization normalization() { - return this.normalization; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "DFR"); - - generator.writeKey("after_effect"); - this.afterEffect.serialize(generator, mapper); - generator.writeKey("basic_model"); - this.basicModel.serialize(generator, mapper); - generator.writeKey("normalization"); - this.normalization.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SettingsSimilarityDfr}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private DFRAfterEffect afterEffect; - - private DFRBasicModel basicModel; - - private Normalization normalization; - - /** - * Required - API name: {@code after_effect} - */ - public final Builder afterEffect(DFRAfterEffect value) { - this.afterEffect = value; - return this; - } - - /** - * Required - API name: {@code basic_model} - */ - public final Builder basicModel(DFRBasicModel value) { - this.basicModel = value; - return this; - } - - /** - * Required - API name: {@code normalization} - */ - public final Builder normalization(Normalization value) { - this.normalization = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SettingsSimilarityDfr}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SettingsSimilarityDfr build() { - _checkSingleUse(); - - return new SettingsSimilarityDfr(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SettingsSimilarityDfr} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, SettingsSimilarityDfr::setupSettingsSimilarityDfrDeserializer); - - protected static void setupSettingsSimilarityDfrDeserializer(ObjectDeserializer op) { - - op.add(Builder::afterEffect, DFRAfterEffect._DESERIALIZER, "after_effect"); - op.add(Builder::basicModel, DFRBasicModel._DESERIALIZER, "basic_model"); - op.add(Builder::normalization, Normalization._DESERIALIZER, "normalization"); - - op.ignore("type"); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityIb.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityIb.java deleted file mode 100644 index ad8bf0ba1..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityIb.java +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.IBDistribution; -import co.elastic.clients.elasticsearch._types.IBLambda; -import co.elastic.clients.elasticsearch._types.Normalization; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.SettingsSimilarityIb - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SettingsSimilarityIb implements SettingsSimilarityVariant, JsonpSerializable { - private final IBDistribution distribution; - - private final IBLambda lambda; - - private final Normalization normalization; - - // --------------------------------------------------------------------------------------------- - - private SettingsSimilarityIb(Builder builder) { - - this.distribution = ApiTypeHelper.requireNonNull(builder.distribution, this, "distribution"); - this.lambda = ApiTypeHelper.requireNonNull(builder.lambda, this, "lambda"); - this.normalization = ApiTypeHelper.requireNonNull(builder.normalization, this, "normalization"); - - } - - public static SettingsSimilarityIb of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * SettingsSimilarity variant kind. - */ - @Override - public SettingsSimilarity.Kind _settingsSimilarityKind() { - return SettingsSimilarity.Kind.Ib; - } - - /** - * Required - API name: {@code distribution} - */ - public final IBDistribution distribution() { - return this.distribution; - } - - /** - * Required - API name: {@code lambda} - */ - public final IBLambda lambda() { - return this.lambda; - } - - /** - * Required - API name: {@code normalization} - */ - public final Normalization normalization() { - return this.normalization; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "IB"); - - generator.writeKey("distribution"); - this.distribution.serialize(generator, mapper); - generator.writeKey("lambda"); - this.lambda.serialize(generator, mapper); - generator.writeKey("normalization"); - this.normalization.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SettingsSimilarityIb}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private IBDistribution distribution; - - private IBLambda lambda; - - private Normalization normalization; - - /** - * Required - API name: {@code distribution} - */ - public final Builder distribution(IBDistribution value) { - this.distribution = value; - return this; - } - - /** - * Required - API name: {@code lambda} - */ - public final Builder lambda(IBLambda value) { - this.lambda = value; - return this; - } - - /** - * Required - API name: {@code normalization} - */ - public final Builder normalization(Normalization value) { - this.normalization = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SettingsSimilarityIb}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SettingsSimilarityIb build() { - _checkSingleUse(); - - return new SettingsSimilarityIb(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SettingsSimilarityIb} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, SettingsSimilarityIb::setupSettingsSimilarityIbDeserializer); - - protected static void setupSettingsSimilarityIbDeserializer(ObjectDeserializer op) { - - op.add(Builder::distribution, IBDistribution._DESERIALIZER, "distribution"); - op.add(Builder::lambda, IBLambda._DESERIALIZER, "lambda"); - op.add(Builder::normalization, Normalization._DESERIALIZER, "normalization"); - - op.ignore("type"); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityLmd.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityLmd.java deleted file mode 100644 index 298c45d95..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityLmd.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Double; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.SettingsSimilarityLmd - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SettingsSimilarityLmd implements SettingsSimilarityVariant, JsonpSerializable { - @Nullable - private final Double mu; - - // --------------------------------------------------------------------------------------------- - - private SettingsSimilarityLmd(Builder builder) { - - this.mu = builder.mu; - - } - - public static SettingsSimilarityLmd of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * SettingsSimilarity variant kind. - */ - @Override - public SettingsSimilarity.Kind _settingsSimilarityKind() { - return SettingsSimilarity.Kind.LMDirichlet; - } - - /** - * API name: {@code mu} - */ - @Nullable - public final Double mu() { - return this.mu; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "LMDirichlet"); - - if (this.mu != null) { - generator.writeKey("mu"); - generator.write(this.mu); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SettingsSimilarityLmd}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Double mu; - - /** - * API name: {@code mu} - */ - public final Builder mu(@Nullable Double value) { - this.mu = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SettingsSimilarityLmd}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SettingsSimilarityLmd build() { - _checkSingleUse(); - - return new SettingsSimilarityLmd(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SettingsSimilarityLmd} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, SettingsSimilarityLmd::setupSettingsSimilarityLmdDeserializer); - - protected static void setupSettingsSimilarityLmdDeserializer(ObjectDeserializer op) { - - op.add(Builder::mu, JsonpDeserializer.doubleDeserializer(), "mu"); - - op.ignore("type"); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityLmj.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityLmj.java deleted file mode 100644 index 5c8998fd8..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityLmj.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Double; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.SettingsSimilarityLmj - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SettingsSimilarityLmj implements SettingsSimilarityVariant, JsonpSerializable { - @Nullable - private final Double lambda; - - // --------------------------------------------------------------------------------------------- - - private SettingsSimilarityLmj(Builder builder) { - - this.lambda = builder.lambda; - - } - - public static SettingsSimilarityLmj of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * SettingsSimilarity variant kind. - */ - @Override - public SettingsSimilarity.Kind _settingsSimilarityKind() { - return SettingsSimilarity.Kind.LMJelinekMercer; - } - - /** - * API name: {@code lambda} - */ - @Nullable - public final Double lambda() { - return this.lambda; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "LMJelinekMercer"); - - if (this.lambda != null) { - generator.writeKey("lambda"); - generator.write(this.lambda); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SettingsSimilarityLmj}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Double lambda; - - /** - * API name: {@code lambda} - */ - public final Builder lambda(@Nullable Double value) { - this.lambda = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SettingsSimilarityLmj}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SettingsSimilarityLmj build() { - _checkSingleUse(); - - return new SettingsSimilarityLmj(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SettingsSimilarityLmj} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, SettingsSimilarityLmj::setupSettingsSimilarityLmjDeserializer); - - protected static void setupSettingsSimilarityLmjDeserializer(ObjectDeserializer op) { - - op.add(Builder::lambda, JsonpDeserializer.doubleDeserializer(), "lambda"); - - op.ignore("type"); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityScripted.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityScripted.java deleted file mode 100644 index daa33e276..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityScripted.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.Script; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.SettingsSimilarityScripted - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SettingsSimilarityScripted implements SettingsSimilarityVariant, JsonpSerializable { - private final Script script; - - @Nullable - private final Script weightScript; - - // --------------------------------------------------------------------------------------------- - - private SettingsSimilarityScripted(Builder builder) { - - this.script = ApiTypeHelper.requireNonNull(builder.script, this, "script"); - this.weightScript = builder.weightScript; - - } - - public static SettingsSimilarityScripted of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * SettingsSimilarity variant kind. - */ - @Override - public SettingsSimilarity.Kind _settingsSimilarityKind() { - return SettingsSimilarity.Kind.Scripted; - } - - /** - * Required - API name: {@code script} - */ - public final Script script() { - return this.script; - } - - /** - * API name: {@code weight_script} - */ - @Nullable - public final Script weightScript() { - return this.weightScript; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "scripted"); - - generator.writeKey("script"); - this.script.serialize(generator, mapper); - - if (this.weightScript != null) { - generator.writeKey("weight_script"); - this.weightScript.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SettingsSimilarityScripted}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private Script script; - - @Nullable - private Script weightScript; - - /** - * Required - API name: {@code script} - */ - public final Builder script(Script value) { - this.script = value; - return this; - } - - /** - * Required - API name: {@code script} - */ - public final Builder script(Function> fn) { - return this.script(fn.apply(new Script.Builder()).build()); - } - - /** - * API name: {@code weight_script} - */ - public final Builder weightScript(@Nullable Script value) { - this.weightScript = value; - return this; - } - - /** - * API name: {@code weight_script} - */ - public final Builder weightScript(Function> fn) { - return this.weightScript(fn.apply(new Script.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SettingsSimilarityScripted}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SettingsSimilarityScripted build() { - _checkSingleUse(); - - return new SettingsSimilarityScripted(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SettingsSimilarityScripted} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, SettingsSimilarityScripted::setupSettingsSimilarityScriptedDeserializer); - - protected static void setupSettingsSimilarityScriptedDeserializer( - ObjectDeserializer op) { - - op.add(Builder::script, Script._DESERIALIZER, "script"); - op.add(Builder::weightScript, Script._DESERIALIZER, "weight_script"); - - op.ignore("type"); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityVariant.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityVariant.java deleted file mode 100644 index b77e52300..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityVariant.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpSerializable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Base interface for {@link SettingsSimilarity} variants. - */ -public interface SettingsSimilarityVariant extends JsonpSerializable { - - SettingsSimilarity.Kind _settingsSimilarityKind(); - - default SettingsSimilarity _toSettingsSimilarity() { - return new SettingsSimilarity(this); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateRequest.java deleted file mode 100644 index 289107ed5..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateRequest.java +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.simulate_index_template.Request - -/** - * Simulate an index. Returns the index configuration that would be applied to - * the specified index from an existing index template. - * - * @see API - * specification - */ - -public class SimulateIndexTemplateRequest extends RequestBase { - @Nullable - private final Boolean includeDefaults; - - @Nullable - private final Time masterTimeout; - - private final String name; - - // --------------------------------------------------------------------------------------------- - - private SimulateIndexTemplateRequest(Builder builder) { - - this.includeDefaults = builder.includeDefaults; - this.masterTimeout = builder.masterTimeout; - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - - } - - public static SimulateIndexTemplateRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If true, returns all relevant default configurations for the index template. - *

- * API name: {@code include_defaults} - */ - @Nullable - public final Boolean includeDefaults() { - return this.includeDefaults; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Required - Name of the index to simulate - *

- * API name: {@code name} - */ - public final String name() { - return this.name; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SimulateIndexTemplateRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Boolean includeDefaults; - - @Nullable - private Time masterTimeout; - - private String name; - - /** - * If true, returns all relevant default configurations for the index template. - *

- * API name: {@code include_defaults} - */ - public final Builder includeDefaults(@Nullable Boolean value) { - this.includeDefaults = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - Name of the index to simulate - *

- * API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SimulateIndexTemplateRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SimulateIndexTemplateRequest build() { - _checkSingleUse(); - - return new SimulateIndexTemplateRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.simulate_index_template}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.simulate_index_template", - - // Request method - request -> { - return "POST"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_index_template"); - buf.append("/_simulate_index"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - params.put("name", request.name); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.includeDefaults != null) { - params.put("include_defaults", String.valueOf(request.includeDefaults)); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, SimulateIndexTemplateResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateResponse.java deleted file mode 100644 index b53fc70d9..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateResponse.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch.indices.simulate_template.Overlapping; -import co.elastic.clients.elasticsearch.indices.simulate_template.Template; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.simulate_index_template.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SimulateIndexTemplateResponse implements JsonpSerializable { - private final List overlapping; - - private final Template template; - - // --------------------------------------------------------------------------------------------- - - private SimulateIndexTemplateResponse(Builder builder) { - - this.overlapping = ApiTypeHelper.unmodifiable(builder.overlapping); - this.template = ApiTypeHelper.requireNonNull(builder.template, this, "template"); - - } - - public static SimulateIndexTemplateResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code overlapping} - */ - public final List overlapping() { - return this.overlapping; - } - - /** - * Required - API name: {@code template} - */ - public final Template template() { - return this.template; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.overlapping)) { - generator.writeKey("overlapping"); - generator.writeStartArray(); - for (Overlapping item0 : this.overlapping) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - generator.writeKey("template"); - this.template.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SimulateIndexTemplateResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private List overlapping; - - private Template template; - - /** - * API name: {@code overlapping} - *

- * Adds all elements of list to overlapping. - */ - public final Builder overlapping(List list) { - this.overlapping = _listAddAll(this.overlapping, list); - return this; - } - - /** - * API name: {@code overlapping} - *

- * Adds one or more values to overlapping. - */ - public final Builder overlapping(Overlapping value, Overlapping... values) { - this.overlapping = _listAdd(this.overlapping, value, values); - return this; - } - - /** - * API name: {@code overlapping} - *

- * Adds a value to overlapping using a builder lambda. - */ - public final Builder overlapping(Function> fn) { - return overlapping(fn.apply(new Overlapping.Builder()).build()); - } - - /** - * Required - API name: {@code template} - */ - public final Builder template(Template value) { - this.template = value; - return this; - } - - /** - * Required - API name: {@code template} - */ - public final Builder template(Function> fn) { - return this.template(fn.apply(new Template.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SimulateIndexTemplateResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SimulateIndexTemplateResponse build() { - _checkSingleUse(); - - return new SimulateIndexTemplateResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SimulateIndexTemplateResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, SimulateIndexTemplateResponse::setupSimulateIndexTemplateResponseDeserializer); - - protected static void setupSimulateIndexTemplateResponseDeserializer( - ObjectDeserializer op) { - - op.add(Builder::overlapping, JsonpDeserializer.arrayDeserializer(Overlapping._DESERIALIZER), "overlapping"); - op.add(Builder::template, Template._DESERIALIZER, "template"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateTemplateRequest.java deleted file mode 100644 index 8f253a4c8..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateTemplateRequest.java +++ /dev/null @@ -1,816 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.elasticsearch.indices.put_index_template.IndexTemplateMapping; -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Long; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.simulate_template.Request - -/** - * Simulate an index template. Returns the index configuration that would be - * applied by a particular index template. - * - * @see API - * specification - */ -@JsonpDeserializable -public class SimulateTemplateRequest extends RequestBase implements JsonpSerializable { - private final Map meta; - - @Nullable - private final Boolean allowAutoCreate; - - private final List composedOf; - - @Nullable - private final Boolean create; - - @Nullable - private final DataStreamVisibility dataStream; - - @Nullable - private final Boolean deprecated; - - private final List ignoreMissingComponentTemplates; - - @Nullable - private final Boolean includeDefaults; - - private final List indexPatterns; - - @Nullable - private final Time masterTimeout; - - @Nullable - private final String name; - - @Nullable - private final Long priority; - - @Nullable - private final IndexTemplateMapping template; - - @Nullable - private final Long version; - - // --------------------------------------------------------------------------------------------- - - private SimulateTemplateRequest(Builder builder) { - - this.meta = ApiTypeHelper.unmodifiable(builder.meta); - this.allowAutoCreate = builder.allowAutoCreate; - this.composedOf = ApiTypeHelper.unmodifiable(builder.composedOf); - this.create = builder.create; - this.dataStream = builder.dataStream; - this.deprecated = builder.deprecated; - this.ignoreMissingComponentTemplates = ApiTypeHelper.unmodifiable(builder.ignoreMissingComponentTemplates); - this.includeDefaults = builder.includeDefaults; - this.indexPatterns = ApiTypeHelper.unmodifiable(builder.indexPatterns); - this.masterTimeout = builder.masterTimeout; - this.name = builder.name; - this.priority = builder.priority; - this.template = builder.template; - this.version = builder.version; - - } - - public static SimulateTemplateRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Optional user metadata about the index template. May have any contents. This - * map is not automatically generated by Elasticsearch. - *

- * API name: {@code _meta} - */ - public final Map meta() { - return this.meta; - } - - /** - * This setting overrides the value of the action.auto_create_index - * cluster setting. If set to true in a template, then indices can - * be automatically created using that template even if auto-creation of indices - * is disabled via actions.auto_create_index. If set to - * false, then indices or data streams matching the template must - * always be explicitly created, and may never be automatically created. - *

- * API name: {@code allow_auto_create} - */ - @Nullable - public final Boolean allowAutoCreate() { - return this.allowAutoCreate; - } - - /** - * An ordered list of component template names. Component templates are merged - * in the order specified, meaning that the last component template specified - * has the highest precedence. - *

- * API name: {@code composed_of} - */ - public final List composedOf() { - return this.composedOf; - } - - /** - * If true, the template passed in the body is only used if no existing - * templates match the same index patterns. If false, the simulation uses the - * template with the highest priority. Note that the template is not permanently - * added or updated in either case; it is only used for the simulation. - *

- * API name: {@code create} - */ - @Nullable - public final Boolean create() { - return this.create; - } - - /** - * If this object is included, the template is used to create data streams and - * their backing indices. Supports an empty object. Data streams require a - * matching index template with a data_stream object. - *

- * API name: {@code data_stream} - */ - @Nullable - public final DataStreamVisibility dataStream() { - return this.dataStream; - } - - /** - * Marks this index template as deprecated. When creating or updating a - * non-deprecated index template that uses deprecated components, Elasticsearch - * will emit a deprecation warning. - *

- * API name: {@code deprecated} - */ - @Nullable - public final Boolean deprecated() { - return this.deprecated; - } - - /** - * The configuration option ignore_missing_component_templates can be used when - * an index template references a component template that might not exist - *

- * API name: {@code ignore_missing_component_templates} - */ - public final List ignoreMissingComponentTemplates() { - return this.ignoreMissingComponentTemplates; - } - - /** - * If true, returns all relevant default configurations for the index template. - *

- * API name: {@code include_defaults} - */ - @Nullable - public final Boolean includeDefaults() { - return this.includeDefaults; - } - - /** - * Array of wildcard (*) expressions used to match the names of - * data streams and indices during creation. - *

- * API name: {@code index_patterns} - */ - public final List indexPatterns() { - return this.indexPatterns; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Name of the index template to simulate. To test a template configuration - * before you add it to the cluster, omit this parameter and specify the - * template configuration in the request body. - *

- * API name: {@code name} - */ - @Nullable - public final String name() { - return this.name; - } - - /** - * Priority to determine index template precedence when a new data stream or - * index is created. The index template with the highest priority is chosen. If - * no priority is specified the template is treated as though it is of priority - * 0 (lowest priority). This number is not automatically generated by - * Elasticsearch. - *

- * API name: {@code priority} - */ - @Nullable - public final Long priority() { - return this.priority; - } - - /** - * Template to be applied. It may optionally include an aliases, - * mappings, or settings configuration. - *

- * API name: {@code template} - */ - @Nullable - public final IndexTemplateMapping template() { - return this.template; - } - - /** - * Version number used to manage index templates externally. This number is not - * automatically generated by Elasticsearch. - *

- * API name: {@code version} - */ - @Nullable - public final Long version() { - return this.version; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.meta)) { - generator.writeKey("_meta"); - generator.writeStartObject(); - for (Map.Entry item0 : this.meta.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.allowAutoCreate != null) { - generator.writeKey("allow_auto_create"); - generator.write(this.allowAutoCreate); - - } - if (ApiTypeHelper.isDefined(this.composedOf)) { - generator.writeKey("composed_of"); - generator.writeStartArray(); - for (String item0 : this.composedOf) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (this.dataStream != null) { - generator.writeKey("data_stream"); - this.dataStream.serialize(generator, mapper); - - } - if (this.deprecated != null) { - generator.writeKey("deprecated"); - generator.write(this.deprecated); - - } - if (ApiTypeHelper.isDefined(this.ignoreMissingComponentTemplates)) { - generator.writeKey("ignore_missing_component_templates"); - generator.writeStartArray(); - for (String item0 : this.ignoreMissingComponentTemplates) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.indexPatterns)) { - generator.writeKey("index_patterns"); - generator.writeStartArray(); - for (String item0 : this.indexPatterns) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (this.priority != null) { - generator.writeKey("priority"); - generator.write(this.priority); - - } - if (this.template != null) { - generator.writeKey("template"); - this.template.serialize(generator, mapper); - - } - if (this.version != null) { - generator.writeKey("version"); - generator.write(this.version); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SimulateTemplateRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Map meta; - - @Nullable - private Boolean allowAutoCreate; - - @Nullable - private List composedOf; - - @Nullable - private Boolean create; - - @Nullable - private DataStreamVisibility dataStream; - - @Nullable - private Boolean deprecated; - - @Nullable - private List ignoreMissingComponentTemplates; - - @Nullable - private Boolean includeDefaults; - - @Nullable - private List indexPatterns; - - @Nullable - private Time masterTimeout; - - @Nullable - private String name; - - @Nullable - private Long priority; - - @Nullable - private IndexTemplateMapping template; - - @Nullable - private Long version; - - /** - * Optional user metadata about the index template. May have any contents. This - * map is not automatically generated by Elasticsearch. - *

- * API name: {@code _meta} - *

- * Adds all entries of map to meta. - */ - public final Builder meta(Map map) { - this.meta = _mapPutAll(this.meta, map); - return this; - } - - /** - * Optional user metadata about the index template. May have any contents. This - * map is not automatically generated by Elasticsearch. - *

- * API name: {@code _meta} - *

- * Adds an entry to meta. - */ - public final Builder meta(String key, JsonData value) { - this.meta = _mapPut(this.meta, key, value); - return this; - } - - /** - * This setting overrides the value of the action.auto_create_index - * cluster setting. If set to true in a template, then indices can - * be automatically created using that template even if auto-creation of indices - * is disabled via actions.auto_create_index. If set to - * false, then indices or data streams matching the template must - * always be explicitly created, and may never be automatically created. - *

- * API name: {@code allow_auto_create} - */ - public final Builder allowAutoCreate(@Nullable Boolean value) { - this.allowAutoCreate = value; - return this; - } - - /** - * An ordered list of component template names. Component templates are merged - * in the order specified, meaning that the last component template specified - * has the highest precedence. - *

- * API name: {@code composed_of} - *

- * Adds all elements of list to composedOf. - */ - public final Builder composedOf(List list) { - this.composedOf = _listAddAll(this.composedOf, list); - return this; - } - - /** - * An ordered list of component template names. Component templates are merged - * in the order specified, meaning that the last component template specified - * has the highest precedence. - *

- * API name: {@code composed_of} - *

- * Adds one or more values to composedOf. - */ - public final Builder composedOf(String value, String... values) { - this.composedOf = _listAdd(this.composedOf, value, values); - return this; - } - - /** - * If true, the template passed in the body is only used if no existing - * templates match the same index patterns. If false, the simulation uses the - * template with the highest priority. Note that the template is not permanently - * added or updated in either case; it is only used for the simulation. - *

- * API name: {@code create} - */ - public final Builder create(@Nullable Boolean value) { - this.create = value; - return this; - } - - /** - * If this object is included, the template is used to create data streams and - * their backing indices. Supports an empty object. Data streams require a - * matching index template with a data_stream object. - *

- * API name: {@code data_stream} - */ - public final Builder dataStream(@Nullable DataStreamVisibility value) { - this.dataStream = value; - return this; - } - - /** - * If this object is included, the template is used to create data streams and - * their backing indices. Supports an empty object. Data streams require a - * matching index template with a data_stream object. - *

- * API name: {@code data_stream} - */ - public final Builder dataStream( - Function> fn) { - return this.dataStream(fn.apply(new DataStreamVisibility.Builder()).build()); - } - - /** - * Marks this index template as deprecated. When creating or updating a - * non-deprecated index template that uses deprecated components, Elasticsearch - * will emit a deprecation warning. - *

- * API name: {@code deprecated} - */ - public final Builder deprecated(@Nullable Boolean value) { - this.deprecated = value; - return this; - } - - /** - * The configuration option ignore_missing_component_templates can be used when - * an index template references a component template that might not exist - *

- * API name: {@code ignore_missing_component_templates} - *

- * Adds all elements of list to - * ignoreMissingComponentTemplates. - */ - public final Builder ignoreMissingComponentTemplates(List list) { - this.ignoreMissingComponentTemplates = _listAddAll(this.ignoreMissingComponentTemplates, list); - return this; - } - - /** - * The configuration option ignore_missing_component_templates can be used when - * an index template references a component template that might not exist - *

- * API name: {@code ignore_missing_component_templates} - *

- * Adds one or more values to ignoreMissingComponentTemplates. - */ - public final Builder ignoreMissingComponentTemplates(String value, String... values) { - this.ignoreMissingComponentTemplates = _listAdd(this.ignoreMissingComponentTemplates, value, values); - return this; - } - - /** - * If true, returns all relevant default configurations for the index template. - *

- * API name: {@code include_defaults} - */ - public final Builder includeDefaults(@Nullable Boolean value) { - this.includeDefaults = value; - return this; - } - - /** - * Array of wildcard (*) expressions used to match the names of - * data streams and indices during creation. - *

- * API name: {@code index_patterns} - *

- * Adds all elements of list to indexPatterns. - */ - public final Builder indexPatterns(List list) { - this.indexPatterns = _listAddAll(this.indexPatterns, list); - return this; - } - - /** - * Array of wildcard (*) expressions used to match the names of - * data streams and indices during creation. - *

- * API name: {@code index_patterns} - *

- * Adds one or more values to indexPatterns. - */ - public final Builder indexPatterns(String value, String... values) { - this.indexPatterns = _listAdd(this.indexPatterns, value, values); - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Name of the index template to simulate. To test a template configuration - * before you add it to the cluster, omit this parameter and specify the - * template configuration in the request body. - *

- * API name: {@code name} - */ - public final Builder name(@Nullable String value) { - this.name = value; - return this; - } - - /** - * Priority to determine index template precedence when a new data stream or - * index is created. The index template with the highest priority is chosen. If - * no priority is specified the template is treated as though it is of priority - * 0 (lowest priority). This number is not automatically generated by - * Elasticsearch. - *

- * API name: {@code priority} - */ - public final Builder priority(@Nullable Long value) { - this.priority = value; - return this; - } - - /** - * Template to be applied. It may optionally include an aliases, - * mappings, or settings configuration. - *

- * API name: {@code template} - */ - public final Builder template(@Nullable IndexTemplateMapping value) { - this.template = value; - return this; - } - - /** - * Template to be applied. It may optionally include an aliases, - * mappings, or settings configuration. - *

- * API name: {@code template} - */ - public final Builder template(Function> fn) { - return this.template(fn.apply(new IndexTemplateMapping.Builder()).build()); - } - - /** - * Version number used to manage index templates externally. This number is not - * automatically generated by Elasticsearch. - *

- * API name: {@code version} - */ - public final Builder version(@Nullable Long value) { - this.version = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SimulateTemplateRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SimulateTemplateRequest build() { - _checkSingleUse(); - - return new SimulateTemplateRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SimulateTemplateRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, SimulateTemplateRequest::setupSimulateTemplateRequestDeserializer); - - protected static void setupSimulateTemplateRequestDeserializer( - ObjectDeserializer op) { - - op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta"); - op.add(Builder::allowAutoCreate, JsonpDeserializer.booleanDeserializer(), "allow_auto_create"); - op.add(Builder::composedOf, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "composed_of"); - op.add(Builder::dataStream, DataStreamVisibility._DESERIALIZER, "data_stream"); - op.add(Builder::deprecated, JsonpDeserializer.booleanDeserializer(), "deprecated"); - op.add(Builder::ignoreMissingComponentTemplates, - JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "ignore_missing_component_templates"); - op.add(Builder::indexPatterns, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "index_patterns"); - op.add(Builder::priority, JsonpDeserializer.longDeserializer(), "priority"); - op.add(Builder::template, IndexTemplateMapping._DESERIALIZER, "template"); - op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version"); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.simulate_template}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.simulate_template", - - // Request method - request -> { - return "POST"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - if (request.name() != null) - propsSet |= _name; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_index_template"); - buf.append("/_simulate"); - return buf.toString(); - } - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_index_template"); - buf.append("/_simulate"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - if (request.name() != null) - propsSet |= _name; - - if (propsSet == 0) { - } - if (propsSet == (_name)) { - params.put("name", request.name); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.create != null) { - params.put("create", String.valueOf(request.create)); - } - if (request.includeDefaults != null) { - params.put("include_defaults", String.valueOf(request.includeDefaults)); - } - return params; - - }, SimpleEndpoint.emptyMap(), true, SimulateTemplateResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateTemplateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateTemplateResponse.java deleted file mode 100644 index d3411d785..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateTemplateResponse.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch.indices.simulate_template.Overlapping; -import co.elastic.clients.elasticsearch.indices.simulate_template.Template; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.simulate_template.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SimulateTemplateResponse implements JsonpSerializable { - private final List overlapping; - - private final Template template; - - // --------------------------------------------------------------------------------------------- - - private SimulateTemplateResponse(Builder builder) { - - this.overlapping = ApiTypeHelper.unmodifiable(builder.overlapping); - this.template = ApiTypeHelper.requireNonNull(builder.template, this, "template"); - - } - - public static SimulateTemplateResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code overlapping} - */ - public final List overlapping() { - return this.overlapping; - } - - /** - * Required - API name: {@code template} - */ - public final Template template() { - return this.template; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.overlapping)) { - generator.writeKey("overlapping"); - generator.writeStartArray(); - for (Overlapping item0 : this.overlapping) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - generator.writeKey("template"); - this.template.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SimulateTemplateResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private List overlapping; - - private Template template; - - /** - * API name: {@code overlapping} - *

- * Adds all elements of list to overlapping. - */ - public final Builder overlapping(List list) { - this.overlapping = _listAddAll(this.overlapping, list); - return this; - } - - /** - * API name: {@code overlapping} - *

- * Adds one or more values to overlapping. - */ - public final Builder overlapping(Overlapping value, Overlapping... values) { - this.overlapping = _listAdd(this.overlapping, value, values); - return this; - } - - /** - * API name: {@code overlapping} - *

- * Adds a value to overlapping using a builder lambda. - */ - public final Builder overlapping(Function> fn) { - return overlapping(fn.apply(new Overlapping.Builder()).build()); - } - - /** - * Required - API name: {@code template} - */ - public final Builder template(Template value) { - this.template = value; - return this; - } - - /** - * Required - API name: {@code template} - */ - public final Builder template(Function> fn) { - return this.template(fn.apply(new Template.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SimulateTemplateResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SimulateTemplateResponse build() { - _checkSingleUse(); - - return new SimulateTemplateResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SimulateTemplateResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, SimulateTemplateResponse::setupSimulateTemplateResponseDeserializer); - - protected static void setupSimulateTemplateResponseDeserializer( - ObjectDeserializer op) { - - op.add(Builder::overlapping, JsonpDeserializer.arrayDeserializer(Overlapping._DESERIALIZER), "overlapping"); - op.add(Builder::template, Template._DESERIALIZER, "template"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogSettings.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogSettings.java deleted file mode 100644 index d191134f2..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogSettings.java +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Integer; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.SlowlogSettings - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SlowlogSettings implements JsonpSerializable { - @Nullable - private final String level; - - @Nullable - private final Integer source; - - @Nullable - private final Boolean reformat; - - @Nullable - private final SlowlogTresholds threshold; - - // --------------------------------------------------------------------------------------------- - - private SlowlogSettings(Builder builder) { - - this.level = builder.level; - this.source = builder.source; - this.reformat = builder.reformat; - this.threshold = builder.threshold; - - } - - public static SlowlogSettings of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code level} - */ - @Nullable - public final String level() { - return this.level; - } - - /** - * API name: {@code source} - */ - @Nullable - public final Integer source() { - return this.source; - } - - /** - * API name: {@code reformat} - */ - @Nullable - public final Boolean reformat() { - return this.reformat; - } - - /** - * API name: {@code threshold} - */ - @Nullable - public final SlowlogTresholds threshold() { - return this.threshold; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.level != null) { - generator.writeKey("level"); - generator.write(this.level); - - } - if (this.source != null) { - generator.writeKey("source"); - generator.write(this.source); - - } - if (this.reformat != null) { - generator.writeKey("reformat"); - generator.write(this.reformat); - - } - if (this.threshold != null) { - generator.writeKey("threshold"); - this.threshold.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SlowlogSettings}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private String level; - - @Nullable - private Integer source; - - @Nullable - private Boolean reformat; - - @Nullable - private SlowlogTresholds threshold; - - /** - * API name: {@code level} - */ - public final Builder level(@Nullable String value) { - this.level = value; - return this; - } - - /** - * API name: {@code source} - */ - public final Builder source(@Nullable Integer value) { - this.source = value; - return this; - } - - /** - * API name: {@code reformat} - */ - public final Builder reformat(@Nullable Boolean value) { - this.reformat = value; - return this; - } - - /** - * API name: {@code threshold} - */ - public final Builder threshold(@Nullable SlowlogTresholds value) { - this.threshold = value; - return this; - } - - /** - * API name: {@code threshold} - */ - public final Builder threshold(Function> fn) { - return this.threshold(fn.apply(new SlowlogTresholds.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SlowlogSettings}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SlowlogSettings build() { - _checkSingleUse(); - - return new SlowlogSettings(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SlowlogSettings} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - SlowlogSettings::setupSlowlogSettingsDeserializer); - - protected static void setupSlowlogSettingsDeserializer(ObjectDeserializer op) { - - op.add(Builder::level, JsonpDeserializer.stringDeserializer(), "level"); - op.add(Builder::source, JsonpDeserializer.integerDeserializer(), "source"); - op.add(Builder::reformat, JsonpDeserializer.booleanDeserializer(), "reformat"); - op.add(Builder::threshold, SlowlogTresholds._DESERIALIZER, "threshold"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogTresholdLevels.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogTresholdLevels.java deleted file mode 100644 index 16e3e513f..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogTresholdLevels.java +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.SlowlogTresholdLevels - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SlowlogTresholdLevels implements JsonpSerializable { - @Nullable - private final Time warn; - - @Nullable - private final Time info; - - @Nullable - private final Time debug; - - @Nullable - private final Time trace; - - // --------------------------------------------------------------------------------------------- - - private SlowlogTresholdLevels(Builder builder) { - - this.warn = builder.warn; - this.info = builder.info; - this.debug = builder.debug; - this.trace = builder.trace; - - } - - public static SlowlogTresholdLevels of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code warn} - */ - @Nullable - public final Time warn() { - return this.warn; - } - - /** - * API name: {@code info} - */ - @Nullable - public final Time info() { - return this.info; - } - - /** - * API name: {@code debug} - */ - @Nullable - public final Time debug() { - return this.debug; - } - - /** - * API name: {@code trace} - */ - @Nullable - public final Time trace() { - return this.trace; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.warn != null) { - generator.writeKey("warn"); - this.warn.serialize(generator, mapper); - - } - if (this.info != null) { - generator.writeKey("info"); - this.info.serialize(generator, mapper); - - } - if (this.debug != null) { - generator.writeKey("debug"); - this.debug.serialize(generator, mapper); - - } - if (this.trace != null) { - generator.writeKey("trace"); - this.trace.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SlowlogTresholdLevels}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Time warn; - - @Nullable - private Time info; - - @Nullable - private Time debug; - - @Nullable - private Time trace; - - /** - * API name: {@code warn} - */ - public final Builder warn(@Nullable Time value) { - this.warn = value; - return this; - } - - /** - * API name: {@code warn} - */ - public final Builder warn(Function> fn) { - return this.warn(fn.apply(new Time.Builder()).build()); - } - - /** - * API name: {@code info} - */ - public final Builder info(@Nullable Time value) { - this.info = value; - return this; - } - - /** - * API name: {@code info} - */ - public final Builder info(Function> fn) { - return this.info(fn.apply(new Time.Builder()).build()); - } - - /** - * API name: {@code debug} - */ - public final Builder debug(@Nullable Time value) { - this.debug = value; - return this; - } - - /** - * API name: {@code debug} - */ - public final Builder debug(Function> fn) { - return this.debug(fn.apply(new Time.Builder()).build()); - } - - /** - * API name: {@code trace} - */ - public final Builder trace(@Nullable Time value) { - this.trace = value; - return this; - } - - /** - * API name: {@code trace} - */ - public final Builder trace(Function> fn) { - return this.trace(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SlowlogTresholdLevels}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SlowlogTresholdLevels build() { - _checkSingleUse(); - - return new SlowlogTresholdLevels(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SlowlogTresholdLevels} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, SlowlogTresholdLevels::setupSlowlogTresholdLevelsDeserializer); - - protected static void setupSlowlogTresholdLevelsDeserializer(ObjectDeserializer op) { - - op.add(Builder::warn, Time._DESERIALIZER, "warn"); - op.add(Builder::info, Time._DESERIALIZER, "info"); - op.add(Builder::debug, Time._DESERIALIZER, "debug"); - op.add(Builder::trace, Time._DESERIALIZER, "trace"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogTresholds.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogTresholds.java deleted file mode 100644 index 4354d448a..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogTresholds.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.SlowlogTresholds - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SlowlogTresholds implements JsonpSerializable { - @Nullable - private final SlowlogTresholdLevels query; - - @Nullable - private final SlowlogTresholdLevels fetch; - - // --------------------------------------------------------------------------------------------- - - private SlowlogTresholds(Builder builder) { - - this.query = builder.query; - this.fetch = builder.fetch; - - } - - public static SlowlogTresholds of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code query} - */ - @Nullable - public final SlowlogTresholdLevels query() { - return this.query; - } - - /** - * API name: {@code fetch} - */ - @Nullable - public final SlowlogTresholdLevels fetch() { - return this.fetch; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.query != null) { - generator.writeKey("query"); - this.query.serialize(generator, mapper); - - } - if (this.fetch != null) { - generator.writeKey("fetch"); - this.fetch.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SlowlogTresholds}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private SlowlogTresholdLevels query; - - @Nullable - private SlowlogTresholdLevels fetch; - - /** - * API name: {@code query} - */ - public final Builder query(@Nullable SlowlogTresholdLevels value) { - this.query = value; - return this; - } - - /** - * API name: {@code query} - */ - public final Builder query(Function> fn) { - return this.query(fn.apply(new SlowlogTresholdLevels.Builder()).build()); - } - - /** - * API name: {@code fetch} - */ - public final Builder fetch(@Nullable SlowlogTresholdLevels value) { - this.fetch = value; - return this; - } - - /** - * API name: {@code fetch} - */ - public final Builder fetch(Function> fn) { - return this.fetch(fn.apply(new SlowlogTresholdLevels.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SlowlogTresholds}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SlowlogTresholds build() { - _checkSingleUse(); - - return new SlowlogTresholds(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SlowlogTresholds} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - SlowlogTresholds::setupSlowlogTresholdsDeserializer); - - protected static void setupSlowlogTresholdsDeserializer(ObjectDeserializer op) { - - op.add(Builder::query, SlowlogTresholdLevels._DESERIALIZER, "query"); - op.add(Builder::fetch, SlowlogTresholdLevels._DESERIALIZER, "fetch"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SoftDeletes.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SoftDeletes.java deleted file mode 100644 index 13aa7f0d7..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SoftDeletes.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.SoftDeletes - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SoftDeletes implements JsonpSerializable { - @Nullable - private final Boolean enabled; - - @Nullable - private final RetentionLease retentionLease; - - // --------------------------------------------------------------------------------------------- - - private SoftDeletes(Builder builder) { - - this.enabled = builder.enabled; - this.retentionLease = builder.retentionLease; - - } - - public static SoftDeletes of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Indicates whether soft deletes are enabled on the index. - *

- * API name: {@code enabled} - */ - @Nullable - public final Boolean enabled() { - return this.enabled; - } - - /** - * The maximum period to retain a shard history retention lease before it is - * considered expired. Shard history retention leases ensure that soft deletes - * are retained during merges on the Lucene index. If a soft delete is merged - * away before it can be replicated to a follower the following process will - * fail due to incomplete history on the leader. - *

- * API name: {@code retention_lease} - */ - @Nullable - public final RetentionLease retentionLease() { - return this.retentionLease; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.enabled != null) { - generator.writeKey("enabled"); - generator.write(this.enabled); - - } - if (this.retentionLease != null) { - generator.writeKey("retention_lease"); - this.retentionLease.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SoftDeletes}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private Boolean enabled; - - @Nullable - private RetentionLease retentionLease; - - /** - * Indicates whether soft deletes are enabled on the index. - *

- * API name: {@code enabled} - */ - public final Builder enabled(@Nullable Boolean value) { - this.enabled = value; - return this; - } - - /** - * The maximum period to retain a shard history retention lease before it is - * considered expired. Shard history retention leases ensure that soft deletes - * are retained during merges on the Lucene index. If a soft delete is merged - * away before it can be replicated to a follower the following process will - * fail due to incomplete history on the leader. - *

- * API name: {@code retention_lease} - */ - public final Builder retentionLease(@Nullable RetentionLease value) { - this.retentionLease = value; - return this; - } - - /** - * The maximum period to retain a shard history retention lease before it is - * considered expired. Shard history retention leases ensure that soft deletes - * are retained during merges on the Lucene index. If a soft delete is merged - * away before it can be replicated to a follower the following process will - * fail due to incomplete history on the leader. - *

- * API name: {@code retention_lease} - */ - public final Builder retentionLease(Function> fn) { - return this.retentionLease(fn.apply(new RetentionLease.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SoftDeletes}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SoftDeletes build() { - _checkSingleUse(); - - return new SoftDeletes(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SoftDeletes} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - SoftDeletes::setupSoftDeletesDeserializer); - - protected static void setupSoftDeletesDeserializer(ObjectDeserializer op) { - - op.add(Builder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled"); - op.add(Builder::retentionLease, RetentionLease._DESERIALIZER, "retention_lease"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Storage.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Storage.java deleted file mode 100644 index f1a8c63f9..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Storage.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.Storage - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class Storage implements JsonpSerializable { - private final String type; - - @Nullable - private final Boolean allowMmap; - - // --------------------------------------------------------------------------------------------- - - private Storage(Builder builder) { - - this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); - this.allowMmap = builder.allowMmap; - - } - - public static Storage of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code type} - */ - public final String type() { - return this.type; - } - - /** - * You can restrict the use of the mmapfs and the related hybridfs store type - * via the setting node.store.allow_mmap. This is a boolean setting indicating - * whether or not memory-mapping is allowed. The default is to allow it. This - * setting is useful, for example, if you are in an environment where you can - * not control the ability to create a lot of memory maps so you need disable - * the ability to use memory-mapping. - *

- * API name: {@code allow_mmap} - */ - @Nullable - public final Boolean allowMmap() { - return this.allowMmap; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("type"); - generator.write(this.type); - - if (this.allowMmap != null) { - generator.writeKey("allow_mmap"); - generator.write(this.allowMmap); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link Storage}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String type; - - @Nullable - private Boolean allowMmap; - - /** - * Required - API name: {@code type} - */ - public final Builder type(String value) { - this.type = value; - return this; - } - - /** - * Required - API name: {@code type} - */ - public final Builder type(StorageType value) { - this.type = value == null ? null : value.jsonValue(); - return this; - } - - /** - * You can restrict the use of the mmapfs and the related hybridfs store type - * via the setting node.store.allow_mmap. This is a boolean setting indicating - * whether or not memory-mapping is allowed. The default is to allow it. This - * setting is useful, for example, if you are in an environment where you can - * not control the ability to create a lot of memory maps so you need disable - * the ability to use memory-mapping. - *

- * API name: {@code allow_mmap} - */ - public final Builder allowMmap(@Nullable Boolean value) { - this.allowMmap = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link Storage}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public Storage build() { - _checkSingleUse(); - - return new Storage(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link Storage} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - Storage::setupStorageDeserializer); - - protected static void setupStorageDeserializer(ObjectDeserializer op) { - - op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); - op.add(Builder::allowMmap, JsonpDeserializer.booleanDeserializer(), "allow_mmap"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/StorageType.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/StorageType.java deleted file mode 100644 index 2b429e72c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/StorageType.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum StorageType implements JsonEnum { - /** - * Default file system implementation. This will pick the best implementation - * depending on the operating environment, which is currently hybridfs on all - * supported systems but is subject to change. - */ - Fs("fs"), - - /** - * The NIO FS type stores the shard index on the file system (maps to Lucene - * NIOFSDirectory) using NIO. It allows multiple threads to read from the same - * file concurrently. It is not recommended on Windows because of a bug in the - * SUN Java implementation and disables some optimizations for heap memory - * usage. - */ - Niofs("niofs"), - - /** - * The MMap FS type stores the shard index on the file system (maps to Lucene - * MMapDirectory) by mapping a file into memory (mmap). Memory mapping uses up a - * portion of the virtual memory address space in your process equal to the size - * of the file being mapped. Before using this class, be sure you have allowed - * plenty of virtual address space. - */ - Mmapfs("mmapfs"), - - /** - * The hybridfs type is a hybrid of niofs and mmapfs, which chooses the best - * file system type for each type of file based on the read access pattern. - * Currently only the Lucene term dictionary, norms and doc values files are - * memory mapped. All other files are opened using Lucene NIOFSDirectory. - * Similarly to mmapfs be sure you have allowed plenty of virtual address space. - */ - Hybridfs("hybridfs"), - - ; - - private final String jsonValue; - - StorageType(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - StorageType.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Translog.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Translog.java deleted file mode 100644 index 5f42a6e05..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Translog.java +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.Translog - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class Translog implements JsonpSerializable { - @Nullable - private final Time syncInterval; - - @Nullable - private final TranslogDurability durability; - - @Nullable - private final String flushThresholdSize; - - @Nullable - private final TranslogRetention retention; - - // --------------------------------------------------------------------------------------------- - - private Translog(Builder builder) { - - this.syncInterval = builder.syncInterval; - this.durability = builder.durability; - this.flushThresholdSize = builder.flushThresholdSize; - this.retention = builder.retention; - - } - - public static Translog of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * How often the translog is fsynced to disk and committed, regardless of write - * operations. Values less than 100ms are not allowed. - *

- * API name: {@code sync_interval} - */ - @Nullable - public final Time syncInterval() { - return this.syncInterval; - } - - /** - * Whether or not to fsync and commit the translog after every - * index, delete, update, or bulk request. - *

- * API name: {@code durability} - */ - @Nullable - public final TranslogDurability durability() { - return this.durability; - } - - /** - * The translog stores all operations that are not yet safely persisted in - * Lucene (i.e., are not part of a Lucene commit point). Although these - * operations are available for reads, they will need to be replayed if the - * shard was stopped and had to be recovered. This setting controls the maximum - * total size of these operations, to prevent recoveries from taking too long. - * Once the maximum size has been reached a flush will happen, generating a new - * Lucene commit point. - *

- * API name: {@code flush_threshold_size} - */ - @Nullable - public final String flushThresholdSize() { - return this.flushThresholdSize; - } - - /** - * API name: {@code retention} - */ - @Nullable - public final TranslogRetention retention() { - return this.retention; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.syncInterval != null) { - generator.writeKey("sync_interval"); - this.syncInterval.serialize(generator, mapper); - - } - if (this.durability != null) { - generator.writeKey("durability"); - this.durability.serialize(generator, mapper); - } - if (this.flushThresholdSize != null) { - generator.writeKey("flush_threshold_size"); - generator.write(this.flushThresholdSize); - - } - if (this.retention != null) { - generator.writeKey("retention"); - this.retention.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link Translog}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private Time syncInterval; - - @Nullable - private TranslogDurability durability; - - @Nullable - private String flushThresholdSize; - - @Nullable - private TranslogRetention retention; - - /** - * How often the translog is fsynced to disk and committed, regardless of write - * operations. Values less than 100ms are not allowed. - *

- * API name: {@code sync_interval} - */ - public final Builder syncInterval(@Nullable Time value) { - this.syncInterval = value; - return this; - } - - /** - * How often the translog is fsynced to disk and committed, regardless of write - * operations. Values less than 100ms are not allowed. - *

- * API name: {@code sync_interval} - */ - public final Builder syncInterval(Function> fn) { - return this.syncInterval(fn.apply(new Time.Builder()).build()); - } - - /** - * Whether or not to fsync and commit the translog after every - * index, delete, update, or bulk request. - *

- * API name: {@code durability} - */ - public final Builder durability(@Nullable TranslogDurability value) { - this.durability = value; - return this; - } - - /** - * The translog stores all operations that are not yet safely persisted in - * Lucene (i.e., are not part of a Lucene commit point). Although these - * operations are available for reads, they will need to be replayed if the - * shard was stopped and had to be recovered. This setting controls the maximum - * total size of these operations, to prevent recoveries from taking too long. - * Once the maximum size has been reached a flush will happen, generating a new - * Lucene commit point. - *

- * API name: {@code flush_threshold_size} - */ - public final Builder flushThresholdSize(@Nullable String value) { - this.flushThresholdSize = value; - return this; - } - - /** - * API name: {@code retention} - */ - public final Builder retention(@Nullable TranslogRetention value) { - this.retention = value; - return this; - } - - /** - * API name: {@code retention} - */ - public final Builder retention(Function> fn) { - return this.retention(fn.apply(new TranslogRetention.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link Translog}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public Translog build() { - _checkSingleUse(); - - return new Translog(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link Translog} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - Translog::setupTranslogDeserializer); - - protected static void setupTranslogDeserializer(ObjectDeserializer op) { - - op.add(Builder::syncInterval, Time._DESERIALIZER, "sync_interval"); - op.add(Builder::durability, TranslogDurability._DESERIALIZER, "durability"); - op.add(Builder::flushThresholdSize, JsonpDeserializer.stringDeserializer(), "flush_threshold_size"); - op.add(Builder::retention, TranslogRetention._DESERIALIZER, "retention"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TranslogDurability.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TranslogDurability.java deleted file mode 100644 index c56acd4ca..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TranslogDurability.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum TranslogDurability implements JsonEnum { - /** - * (default) fsync and commit after every request. In the event of hardware - * failure, all acknowledged writes will already have been committed to disk. - */ - Request("request", "REQUEST"), - - /** - * fsync and commit in the background every sync_interval. In the event of a - * failure, all acknowledged writes since the last automatic commit will be - * discarded. - */ - Async("async", "ASYNC"), - - ; - - private final String jsonValue; - private final String[] aliases; - - TranslogDurability(String jsonValue, String... aliases) { - this.jsonValue = jsonValue; - this.aliases = aliases; - } - - public String jsonValue() { - return this.jsonValue; - } - - public String[] aliases() { - return this.aliases; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - TranslogDurability.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TranslogRetention.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TranslogRetention.java deleted file mode 100644 index 5b768461b..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TranslogRetention.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices._types.TranslogRetention - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class TranslogRetention implements JsonpSerializable { - @Nullable - private final String size; - - @Nullable - private final Time age; - - // --------------------------------------------------------------------------------------------- - - private TranslogRetention(Builder builder) { - - this.size = builder.size; - this.age = builder.age; - - } - - public static TranslogRetention of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * This controls the total size of translog files to keep for each shard. - * Keeping more translog files increases the chance of performing an operation - * based sync when recovering a replica. If the translog files are not - * sufficient, replica recovery will fall back to a file based sync. This - * setting is ignored, and should not be set, if soft deletes are enabled. Soft - * deletes are enabled by default in indices created in Elasticsearch versions - * 7.0.0 and later. - *

- * API name: {@code size} - */ - @Nullable - public final String size() { - return this.size; - } - - /** - * This controls the maximum duration for which translog files are kept by each - * shard. Keeping more translog files increases the chance of performing an - * operation based sync when recovering replicas. If the translog files are not - * sufficient, replica recovery will fall back to a file based sync. This - * setting is ignored, and should not be set, if soft deletes are enabled. Soft - * deletes are enabled by default in indices created in Elasticsearch versions - * 7.0.0 and later. - *

- * API name: {@code age} - */ - @Nullable - public final Time age() { - return this.age; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.size != null) { - generator.writeKey("size"); - generator.write(this.size); - - } - if (this.age != null) { - generator.writeKey("age"); - this.age.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link TranslogRetention}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private String size; - - @Nullable - private Time age; - - /** - * This controls the total size of translog files to keep for each shard. - * Keeping more translog files increases the chance of performing an operation - * based sync when recovering a replica. If the translog files are not - * sufficient, replica recovery will fall back to a file based sync. This - * setting is ignored, and should not be set, if soft deletes are enabled. Soft - * deletes are enabled by default in indices created in Elasticsearch versions - * 7.0.0 and later. - *

- * API name: {@code size} - */ - public final Builder size(@Nullable String value) { - this.size = value; - return this; - } - - /** - * This controls the maximum duration for which translog files are kept by each - * shard. Keeping more translog files increases the chance of performing an - * operation based sync when recovering replicas. If the translog files are not - * sufficient, replica recovery will fall back to a file based sync. This - * setting is ignored, and should not be set, if soft deletes are enabled. Soft - * deletes are enabled by default in indices created in Elasticsearch versions - * 7.0.0 and later. - *

- * API name: {@code age} - */ - public final Builder age(@Nullable Time value) { - this.age = value; - return this; - } - - /** - * This controls the maximum duration for which translog files are kept by each - * shard. Keeping more translog files increases the chance of performing an - * operation based sync when recovering replicas. If the translog files are not - * sufficient, replica recovery will fall back to a file based sync. This - * setting is ignored, and should not be set, if soft deletes are enabled. Soft - * deletes are enabled by default in indices created in Elasticsearch versions - * 7.0.0 and later. - *

- * API name: {@code age} - */ - public final Builder age(Function> fn) { - return this.age(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link TranslogRetention}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public TranslogRetention build() { - _checkSingleUse(); - - return new TranslogRetention(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link TranslogRetention} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, TranslogRetention::setupTranslogRetentionDeserializer); - - protected static void setupTranslogRetentionDeserializer(ObjectDeserializer op) { - - op.add(Builder::size, JsonpDeserializer.stringDeserializer(), "size"); - op.add(Builder::age, Time._DESERIALIZER, "age"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/UpdateAliasesRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/UpdateAliasesRequest.java deleted file mode 100644 index 8c5b888d7..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/UpdateAliasesRequest.java +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.elasticsearch.indices.update_aliases.Action; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.update_aliases.Request - -/** - * Create or update an alias. Adds a data stream or index to an alias. - * - * @see API - * specification - */ -@JsonpDeserializable -public class UpdateAliasesRequest extends RequestBase implements JsonpSerializable { - private final List actions; - - @Nullable - private final Time masterTimeout; - - @Nullable - private final Time timeout; - - // --------------------------------------------------------------------------------------------- - - private UpdateAliasesRequest(Builder builder) { - - this.actions = ApiTypeHelper.unmodifiable(builder.actions); - this.masterTimeout = builder.masterTimeout; - this.timeout = builder.timeout; - - } - - public static UpdateAliasesRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Actions to perform. - *

- * API name: {@code actions} - */ - public final List actions() { - return this.actions; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.actions)) { - generator.writeKey("actions"); - generator.writeStartArray(); - for (Action item0 : this.actions) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link UpdateAliasesRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private List actions; - - @Nullable - private Time masterTimeout; - - @Nullable - private Time timeout; - - /** - * Actions to perform. - *

- * API name: {@code actions} - *

- * Adds all elements of list to actions. - */ - public final Builder actions(List list) { - this.actions = _listAddAll(this.actions, list); - return this; - } - - /** - * Actions to perform. - *

- * API name: {@code actions} - *

- * Adds one or more values to actions. - */ - public final Builder actions(Action value, Action... values) { - this.actions = _listAdd(this.actions, value, values); - return this; - } - - /** - * Actions to perform. - *

- * API name: {@code actions} - *

- * Adds a value to actions using a builder lambda. - */ - public final Builder actions(Function> fn) { - return actions(fn.apply(new Action.Builder()).build()); - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link UpdateAliasesRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public UpdateAliasesRequest build() { - _checkSingleUse(); - - return new UpdateAliasesRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link UpdateAliasesRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, UpdateAliasesRequest::setupUpdateAliasesRequestDeserializer); - - protected static void setupUpdateAliasesRequestDeserializer(ObjectDeserializer op) { - - op.add(Builder::actions, JsonpDeserializer.arrayDeserializer(Action._DESERIALIZER), "actions"); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.update_aliases}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.update_aliases", - - // Request method - request -> { - return "POST"; - - }, - - // Request path - request -> { - return "/_aliases"; - - }, - - // Path parameters - request -> { - return Collections.emptyMap(); - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), true, UpdateAliasesResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/UpdateAliasesResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/UpdateAliasesResponse.java deleted file mode 100644 index defd4316c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/UpdateAliasesResponse.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.update_aliases.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class UpdateAliasesResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private UpdateAliasesResponse(Builder builder) { - super(builder); - - } - - public static UpdateAliasesResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link UpdateAliasesResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link UpdateAliasesResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public UpdateAliasesResponse build() { - _checkSingleUse(); - - return new UpdateAliasesResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link UpdateAliasesResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, UpdateAliasesResponse::setupUpdateAliasesResponseDeserializer); - - protected static void setupUpdateAliasesResponseDeserializer(ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ValidateQueryRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ValidateQueryRequest.java deleted file mode 100644 index 0d2ae4412..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ValidateQueryRequest.java +++ /dev/null @@ -1,702 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.query_dsl.Operator; -import co.elastic.clients.elasticsearch._types.query_dsl.Query; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.validate_query.Request - -/** - * Validate a query. Validates a query without running it. - * - * @see API - * specification - */ -@JsonpDeserializable -public class ValidateQueryRequest extends RequestBase implements JsonpSerializable { - @Nullable - private final Boolean allShards; - - @Nullable - private final Boolean allowNoIndices; - - @Nullable - private final Boolean analyzeWildcard; - - @Nullable - private final String analyzer; - - @Nullable - private final Operator defaultOperator; - - @Nullable - private final String df; - - private final List expandWildcards; - - @Nullable - private final Boolean explain; - - @Nullable - private final Boolean ignoreUnavailable; - - private final List index; - - @Nullable - private final Boolean lenient; - - @Nullable - private final String q; - - @Nullable - private final Query query; - - @Nullable - private final Boolean rewrite; - - // --------------------------------------------------------------------------------------------- - - private ValidateQueryRequest(Builder builder) { - - this.allShards = builder.allShards; - this.allowNoIndices = builder.allowNoIndices; - this.analyzeWildcard = builder.analyzeWildcard; - this.analyzer = builder.analyzer; - this.defaultOperator = builder.defaultOperator; - this.df = builder.df; - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.explain = builder.explain; - this.ignoreUnavailable = builder.ignoreUnavailable; - this.index = ApiTypeHelper.unmodifiable(builder.index); - this.lenient = builder.lenient; - this.q = builder.q; - this.query = builder.query; - this.rewrite = builder.rewrite; - - } - - public static ValidateQueryRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If true, the validation is executed on all shards instead of one - * random shard per index. - *

- * API name: {@code all_shards} - */ - @Nullable - public final Boolean allShards() { - return this.allShards; - } - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. - *

- * API name: {@code allow_no_indices} - */ - @Nullable - public final Boolean allowNoIndices() { - return this.allowNoIndices; - } - - /** - * If true, wildcard and prefix queries are analyzed. - *

- * API name: {@code analyze_wildcard} - */ - @Nullable - public final Boolean analyzeWildcard() { - return this.analyzeWildcard; - } - - /** - * Analyzer to use for the query string. This parameter can only be used when - * the q query string parameter is specified. - *

- * API name: {@code analyzer} - */ - @Nullable - public final String analyzer() { - return this.analyzer; - } - - /** - * The default operator for query string query: AND or - * OR. - *

- * API name: {@code default_operator} - */ - @Nullable - public final Operator defaultOperator() { - return this.defaultOperator; - } - - /** - * Field to use as default where no field prefix is given in the query string. - * This parameter can only be used when the q query string - * parameter is specified. - *

- * API name: {@code df} - */ - @Nullable - public final String df() { - return this.df; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * If true, the response returns detailed information if an error - * has occurred. - *

- * API name: {@code explain} - */ - @Nullable - public final Boolean explain() { - return this.explain; - } - - /** - * If false, the request returns an error if it targets a missing - * or closed index. - *

- * API name: {@code ignore_unavailable} - */ - @Nullable - public final Boolean ignoreUnavailable() { - return this.ignoreUnavailable; - } - - /** - * Comma-separated list of data streams, indices, and aliases to search. - * Supports wildcards (*). To search all data streams or indices, - * omit this parameter or use * or _all. - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - /** - * If true, format-based query failures (such as providing text to - * a numeric field) in the query string will be ignored. - *

- * API name: {@code lenient} - */ - @Nullable - public final Boolean lenient() { - return this.lenient; - } - - /** - * Query in the Lucene query string syntax. - *

- * API name: {@code q} - */ - @Nullable - public final String q() { - return this.q; - } - - /** - * Query in the Lucene query string syntax. - *

- * API name: {@code query} - */ - @Nullable - public final Query query() { - return this.query; - } - - /** - * If true, returns a more detailed explanation showing the actual - * Lucene query that will be executed. - *

- * API name: {@code rewrite} - */ - @Nullable - public final Boolean rewrite() { - return this.rewrite; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.query != null) { - generator.writeKey("query"); - this.query.serialize(generator, mapper); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ValidateQueryRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Boolean allShards; - - @Nullable - private Boolean allowNoIndices; - - @Nullable - private Boolean analyzeWildcard; - - @Nullable - private String analyzer; - - @Nullable - private Operator defaultOperator; - - @Nullable - private String df; - - @Nullable - private List expandWildcards; - - @Nullable - private Boolean explain; - - @Nullable - private Boolean ignoreUnavailable; - - @Nullable - private List index; - - @Nullable - private Boolean lenient; - - @Nullable - private String q; - - @Nullable - private Query query; - - @Nullable - private Boolean rewrite; - - /** - * If true, the validation is executed on all shards instead of one - * random shard per index. - *

- * API name: {@code all_shards} - */ - public final Builder allShards(@Nullable Boolean value) { - this.allShards = value; - return this; - } - - /** - * If false, the request returns an error if any wildcard - * expression, index alias, or _all value targets only missing or - * closed indices. This behavior applies even if the request targets other open - * indices. - *

- * API name: {@code allow_no_indices} - */ - public final Builder allowNoIndices(@Nullable Boolean value) { - this.allowNoIndices = value; - return this; - } - - /** - * If true, wildcard and prefix queries are analyzed. - *

- * API name: {@code analyze_wildcard} - */ - public final Builder analyzeWildcard(@Nullable Boolean value) { - this.analyzeWildcard = value; - return this; - } - - /** - * Analyzer to use for the query string. This parameter can only be used when - * the q query string parameter is specified. - *

- * API name: {@code analyzer} - */ - public final Builder analyzer(@Nullable String value) { - this.analyzer = value; - return this; - } - - /** - * The default operator for query string query: AND or - * OR. - *

- * API name: {@code default_operator} - */ - public final Builder defaultOperator(@Nullable Operator value) { - this.defaultOperator = value; - return this; - } - - /** - * Field to use as default where no field prefix is given in the query string. - * This parameter can only be used when the q query string - * parameter is specified. - *

- * API name: {@code df} - */ - public final Builder df(@Nullable String value) { - this.df = value; - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. Valid values are: all, - * open, closed, hidden, - * none. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * If true, the response returns detailed information if an error - * has occurred. - *

- * API name: {@code explain} - */ - public final Builder explain(@Nullable Boolean value) { - this.explain = value; - return this; - } - - /** - * If false, the request returns an error if it targets a missing - * or closed index. - *

- * API name: {@code ignore_unavailable} - */ - public final Builder ignoreUnavailable(@Nullable Boolean value) { - this.ignoreUnavailable = value; - return this; - } - - /** - * Comma-separated list of data streams, indices, and aliases to search. - * Supports wildcards (*). To search all data streams or indices, - * omit this parameter or use * or _all. - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * Comma-separated list of data streams, indices, and aliases to search. - * Supports wildcards (*). To search all data streams or indices, - * omit this parameter or use * or _all. - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - /** - * If true, format-based query failures (such as providing text to - * a numeric field) in the query string will be ignored. - *

- * API name: {@code lenient} - */ - public final Builder lenient(@Nullable Boolean value) { - this.lenient = value; - return this; - } - - /** - * Query in the Lucene query string syntax. - *

- * API name: {@code q} - */ - public final Builder q(@Nullable String value) { - this.q = value; - return this; - } - - /** - * Query in the Lucene query string syntax. - *

- * API name: {@code query} - */ - public final Builder query(@Nullable Query value) { - this.query = value; - return this; - } - - /** - * Query in the Lucene query string syntax. - *

- * API name: {@code query} - */ - public final Builder query(Function> fn) { - return this.query(fn.apply(new Query.Builder()).build()); - } - - /** - * If true, returns a more detailed explanation showing the actual - * Lucene query that will be executed. - *

- * API name: {@code rewrite} - */ - public final Builder rewrite(@Nullable Boolean value) { - this.rewrite = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ValidateQueryRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ValidateQueryRequest build() { - _checkSingleUse(); - - return new ValidateQueryRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ValidateQueryRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ValidateQueryRequest::setupValidateQueryRequestDeserializer); - - protected static void setupValidateQueryRequestDeserializer(ObjectDeserializer op) { - - op.add(Builder::query, Query._DESERIALIZER, "query"); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.validate_query}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.validate_query", - - // Request method - request -> { - return "POST"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.index())) - propsSet |= _index; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_validate"); - buf.append("/query"); - return buf.toString(); - } - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_validate"); - buf.append("/query"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _index = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.index())) - propsSet |= _index; - - if (propsSet == 0) { - } - if (propsSet == (_index)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.explain != null) { - params.put("explain", String.valueOf(request.explain)); - } - if (request.q != null) { - params.put("q", request.q); - } - if (request.df != null) { - params.put("df", request.df); - } - if (request.defaultOperator != null) { - params.put("default_operator", request.defaultOperator.jsonValue()); - } - if (request.allShards != null) { - params.put("all_shards", String.valueOf(request.allShards)); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.analyzer != null) { - params.put("analyzer", request.analyzer); - } - if (request.analyzeWildcard != null) { - params.put("analyze_wildcard", String.valueOf(request.analyzeWildcard)); - } - if (request.lenient != null) { - params.put("lenient", String.valueOf(request.lenient)); - } - if (request.rewrite != null) { - params.put("rewrite", String.valueOf(request.rewrite)); - } - return params; - - }, SimpleEndpoint.emptyMap(), true, ValidateQueryResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ValidateQueryResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ValidateQueryResponse.java deleted file mode 100644 index b269fc8ad..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ValidateQueryResponse.java +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ShardStatistics; -import co.elastic.clients.elasticsearch.indices.validate_query.IndicesValidationExplanation; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.validate_query.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ValidateQueryResponse implements JsonpSerializable { - private final List explanations; - - @Nullable - private final ShardStatistics shards; - - private final boolean valid; - - @Nullable - private final String error; - - // --------------------------------------------------------------------------------------------- - - private ValidateQueryResponse(Builder builder) { - - this.explanations = ApiTypeHelper.unmodifiable(builder.explanations); - this.shards = builder.shards; - this.valid = ApiTypeHelper.requireNonNull(builder.valid, this, "valid"); - this.error = builder.error; - - } - - public static ValidateQueryResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code explanations} - */ - public final List explanations() { - return this.explanations; - } - - /** - * API name: {@code _shards} - */ - @Nullable - public final ShardStatistics shards() { - return this.shards; - } - - /** - * Required - API name: {@code valid} - */ - public final boolean valid() { - return this.valid; - } - - /** - * API name: {@code error} - */ - @Nullable - public final String error() { - return this.error; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.explanations)) { - generator.writeKey("explanations"); - generator.writeStartArray(); - for (IndicesValidationExplanation item0 : this.explanations) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.shards != null) { - generator.writeKey("_shards"); - this.shards.serialize(generator, mapper); - - } - generator.writeKey("valid"); - generator.write(this.valid); - - if (this.error != null) { - generator.writeKey("error"); - generator.write(this.error); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ValidateQueryResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private List explanations; - - @Nullable - private ShardStatistics shards; - - private Boolean valid; - - @Nullable - private String error; - - /** - * API name: {@code explanations} - *

- * Adds all elements of list to explanations. - */ - public final Builder explanations(List list) { - this.explanations = _listAddAll(this.explanations, list); - return this; - } - - /** - * API name: {@code explanations} - *

- * Adds one or more values to explanations. - */ - public final Builder explanations(IndicesValidationExplanation value, IndicesValidationExplanation... values) { - this.explanations = _listAdd(this.explanations, value, values); - return this; - } - - /** - * API name: {@code explanations} - *

- * Adds a value to explanations using a builder lambda. - */ - public final Builder explanations( - Function> fn) { - return explanations(fn.apply(new IndicesValidationExplanation.Builder()).build()); - } - - /** - * API name: {@code _shards} - */ - public final Builder shards(@Nullable ShardStatistics value) { - this.shards = value; - return this; - } - - /** - * API name: {@code _shards} - */ - public final Builder shards(Function> fn) { - return this.shards(fn.apply(new ShardStatistics.Builder()).build()); - } - - /** - * Required - API name: {@code valid} - */ - public final Builder valid(boolean value) { - this.valid = value; - return this; - } - - /** - * API name: {@code error} - */ - public final Builder error(@Nullable String value) { - this.error = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ValidateQueryResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ValidateQueryResponse build() { - _checkSingleUse(); - - return new ValidateQueryResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ValidateQueryResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ValidateQueryResponse::setupValidateQueryResponseDeserializer); - - protected static void setupValidateQueryResponseDeserializer(ObjectDeserializer op) { - - op.add(Builder::explanations, JsonpDeserializer.arrayDeserializer(IndicesValidationExplanation._DESERIALIZER), - "explanations"); - op.add(Builder::shards, ShardStatistics._DESERIALIZER, "_shards"); - op.add(Builder::valid, JsonpDeserializer.booleanDeserializer(), "valid"); - op.add(Builder::error, JsonpDeserializer.stringDeserializer(), "error"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/add_block/IndicesBlockOptions.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/add_block/IndicesBlockOptions.java deleted file mode 100644 index 7c646190d..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/add_block/IndicesBlockOptions.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.add_block; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum IndicesBlockOptions implements JsonEnum { - Metadata("metadata"), - - Read("read"), - - ReadOnly("read_only"), - - Write("write"), - - ; - - private final String jsonValue; - - IndicesBlockOptions(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - IndicesBlockOptions.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/add_block/IndicesBlockStatus.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/add_block/IndicesBlockStatus.java deleted file mode 100644 index cd9d033cd..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/add_block/IndicesBlockStatus.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.add_block; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.add_block.IndicesBlockStatus - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndicesBlockStatus implements JsonpSerializable { - private final String name; - - private final boolean blocked; - - // --------------------------------------------------------------------------------------------- - - private IndicesBlockStatus(Builder builder) { - - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.blocked = ApiTypeHelper.requireNonNull(builder.blocked, this, "blocked"); - - } - - public static IndicesBlockStatus of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Required - API name: {@code blocked} - */ - public final boolean blocked() { - return this.blocked; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("name"); - generator.write(this.name); - - generator.writeKey("blocked"); - generator.write(this.blocked); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndicesBlockStatus}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private String name; - - private Boolean blocked; - - /** - * Required - API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Required - API name: {@code blocked} - */ - public final Builder blocked(boolean value) { - this.blocked = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndicesBlockStatus}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndicesBlockStatus build() { - _checkSingleUse(); - - return new IndicesBlockStatus(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndicesBlockStatus} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndicesBlockStatus::setupIndicesBlockStatusDeserializer); - - protected static void setupIndicesBlockStatusDeserializer(ObjectDeserializer op) { - - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - op.add(Builder::blocked, JsonpDeserializer.booleanDeserializer(), "blocked"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzeDetail.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzeDetail.java deleted file mode 100644 index 00ba2a66c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzeDetail.java +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.analyze; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.analyze.AnalyzeDetail - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class AnalyzeDetail implements JsonpSerializable { - @Nullable - private final AnalyzerDetail analyzer; - - private final List charfilters; - - private final boolean customAnalyzer; - - private final List tokenfilters; - - @Nullable - private final TokenDetail tokenizer; - - // --------------------------------------------------------------------------------------------- - - private AnalyzeDetail(Builder builder) { - - this.analyzer = builder.analyzer; - this.charfilters = ApiTypeHelper.unmodifiable(builder.charfilters); - this.customAnalyzer = ApiTypeHelper.requireNonNull(builder.customAnalyzer, this, "customAnalyzer"); - this.tokenfilters = ApiTypeHelper.unmodifiable(builder.tokenfilters); - this.tokenizer = builder.tokenizer; - - } - - public static AnalyzeDetail of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code analyzer} - */ - @Nullable - public final AnalyzerDetail analyzer() { - return this.analyzer; - } - - /** - * API name: {@code charfilters} - */ - public final List charfilters() { - return this.charfilters; - } - - /** - * Required - API name: {@code custom_analyzer} - */ - public final boolean customAnalyzer() { - return this.customAnalyzer; - } - - /** - * API name: {@code tokenfilters} - */ - public final List tokenfilters() { - return this.tokenfilters; - } - - /** - * API name: {@code tokenizer} - */ - @Nullable - public final TokenDetail tokenizer() { - return this.tokenizer; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.analyzer != null) { - generator.writeKey("analyzer"); - this.analyzer.serialize(generator, mapper); - - } - if (ApiTypeHelper.isDefined(this.charfilters)) { - generator.writeKey("charfilters"); - generator.writeStartArray(); - for (CharFilterDetail item0 : this.charfilters) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - generator.writeKey("custom_analyzer"); - generator.write(this.customAnalyzer); - - if (ApiTypeHelper.isDefined(this.tokenfilters)) { - generator.writeKey("tokenfilters"); - generator.writeStartArray(); - for (TokenDetail item0 : this.tokenfilters) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.tokenizer != null) { - generator.writeKey("tokenizer"); - this.tokenizer.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link AnalyzeDetail}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private AnalyzerDetail analyzer; - - @Nullable - private List charfilters; - - private Boolean customAnalyzer; - - @Nullable - private List tokenfilters; - - @Nullable - private TokenDetail tokenizer; - - /** - * API name: {@code analyzer} - */ - public final Builder analyzer(@Nullable AnalyzerDetail value) { - this.analyzer = value; - return this; - } - - /** - * API name: {@code analyzer} - */ - public final Builder analyzer(Function> fn) { - return this.analyzer(fn.apply(new AnalyzerDetail.Builder()).build()); - } - - /** - * API name: {@code charfilters} - *

- * Adds all elements of list to charfilters. - */ - public final Builder charfilters(List list) { - this.charfilters = _listAddAll(this.charfilters, list); - return this; - } - - /** - * API name: {@code charfilters} - *

- * Adds one or more values to charfilters. - */ - public final Builder charfilters(CharFilterDetail value, CharFilterDetail... values) { - this.charfilters = _listAdd(this.charfilters, value, values); - return this; - } - - /** - * API name: {@code charfilters} - *

- * Adds a value to charfilters using a builder lambda. - */ - public final Builder charfilters(Function> fn) { - return charfilters(fn.apply(new CharFilterDetail.Builder()).build()); - } - - /** - * Required - API name: {@code custom_analyzer} - */ - public final Builder customAnalyzer(boolean value) { - this.customAnalyzer = value; - return this; - } - - /** - * API name: {@code tokenfilters} - *

- * Adds all elements of list to tokenfilters. - */ - public final Builder tokenfilters(List list) { - this.tokenfilters = _listAddAll(this.tokenfilters, list); - return this; - } - - /** - * API name: {@code tokenfilters} - *

- * Adds one or more values to tokenfilters. - */ - public final Builder tokenfilters(TokenDetail value, TokenDetail... values) { - this.tokenfilters = _listAdd(this.tokenfilters, value, values); - return this; - } - - /** - * API name: {@code tokenfilters} - *

- * Adds a value to tokenfilters using a builder lambda. - */ - public final Builder tokenfilters(Function> fn) { - return tokenfilters(fn.apply(new TokenDetail.Builder()).build()); - } - - /** - * API name: {@code tokenizer} - */ - public final Builder tokenizer(@Nullable TokenDetail value) { - this.tokenizer = value; - return this; - } - - /** - * API name: {@code tokenizer} - */ - public final Builder tokenizer(Function> fn) { - return this.tokenizer(fn.apply(new TokenDetail.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link AnalyzeDetail}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public AnalyzeDetail build() { - _checkSingleUse(); - - return new AnalyzeDetail(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link AnalyzeDetail} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - AnalyzeDetail::setupAnalyzeDetailDeserializer); - - protected static void setupAnalyzeDetailDeserializer(ObjectDeserializer op) { - - op.add(Builder::analyzer, AnalyzerDetail._DESERIALIZER, "analyzer"); - op.add(Builder::charfilters, JsonpDeserializer.arrayDeserializer(CharFilterDetail._DESERIALIZER), - "charfilters"); - op.add(Builder::customAnalyzer, JsonpDeserializer.booleanDeserializer(), "custom_analyzer"); - op.add(Builder::tokenfilters, JsonpDeserializer.arrayDeserializer(TokenDetail._DESERIALIZER), "tokenfilters"); - op.add(Builder::tokenizer, TokenDetail._DESERIALIZER, "tokenizer"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzeToken.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzeToken.java deleted file mode 100644 index e2630d9e9..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzeToken.java +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.analyze; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.analyze.AnalyzeToken - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class AnalyzeToken implements JsonpSerializable { - private final long endOffset; - - private final long position; - - @Nullable - private final Long positionlength; - - private final long startOffset; - - private final String token; - - private final String type; - - // --------------------------------------------------------------------------------------------- - - private AnalyzeToken(Builder builder) { - - this.endOffset = ApiTypeHelper.requireNonNull(builder.endOffset, this, "endOffset"); - this.position = ApiTypeHelper.requireNonNull(builder.position, this, "position"); - this.positionlength = builder.positionlength; - this.startOffset = ApiTypeHelper.requireNonNull(builder.startOffset, this, "startOffset"); - this.token = ApiTypeHelper.requireNonNull(builder.token, this, "token"); - this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); - - } - - public static AnalyzeToken of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code end_offset} - */ - public final long endOffset() { - return this.endOffset; - } - - /** - * Required - API name: {@code position} - */ - public final long position() { - return this.position; - } - - /** - * API name: {@code positionLength} - */ - @Nullable - public final Long positionlength() { - return this.positionlength; - } - - /** - * Required - API name: {@code start_offset} - */ - public final long startOffset() { - return this.startOffset; - } - - /** - * Required - API name: {@code token} - */ - public final String token() { - return this.token; - } - - /** - * Required - API name: {@code type} - */ - public final String type() { - return this.type; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("end_offset"); - generator.write(this.endOffset); - - generator.writeKey("position"); - generator.write(this.position); - - if (this.positionlength != null) { - generator.writeKey("positionLength"); - generator.write(this.positionlength); - - } - generator.writeKey("start_offset"); - generator.write(this.startOffset); - - generator.writeKey("token"); - generator.write(this.token); - - generator.writeKey("type"); - generator.write(this.type); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link AnalyzeToken}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Long endOffset; - - private Long position; - - @Nullable - private Long positionlength; - - private Long startOffset; - - private String token; - - private String type; - - /** - * Required - API name: {@code end_offset} - */ - public final Builder endOffset(long value) { - this.endOffset = value; - return this; - } - - /** - * Required - API name: {@code position} - */ - public final Builder position(long value) { - this.position = value; - return this; - } - - /** - * API name: {@code positionLength} - */ - public final Builder positionlength(@Nullable Long value) { - this.positionlength = value; - return this; - } - - /** - * Required - API name: {@code start_offset} - */ - public final Builder startOffset(long value) { - this.startOffset = value; - return this; - } - - /** - * Required - API name: {@code token} - */ - public final Builder token(String value) { - this.token = value; - return this; - } - - /** - * Required - API name: {@code type} - */ - public final Builder type(String value) { - this.type = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link AnalyzeToken}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public AnalyzeToken build() { - _checkSingleUse(); - - return new AnalyzeToken(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link AnalyzeToken} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - AnalyzeToken::setupAnalyzeTokenDeserializer); - - protected static void setupAnalyzeTokenDeserializer(ObjectDeserializer op) { - - op.add(Builder::endOffset, JsonpDeserializer.longDeserializer(), "end_offset"); - op.add(Builder::position, JsonpDeserializer.longDeserializer(), "position"); - op.add(Builder::positionlength, JsonpDeserializer.longDeserializer(), "positionLength"); - op.add(Builder::startOffset, JsonpDeserializer.longDeserializer(), "start_offset"); - op.add(Builder::token, JsonpDeserializer.stringDeserializer(), "token"); - op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzerDetail.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzerDetail.java deleted file mode 100644 index 3037ce531..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzerDetail.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.analyze; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.analyze.AnalyzerDetail - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class AnalyzerDetail implements JsonpSerializable { - private final String name; - - private final List tokens; - - // --------------------------------------------------------------------------------------------- - - private AnalyzerDetail(Builder builder) { - - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.tokens = ApiTypeHelper.unmodifiableRequired(builder.tokens, this, "tokens"); - - } - - public static AnalyzerDetail of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Required - API name: {@code tokens} - */ - public final List tokens() { - return this.tokens; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("name"); - generator.write(this.name); - - if (ApiTypeHelper.isDefined(this.tokens)) { - generator.writeKey("tokens"); - generator.writeStartArray(); - for (ExplainAnalyzeToken item0 : this.tokens) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link AnalyzerDetail}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String name; - - private List tokens; - - /** - * Required - API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Required - API name: {@code tokens} - *

- * Adds all elements of list to tokens. - */ - public final Builder tokens(List list) { - this.tokens = _listAddAll(this.tokens, list); - return this; - } - - /** - * Required - API name: {@code tokens} - *

- * Adds one or more values to tokens. - */ - public final Builder tokens(ExplainAnalyzeToken value, ExplainAnalyzeToken... values) { - this.tokens = _listAdd(this.tokens, value, values); - return this; - } - - /** - * Required - API name: {@code tokens} - *

- * Adds a value to tokens using a builder lambda. - */ - public final Builder tokens(Function> fn) { - return tokens(fn.apply(new ExplainAnalyzeToken.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link AnalyzerDetail}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public AnalyzerDetail build() { - _checkSingleUse(); - - return new AnalyzerDetail(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link AnalyzerDetail} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - AnalyzerDetail::setupAnalyzerDetailDeserializer); - - protected static void setupAnalyzerDetailDeserializer(ObjectDeserializer op) { - - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - op.add(Builder::tokens, JsonpDeserializer.arrayDeserializer(ExplainAnalyzeToken._DESERIALIZER), "tokens"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/CharFilterDetail.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/CharFilterDetail.java deleted file mode 100644 index 4abd71957..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/CharFilterDetail.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.analyze; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.analyze.CharFilterDetail - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class CharFilterDetail implements JsonpSerializable { - private final List filteredText; - - private final String name; - - // --------------------------------------------------------------------------------------------- - - private CharFilterDetail(Builder builder) { - - this.filteredText = ApiTypeHelper.unmodifiableRequired(builder.filteredText, this, "filteredText"); - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - - } - - public static CharFilterDetail of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code filtered_text} - */ - public final List filteredText() { - return this.filteredText; - } - - /** - * Required - API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.filteredText)) { - generator.writeKey("filtered_text"); - generator.writeStartArray(); - for (String item0 : this.filteredText) { - generator.write(item0); - - } - generator.writeEnd(); - - } - generator.writeKey("name"); - generator.write(this.name); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link CharFilterDetail}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private List filteredText; - - private String name; - - /** - * Required - API name: {@code filtered_text} - *

- * Adds all elements of list to filteredText. - */ - public final Builder filteredText(List list) { - this.filteredText = _listAddAll(this.filteredText, list); - return this; - } - - /** - * Required - API name: {@code filtered_text} - *

- * Adds one or more values to filteredText. - */ - public final Builder filteredText(String value, String... values) { - this.filteredText = _listAdd(this.filteredText, value, values); - return this; - } - - /** - * Required - API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link CharFilterDetail}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public CharFilterDetail build() { - _checkSingleUse(); - - return new CharFilterDetail(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link CharFilterDetail} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - CharFilterDetail::setupCharFilterDetailDeserializer); - - protected static void setupCharFilterDetailDeserializer(ObjectDeserializer op) { - - op.add(Builder::filteredText, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "filtered_text"); - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/ExplainAnalyzeToken.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/ExplainAnalyzeToken.java deleted file mode 100644 index 241ceebf2..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/ExplainAnalyzeToken.java +++ /dev/null @@ -1,402 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.analyze; - -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Long; -import java.lang.String; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.analyze.ExplainAnalyzeToken - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ExplainAnalyzeToken implements JsonpSerializable { - private final Map attributes; - - private final String bytes; - - private final long endOffset; - - @Nullable - private final Boolean keyword; - - private final long position; - - private final long positionlength; - - private final long startOffset; - - private final long termfrequency; - - private final String token; - - private final String type; - - // --------------------------------------------------------------------------------------------- - - private ExplainAnalyzeToken(Builder builder) { - - this.attributes = ApiTypeHelper.unmodifiable(builder.attributes); - - this.bytes = ApiTypeHelper.requireNonNull(builder.bytes, this, "bytes"); - this.endOffset = ApiTypeHelper.requireNonNull(builder.endOffset, this, "endOffset"); - this.keyword = builder.keyword; - this.position = ApiTypeHelper.requireNonNull(builder.position, this, "position"); - this.positionlength = ApiTypeHelper.requireNonNull(builder.positionlength, this, "positionlength"); - this.startOffset = ApiTypeHelper.requireNonNull(builder.startOffset, this, "startOffset"); - this.termfrequency = ApiTypeHelper.requireNonNull(builder.termfrequency, this, "termfrequency"); - this.token = ApiTypeHelper.requireNonNull(builder.token, this, "token"); - this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); - - } - - public static ExplainAnalyzeToken of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Additional tokenizer-specific attributes - */ - public final Map attributes() { - return this.attributes; - } - - /** - * Required - API name: {@code bytes} - */ - public final String bytes() { - return this.bytes; - } - - /** - * Required - API name: {@code end_offset} - */ - public final long endOffset() { - return this.endOffset; - } - - /** - * API name: {@code keyword} - */ - @Nullable - public final Boolean keyword() { - return this.keyword; - } - - /** - * Required - API name: {@code position} - */ - public final long position() { - return this.position; - } - - /** - * Required - API name: {@code positionLength} - */ - public final long positionlength() { - return this.positionlength; - } - - /** - * Required - API name: {@code start_offset} - */ - public final long startOffset() { - return this.startOffset; - } - - /** - * Required - API name: {@code termFrequency} - */ - public final long termfrequency() { - return this.termfrequency; - } - - /** - * Required - API name: {@code token} - */ - public final String token() { - return this.token; - } - - /** - * Required - API name: {@code type} - */ - public final String type() { - return this.type; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - for (Map.Entry item0 : this.attributes.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - - generator.writeKey("bytes"); - generator.write(this.bytes); - - generator.writeKey("end_offset"); - generator.write(this.endOffset); - - if (this.keyword != null) { - generator.writeKey("keyword"); - generator.write(this.keyword); - - } - generator.writeKey("position"); - generator.write(this.position); - - generator.writeKey("positionLength"); - generator.write(this.positionlength); - - generator.writeKey("start_offset"); - generator.write(this.startOffset); - - generator.writeKey("termFrequency"); - generator.write(this.termfrequency); - - generator.writeKey("token"); - generator.write(this.token); - - generator.writeKey("type"); - generator.write(this.type); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ExplainAnalyzeToken}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Map attributes = new HashMap<>(); - - /** - * Additional tokenizer-specific attributes - *

- * Adds all entries of map to attributes. - */ - public final Builder attributes(Map map) { - this.attributes = _mapPutAll(this.attributes, map); - return this; - } - - /** - * Additional tokenizer-specific attributes - *

- * Adds an entry to attributes. - */ - public final Builder attributes(String key, JsonData value) { - this.attributes = _mapPut(this.attributes, key, value); - return this; - } - - private String bytes; - - private Long endOffset; - - @Nullable - private Boolean keyword; - - private Long position; - - private Long positionlength; - - private Long startOffset; - - private Long termfrequency; - - private String token; - - private String type; - - /** - * Required - API name: {@code bytes} - */ - public final Builder bytes(String value) { - this.bytes = value; - return this; - } - - /** - * Required - API name: {@code end_offset} - */ - public final Builder endOffset(long value) { - this.endOffset = value; - return this; - } - - /** - * API name: {@code keyword} - */ - public final Builder keyword(@Nullable Boolean value) { - this.keyword = value; - return this; - } - - /** - * Required - API name: {@code position} - */ - public final Builder position(long value) { - this.position = value; - return this; - } - - /** - * Required - API name: {@code positionLength} - */ - public final Builder positionlength(long value) { - this.positionlength = value; - return this; - } - - /** - * Required - API name: {@code start_offset} - */ - public final Builder startOffset(long value) { - this.startOffset = value; - return this; - } - - /** - * Required - API name: {@code termFrequency} - */ - public final Builder termfrequency(long value) { - this.termfrequency = value; - return this; - } - - /** - * Required - API name: {@code token} - */ - public final Builder token(String value) { - this.token = value; - return this; - } - - /** - * Required - API name: {@code type} - */ - public final Builder type(String value) { - this.type = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ExplainAnalyzeToken}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ExplainAnalyzeToken build() { - _checkSingleUse(); - - return new ExplainAnalyzeToken(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ExplainAnalyzeToken} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ExplainAnalyzeToken::setupExplainAnalyzeTokenDeserializer); - - protected static void setupExplainAnalyzeTokenDeserializer(ObjectDeserializer op) { - - op.add(Builder::bytes, JsonpDeserializer.stringDeserializer(), "bytes"); - op.add(Builder::endOffset, JsonpDeserializer.longDeserializer(), "end_offset"); - op.add(Builder::keyword, JsonpDeserializer.booleanDeserializer(), "keyword"); - op.add(Builder::position, JsonpDeserializer.longDeserializer(), "position"); - op.add(Builder::positionlength, JsonpDeserializer.longDeserializer(), "positionLength"); - op.add(Builder::startOffset, JsonpDeserializer.longDeserializer(), "start_offset"); - op.add(Builder::termfrequency, JsonpDeserializer.longDeserializer(), "termFrequency"); - op.add(Builder::token, JsonpDeserializer.stringDeserializer(), "token"); - op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); - - op.setUnknownFieldHandler((builder, name, parser, mapper) -> { - builder.attributes(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); - }); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/TokenDetail.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/TokenDetail.java deleted file mode 100644 index c8da22be3..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/TokenDetail.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.analyze; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.analyze.TokenDetail - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class TokenDetail implements JsonpSerializable { - private final String name; - - private final List tokens; - - // --------------------------------------------------------------------------------------------- - - private TokenDetail(Builder builder) { - - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.tokens = ApiTypeHelper.unmodifiableRequired(builder.tokens, this, "tokens"); - - } - - public static TokenDetail of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Required - API name: {@code tokens} - */ - public final List tokens() { - return this.tokens; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("name"); - generator.write(this.name); - - if (ApiTypeHelper.isDefined(this.tokens)) { - generator.writeKey("tokens"); - generator.writeStartArray(); - for (ExplainAnalyzeToken item0 : this.tokens) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link TokenDetail}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String name; - - private List tokens; - - /** - * Required - API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Required - API name: {@code tokens} - *

- * Adds all elements of list to tokens. - */ - public final Builder tokens(List list) { - this.tokens = _listAddAll(this.tokens, list); - return this; - } - - /** - * Required - API name: {@code tokens} - *

- * Adds one or more values to tokens. - */ - public final Builder tokens(ExplainAnalyzeToken value, ExplainAnalyzeToken... values) { - this.tokens = _listAdd(this.tokens, value, values); - return this; - } - - /** - * Required - API name: {@code tokens} - *

- * Adds a value to tokens using a builder lambda. - */ - public final Builder tokens(Function> fn) { - return tokens(fn.apply(new ExplainAnalyzeToken.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link TokenDetail}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public TokenDetail build() { - _checkSingleUse(); - - return new TokenDetail(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link TokenDetail} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - TokenDetail::setupTokenDetailDeserializer); - - protected static void setupTokenDetailDeserializer(ObjectDeserializer op) { - - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - op.add(Builder::tokens, JsonpDeserializer.arrayDeserializer(ExplainAnalyzeToken._DESERIALIZER), "tokens"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/data_streams_stats/DataStreamsStatsItem.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/data_streams_stats/DataStreamsStatsItem.java deleted file mode 100644 index 1545c0030..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/data_streams_stats/DataStreamsStatsItem.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.data_streams_stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.data_streams_stats.DataStreamsStatsItem - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DataStreamsStatsItem implements JsonpSerializable { - private final int backingIndices; - - private final String dataStream; - - private final long maximumTimestamp; - - @Nullable - private final String storeSize; - - private final long storeSizeBytes; - - // --------------------------------------------------------------------------------------------- - - private DataStreamsStatsItem(Builder builder) { - - this.backingIndices = ApiTypeHelper.requireNonNull(builder.backingIndices, this, "backingIndices"); - this.dataStream = ApiTypeHelper.requireNonNull(builder.dataStream, this, "dataStream"); - this.maximumTimestamp = ApiTypeHelper.requireNonNull(builder.maximumTimestamp, this, "maximumTimestamp"); - this.storeSize = builder.storeSize; - this.storeSizeBytes = ApiTypeHelper.requireNonNull(builder.storeSizeBytes, this, "storeSizeBytes"); - - } - - public static DataStreamsStatsItem of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Current number of backing indices for the data stream. - *

- * API name: {@code backing_indices} - */ - public final int backingIndices() { - return this.backingIndices; - } - - /** - * Required - Name of the data stream. - *

- * API name: {@code data_stream} - */ - public final String dataStream() { - return this.dataStream; - } - - /** - * Required - The data stream’s highest @timestamp value, converted - * to milliseconds since the Unix epoch. NOTE: This timestamp is provided as a - * best effort. The data stream may contain @timestamp values - * higher than this if one or more of the following conditions are met: The - * stream contains closed backing indices; Backing indices with a lower - * generation contain higher @timestamp values. - *

- * API name: {@code maximum_timestamp} - */ - public final long maximumTimestamp() { - return this.maximumTimestamp; - } - - /** - * Total size of all shards for the data stream’s backing indices. This - * parameter is only returned if the human query parameter is - * true. - *

- * API name: {@code store_size} - */ - @Nullable - public final String storeSize() { - return this.storeSize; - } - - /** - * Required - Total size, in bytes, of all shards for the data stream’s backing - * indices. - *

- * API name: {@code store_size_bytes} - */ - public final long storeSizeBytes() { - return this.storeSizeBytes; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("backing_indices"); - generator.write(this.backingIndices); - - generator.writeKey("data_stream"); - generator.write(this.dataStream); - - generator.writeKey("maximum_timestamp"); - generator.write(this.maximumTimestamp); - - if (this.storeSize != null) { - generator.writeKey("store_size"); - generator.write(this.storeSize); - - } - generator.writeKey("store_size_bytes"); - generator.write(this.storeSizeBytes); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DataStreamsStatsItem}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private Integer backingIndices; - - private String dataStream; - - private Long maximumTimestamp; - - @Nullable - private String storeSize; - - private Long storeSizeBytes; - - /** - * Required - Current number of backing indices for the data stream. - *

- * API name: {@code backing_indices} - */ - public final Builder backingIndices(int value) { - this.backingIndices = value; - return this; - } - - /** - * Required - Name of the data stream. - *

- * API name: {@code data_stream} - */ - public final Builder dataStream(String value) { - this.dataStream = value; - return this; - } - - /** - * Required - The data stream’s highest @timestamp value, converted - * to milliseconds since the Unix epoch. NOTE: This timestamp is provided as a - * best effort. The data stream may contain @timestamp values - * higher than this if one or more of the following conditions are met: The - * stream contains closed backing indices; Backing indices with a lower - * generation contain higher @timestamp values. - *

- * API name: {@code maximum_timestamp} - */ - public final Builder maximumTimestamp(long value) { - this.maximumTimestamp = value; - return this; - } - - /** - * Total size of all shards for the data stream’s backing indices. This - * parameter is only returned if the human query parameter is - * true. - *

- * API name: {@code store_size} - */ - public final Builder storeSize(@Nullable String value) { - this.storeSize = value; - return this; - } - - /** - * Required - Total size, in bytes, of all shards for the data stream’s backing - * indices. - *

- * API name: {@code store_size_bytes} - */ - public final Builder storeSizeBytes(long value) { - this.storeSizeBytes = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DataStreamsStatsItem}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DataStreamsStatsItem build() { - _checkSingleUse(); - - return new DataStreamsStatsItem(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DataStreamsStatsItem} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DataStreamsStatsItem::setupDataStreamsStatsItemDeserializer); - - protected static void setupDataStreamsStatsItemDeserializer(ObjectDeserializer op) { - - op.add(Builder::backingIndices, JsonpDeserializer.integerDeserializer(), "backing_indices"); - op.add(Builder::dataStream, JsonpDeserializer.stringDeserializer(), "data_stream"); - op.add(Builder::maximumTimestamp, JsonpDeserializer.longDeserializer(), "maximum_timestamp"); - op.add(Builder::storeSize, JsonpDeserializer.stringDeserializer(), "store_size"); - op.add(Builder::storeSizeBytes, JsonpDeserializer.longDeserializer(), "store_size_bytes"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/explain_data_lifecycle/DataStreamLifecycleExplain.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/explain_data_lifecycle/DataStreamLifecycleExplain.java deleted file mode 100644 index 145d2197f..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/explain_data_lifecycle/DataStreamLifecycleExplain.java +++ /dev/null @@ -1,418 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.explain_data_lifecycle; - -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.elasticsearch.indices.DataStreamLifecycleWithRollover; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.explain_data_lifecycle.DataStreamLifecycleExplain - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DataStreamLifecycleExplain implements JsonpSerializable { - private final String index; - - private final boolean managedByLifecycle; - - @Nullable - private final Long indexCreationDateMillis; - - @Nullable - private final Time timeSinceIndexCreation; - - @Nullable - private final Long rolloverDateMillis; - - @Nullable - private final Time timeSinceRollover; - - @Nullable - private final DataStreamLifecycleWithRollover lifecycle; - - @Nullable - private final Time generationTime; - - @Nullable - private final String error; - - // --------------------------------------------------------------------------------------------- - - private DataStreamLifecycleExplain(Builder builder) { - - this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); - this.managedByLifecycle = ApiTypeHelper.requireNonNull(builder.managedByLifecycle, this, "managedByLifecycle"); - this.indexCreationDateMillis = builder.indexCreationDateMillis; - this.timeSinceIndexCreation = builder.timeSinceIndexCreation; - this.rolloverDateMillis = builder.rolloverDateMillis; - this.timeSinceRollover = builder.timeSinceRollover; - this.lifecycle = builder.lifecycle; - this.generationTime = builder.generationTime; - this.error = builder.error; - - } - - public static DataStreamLifecycleExplain of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code index} - */ - public final String index() { - return this.index; - } - - /** - * Required - API name: {@code managed_by_lifecycle} - */ - public final boolean managedByLifecycle() { - return this.managedByLifecycle; - } - - /** - * API name: {@code index_creation_date_millis} - */ - @Nullable - public final Long indexCreationDateMillis() { - return this.indexCreationDateMillis; - } - - /** - * API name: {@code time_since_index_creation} - */ - @Nullable - public final Time timeSinceIndexCreation() { - return this.timeSinceIndexCreation; - } - - /** - * API name: {@code rollover_date_millis} - */ - @Nullable - public final Long rolloverDateMillis() { - return this.rolloverDateMillis; - } - - /** - * API name: {@code time_since_rollover} - */ - @Nullable - public final Time timeSinceRollover() { - return this.timeSinceRollover; - } - - /** - * API name: {@code lifecycle} - */ - @Nullable - public final DataStreamLifecycleWithRollover lifecycle() { - return this.lifecycle; - } - - /** - * API name: {@code generation_time} - */ - @Nullable - public final Time generationTime() { - return this.generationTime; - } - - /** - * API name: {@code error} - */ - @Nullable - public final String error() { - return this.error; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("index"); - generator.write(this.index); - - generator.writeKey("managed_by_lifecycle"); - generator.write(this.managedByLifecycle); - - if (this.indexCreationDateMillis != null) { - generator.writeKey("index_creation_date_millis"); - generator.write(this.indexCreationDateMillis); - - } - if (this.timeSinceIndexCreation != null) { - generator.writeKey("time_since_index_creation"); - this.timeSinceIndexCreation.serialize(generator, mapper); - - } - if (this.rolloverDateMillis != null) { - generator.writeKey("rollover_date_millis"); - generator.write(this.rolloverDateMillis); - - } - if (this.timeSinceRollover != null) { - generator.writeKey("time_since_rollover"); - this.timeSinceRollover.serialize(generator, mapper); - - } - if (this.lifecycle != null) { - generator.writeKey("lifecycle"); - this.lifecycle.serialize(generator, mapper); - - } - if (this.generationTime != null) { - generator.writeKey("generation_time"); - this.generationTime.serialize(generator, mapper); - - } - if (this.error != null) { - generator.writeKey("error"); - generator.write(this.error); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DataStreamLifecycleExplain}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private String index; - - private Boolean managedByLifecycle; - - @Nullable - private Long indexCreationDateMillis; - - @Nullable - private Time timeSinceIndexCreation; - - @Nullable - private Long rolloverDateMillis; - - @Nullable - private Time timeSinceRollover; - - @Nullable - private DataStreamLifecycleWithRollover lifecycle; - - @Nullable - private Time generationTime; - - @Nullable - private String error; - - /** - * Required - API name: {@code index} - */ - public final Builder index(String value) { - this.index = value; - return this; - } - - /** - * Required - API name: {@code managed_by_lifecycle} - */ - public final Builder managedByLifecycle(boolean value) { - this.managedByLifecycle = value; - return this; - } - - /** - * API name: {@code index_creation_date_millis} - */ - public final Builder indexCreationDateMillis(@Nullable Long value) { - this.indexCreationDateMillis = value; - return this; - } - - /** - * API name: {@code time_since_index_creation} - */ - public final Builder timeSinceIndexCreation(@Nullable Time value) { - this.timeSinceIndexCreation = value; - return this; - } - - /** - * API name: {@code time_since_index_creation} - */ - public final Builder timeSinceIndexCreation(Function> fn) { - return this.timeSinceIndexCreation(fn.apply(new Time.Builder()).build()); - } - - /** - * API name: {@code rollover_date_millis} - */ - public final Builder rolloverDateMillis(@Nullable Long value) { - this.rolloverDateMillis = value; - return this; - } - - /** - * API name: {@code time_since_rollover} - */ - public final Builder timeSinceRollover(@Nullable Time value) { - this.timeSinceRollover = value; - return this; - } - - /** - * API name: {@code time_since_rollover} - */ - public final Builder timeSinceRollover(Function> fn) { - return this.timeSinceRollover(fn.apply(new Time.Builder()).build()); - } - - /** - * API name: {@code lifecycle} - */ - public final Builder lifecycle(@Nullable DataStreamLifecycleWithRollover value) { - this.lifecycle = value; - return this; - } - - /** - * API name: {@code lifecycle} - */ - public final Builder lifecycle( - Function> fn) { - return this.lifecycle(fn.apply(new DataStreamLifecycleWithRollover.Builder()).build()); - } - - /** - * API name: {@code generation_time} - */ - public final Builder generationTime(@Nullable Time value) { - this.generationTime = value; - return this; - } - - /** - * API name: {@code generation_time} - */ - public final Builder generationTime(Function> fn) { - return this.generationTime(fn.apply(new Time.Builder()).build()); - } - - /** - * API name: {@code error} - */ - public final Builder error(@Nullable String value) { - this.error = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DataStreamLifecycleExplain}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DataStreamLifecycleExplain build() { - _checkSingleUse(); - - return new DataStreamLifecycleExplain(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DataStreamLifecycleExplain} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DataStreamLifecycleExplain::setupDataStreamLifecycleExplainDeserializer); - - protected static void setupDataStreamLifecycleExplainDeserializer( - ObjectDeserializer op) { - - op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); - op.add(Builder::managedByLifecycle, JsonpDeserializer.booleanDeserializer(), "managed_by_lifecycle"); - op.add(Builder::indexCreationDateMillis, JsonpDeserializer.longDeserializer(), "index_creation_date_millis"); - op.add(Builder::timeSinceIndexCreation, Time._DESERIALIZER, "time_since_index_creation"); - op.add(Builder::rolloverDateMillis, JsonpDeserializer.longDeserializer(), "rollover_date_millis"); - op.add(Builder::timeSinceRollover, Time._DESERIALIZER, "time_since_rollover"); - op.add(Builder::lifecycle, DataStreamLifecycleWithRollover._DESERIALIZER, "lifecycle"); - op.add(Builder::generationTime, Time._DESERIALIZER, "generation_time"); - op.add(Builder::error, JsonpDeserializer.stringDeserializer(), "error"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get/Feature.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get/Feature.java deleted file mode 100644 index e89ee66bb..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get/Feature.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.get; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum Feature implements JsonEnum { - Aliases("aliases"), - - Mappings("mappings"), - - Settings("settings"), - - ; - - private final String jsonValue; - - Feature(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(Feature.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_alias/IndexAliases.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_alias/IndexAliases.java deleted file mode 100644 index 23ab2d267..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_alias/IndexAliases.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.get_alias; - -import co.elastic.clients.elasticsearch.indices.AliasDefinition; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.get_alias.IndexAliases - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexAliases implements JsonpSerializable { - private final Map aliases; - - // --------------------------------------------------------------------------------------------- - - private IndexAliases(Builder builder) { - - this.aliases = ApiTypeHelper.unmodifiableRequired(builder.aliases, this, "aliases"); - - } - - public static IndexAliases of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code aliases} - */ - public final Map aliases() { - return this.aliases; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.aliases)) { - generator.writeKey("aliases"); - generator.writeStartObject(); - for (Map.Entry item0 : this.aliases.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexAliases}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Map aliases; - - /** - * Required - API name: {@code aliases} - *

- * Adds all entries of map to aliases. - */ - public final Builder aliases(Map map) { - this.aliases = _mapPutAll(this.aliases, map); - return this; - } - - /** - * Required - API name: {@code aliases} - *

- * Adds an entry to aliases. - */ - public final Builder aliases(String key, AliasDefinition value) { - this.aliases = _mapPut(this.aliases, key, value); - return this; - } - - /** - * Required - API name: {@code aliases} - *

- * Adds an entry to aliases using a builder lambda. - */ - public final Builder aliases(String key, Function> fn) { - return aliases(key, fn.apply(new AliasDefinition.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexAliases}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexAliases build() { - _checkSingleUse(); - - return new IndexAliases(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexAliases} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - IndexAliases::setupIndexAliasesDeserializer); - - protected static void setupIndexAliasesDeserializer(ObjectDeserializer op) { - - op.add(Builder::aliases, JsonpDeserializer.stringMapDeserializer(AliasDefinition._DESERIALIZER), "aliases"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_data_lifecycle/DataStreamWithLifecycle.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_data_lifecycle/DataStreamWithLifecycle.java deleted file mode 100644 index c0f1c5612..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_data_lifecycle/DataStreamWithLifecycle.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.get_data_lifecycle; - -import co.elastic.clients.elasticsearch.indices.DataStreamLifecycle; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.get_data_lifecycle.DataStreamWithLifecycle - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DataStreamWithLifecycle implements JsonpSerializable { - private final String name; - - @Nullable - private final DataStreamLifecycle lifecycle; - - // --------------------------------------------------------------------------------------------- - - private DataStreamWithLifecycle(Builder builder) { - - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.lifecycle = builder.lifecycle; - - } - - public static DataStreamWithLifecycle of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * API name: {@code lifecycle} - */ - @Nullable - public final DataStreamLifecycle lifecycle() { - return this.lifecycle; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("name"); - generator.write(this.name); - - if (this.lifecycle != null) { - generator.writeKey("lifecycle"); - this.lifecycle.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DataStreamWithLifecycle}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private String name; - - @Nullable - private DataStreamLifecycle lifecycle; - - /** - * Required - API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * API name: {@code lifecycle} - */ - public final Builder lifecycle(@Nullable DataStreamLifecycle value) { - this.lifecycle = value; - return this; - } - - /** - * API name: {@code lifecycle} - */ - public final Builder lifecycle(Function> fn) { - return this.lifecycle(fn.apply(new DataStreamLifecycle.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DataStreamWithLifecycle}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DataStreamWithLifecycle build() { - _checkSingleUse(); - - return new DataStreamWithLifecycle(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DataStreamWithLifecycle} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DataStreamWithLifecycle::setupDataStreamWithLifecycleDeserializer); - - protected static void setupDataStreamWithLifecycleDeserializer( - ObjectDeserializer op) { - - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - op.add(Builder::lifecycle, DataStreamLifecycle._DESERIALIZER, "lifecycle"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_index_template/IndexTemplateItem.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_index_template/IndexTemplateItem.java deleted file mode 100644 index 83a4abfd7..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_index_template/IndexTemplateItem.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.get_index_template; - -import co.elastic.clients.elasticsearch.indices.IndexTemplate; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.get_index_template.IndexTemplateItem - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexTemplateItem implements JsonpSerializable { - private final String name; - - private final IndexTemplate indexTemplate; - - // --------------------------------------------------------------------------------------------- - - private IndexTemplateItem(Builder builder) { - - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.indexTemplate = ApiTypeHelper.requireNonNull(builder.indexTemplate, this, "indexTemplate"); - - } - - public static IndexTemplateItem of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Required - API name: {@code index_template} - */ - public final IndexTemplate indexTemplate() { - return this.indexTemplate; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("name"); - generator.write(this.name); - - generator.writeKey("index_template"); - this.indexTemplate.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexTemplateItem}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String name; - - private IndexTemplate indexTemplate; - - /** - * Required - API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Required - API name: {@code index_template} - */ - public final Builder indexTemplate(IndexTemplate value) { - this.indexTemplate = value; - return this; - } - - /** - * Required - API name: {@code index_template} - */ - public final Builder indexTemplate(Function> fn) { - return this.indexTemplate(fn.apply(new IndexTemplate.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexTemplateItem}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexTemplateItem build() { - _checkSingleUse(); - - return new IndexTemplateItem(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexTemplateItem} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndexTemplateItem::setupIndexTemplateItemDeserializer); - - protected static void setupIndexTemplateItemDeserializer(ObjectDeserializer op) { - - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - op.add(Builder::indexTemplate, IndexTemplate._DESERIALIZER, "index_template"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_mapping/IndexMappingRecord.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_mapping/IndexMappingRecord.java deleted file mode 100644 index 5a7ae2e65..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_mapping/IndexMappingRecord.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.get_mapping; - -import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.get_mapping.IndexMappingRecord - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexMappingRecord implements JsonpSerializable { - @Nullable - private final TypeMapping item; - - private final TypeMapping mappings; - - // --------------------------------------------------------------------------------------------- - - private IndexMappingRecord(Builder builder) { - - this.item = builder.item; - this.mappings = ApiTypeHelper.requireNonNull(builder.mappings, this, "mappings"); - - } - - public static IndexMappingRecord of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code item} - */ - @Nullable - public final TypeMapping item() { - return this.item; - } - - /** - * Required - API name: {@code mappings} - */ - public final TypeMapping mappings() { - return this.mappings; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.item != null) { - generator.writeKey("item"); - this.item.serialize(generator, mapper); - - } - generator.writeKey("mappings"); - this.mappings.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexMappingRecord}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private TypeMapping item; - - private TypeMapping mappings; - - /** - * API name: {@code item} - */ - public final Builder item(@Nullable TypeMapping value) { - this.item = value; - return this; - } - - /** - * API name: {@code item} - */ - public final Builder item(Function> fn) { - return this.item(fn.apply(new TypeMapping.Builder()).build()); - } - - /** - * Required - API name: {@code mappings} - */ - public final Builder mappings(TypeMapping value) { - this.mappings = value; - return this; - } - - /** - * Required - API name: {@code mappings} - */ - public final Builder mappings(Function> fn) { - return this.mappings(fn.apply(new TypeMapping.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexMappingRecord}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexMappingRecord build() { - _checkSingleUse(); - - return new IndexMappingRecord(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexMappingRecord} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndexMappingRecord::setupIndexMappingRecordDeserializer); - - protected static void setupIndexMappingRecordDeserializer(ObjectDeserializer op) { - - op.add(Builder::item, TypeMapping._DESERIALIZER, "item"); - op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/Action.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/Action.java deleted file mode 100644 index 6fe324d84..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/Action.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.modify_data_stream; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.TaggedUnion; -import co.elastic.clients.util.TaggedUnionUtils; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Object; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.modify_data_stream.Action - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class Action implements TaggedUnion, JsonpSerializable { - - /** - * {@link Action} variant kinds. - * - * @see API - * specification - */ - - public enum Kind implements JsonEnum { - AddBackingIndex("add_backing_index"), - - RemoveBackingIndex("remove_backing_index"), - - ; - - private final String jsonValue; - - Kind(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - } - - private final Kind _kind; - private final Object _value; - - @Override - public final Kind _kind() { - return _kind; - } - - @Override - public final Object _get() { - return _value; - } - - public Action(ActionVariant value) { - - this._kind = ApiTypeHelper.requireNonNull(value._actionKind(), this, ""); - this._value = ApiTypeHelper.requireNonNull(value, this, ""); - - } - - private Action(Builder builder) { - - this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); - this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); - - } - - public static Action of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Is this variant instance of kind {@code add_backing_index}? - */ - public boolean isAddBackingIndex() { - return _kind == Kind.AddBackingIndex; - } - - /** - * Get the {@code add_backing_index} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code add_backing_index} - * kind. - */ - public IndexAndDataStreamAction addBackingIndex() { - return TaggedUnionUtils.get(this, Kind.AddBackingIndex); - } - - /** - * Is this variant instance of kind {@code remove_backing_index}? - */ - public boolean isRemoveBackingIndex() { - return _kind == Kind.RemoveBackingIndex; - } - - /** - * Get the {@code remove_backing_index} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code remove_backing_index} - * kind. - */ - public IndexAndDataStreamAction removeBackingIndex() { - return TaggedUnionUtils.get(this, Kind.RemoveBackingIndex); - } - - @Override - @SuppressWarnings("unchecked") - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeStartObject(); - - generator.writeKey(_kind.jsonValue()); - if (_value instanceof JsonpSerializable) { - ((JsonpSerializable) _value).serialize(generator, mapper); - } - - generator.writeEnd(); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Kind _kind; - private Object _value; - - @Override - protected Builder self() { - return this; - } - public ObjectBuilder addBackingIndex(IndexAndDataStreamAction v) { - this._kind = Kind.AddBackingIndex; - this._value = v; - return this; - } - - public ObjectBuilder addBackingIndex( - Function> fn) { - return this.addBackingIndex(fn.apply(new IndexAndDataStreamAction.Builder()).build()); - } - - public ObjectBuilder removeBackingIndex(IndexAndDataStreamAction v) { - this._kind = Kind.RemoveBackingIndex; - this._value = v; - return this; - } - - public ObjectBuilder removeBackingIndex( - Function> fn) { - return this.removeBackingIndex(fn.apply(new IndexAndDataStreamAction.Builder()).build()); - } - - public Action build() { - _checkSingleUse(); - return new Action(this); - } - - } - - protected static void setupActionDeserializer(ObjectDeserializer op) { - - op.add(Builder::addBackingIndex, IndexAndDataStreamAction._DESERIALIZER, "add_backing_index"); - op.add(Builder::removeBackingIndex, IndexAndDataStreamAction._DESERIALIZER, "remove_backing_index"); - - } - - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - Action::setupActionDeserializer, Builder::build); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/ActionBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/ActionBuilders.java deleted file mode 100644 index 966068fba..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/ActionBuilders.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.modify_data_stream; - -import co.elastic.clients.util.ObjectBuilder; -import java.util.function.Function; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Builders for {@link Action} variants. - */ -public class ActionBuilders { - private ActionBuilders() { - } - - /** - * Creates a builder for the {@link IndexAndDataStreamAction add_backing_index} - * {@code Action} variant. - */ - public static IndexAndDataStreamAction.Builder addBackingIndex() { - return new IndexAndDataStreamAction.Builder(); - } - - /** - * Creates a Action of the {@link IndexAndDataStreamAction add_backing_index} - * {@code Action} variant. - */ - public static Action addBackingIndex( - Function> fn) { - Action.Builder builder = new Action.Builder(); - builder.addBackingIndex(fn.apply(new IndexAndDataStreamAction.Builder()).build()); - return builder.build(); - } - - /** - * Creates a builder for the {@link IndexAndDataStreamAction - * remove_backing_index} {@code Action} variant. - */ - public static IndexAndDataStreamAction.Builder removeBackingIndex() { - return new IndexAndDataStreamAction.Builder(); - } - - /** - * Creates a Action of the {@link IndexAndDataStreamAction remove_backing_index} - * {@code Action} variant. - */ - public static Action removeBackingIndex( - Function> fn) { - Action.Builder builder = new Action.Builder(); - builder.removeBackingIndex(fn.apply(new IndexAndDataStreamAction.Builder()).build()); - return builder.build(); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/ActionVariant.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/ActionVariant.java deleted file mode 100644 index 88a044748..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/ActionVariant.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.modify_data_stream; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -/** - * Base interface for {@link Action} variants. - */ -public interface ActionVariant { - - Action.Kind _actionKind(); - - default Action _toAction() { - return new Action(this); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/IndexAndDataStreamAction.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/IndexAndDataStreamAction.java deleted file mode 100644 index 79d42882d..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/IndexAndDataStreamAction.java +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.modify_data_stream; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.modify_data_stream.IndexAndDataStreamAction - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexAndDataStreamAction implements ActionVariant, JsonpSerializable { - private final String dataStream; - - private final String index; - - // --------------------------------------------------------------------------------------------- - - private IndexAndDataStreamAction(Builder builder) { - - this.dataStream = ApiTypeHelper.requireNonNull(builder.dataStream, this, "dataStream"); - this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); - - } - - public static IndexAndDataStreamAction of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Action variant kind. - */ - @Override - public Action.Kind _actionKind() { - return Action.Kind.RemoveBackingIndex; - } - - /** - * Required - Data stream targeted by the action. - *

- * API name: {@code data_stream} - */ - public final String dataStream() { - return this.dataStream; - } - - /** - * Required - Index for the action. - *

- * API name: {@code index} - */ - public final String index() { - return this.index; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("data_stream"); - generator.write(this.dataStream); - - generator.writeKey("index"); - generator.write(this.index); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexAndDataStreamAction}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private String dataStream; - - private String index; - - /** - * Required - Data stream targeted by the action. - *

- * API name: {@code data_stream} - */ - public final Builder dataStream(String value) { - this.dataStream = value; - return this; - } - - /** - * Required - Index for the action. - *

- * API name: {@code index} - */ - public final Builder index(String value) { - this.index = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexAndDataStreamAction}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexAndDataStreamAction build() { - _checkSingleUse(); - - return new IndexAndDataStreamAction(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexAndDataStreamAction} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndexAndDataStreamAction::setupIndexAndDataStreamActionDeserializer); - - protected static void setupIndexAndDataStreamActionDeserializer( - ObjectDeserializer op) { - - op.add(Builder::dataStream, JsonpDeserializer.stringDeserializer(), "data_stream"); - op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/put_index_template/IndexTemplateMapping.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/put_index_template/IndexTemplateMapping.java deleted file mode 100644 index b22923919..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/put_index_template/IndexTemplateMapping.java +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.put_index_template; - -import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; -import co.elastic.clients.elasticsearch.indices.Alias; -import co.elastic.clients.elasticsearch.indices.DataStreamLifecycle; -import co.elastic.clients.elasticsearch.indices.IndexSettings; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.put_index_template.IndexTemplateMapping - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexTemplateMapping implements JsonpSerializable { - private final Map aliases; - - @Nullable - private final TypeMapping mappings; - - @Nullable - private final IndexSettings settings; - - @Nullable - private final DataStreamLifecycle lifecycle; - - // --------------------------------------------------------------------------------------------- - - private IndexTemplateMapping(Builder builder) { - - this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); - this.mappings = builder.mappings; - this.settings = builder.settings; - this.lifecycle = builder.lifecycle; - - } - - public static IndexTemplateMapping of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Aliases to add. If the index template includes a data_stream - * object, these are data stream aliases. Otherwise, these are index aliases. - * Data stream aliases ignore the index_routing, - * routing, and search_routing options. - *

- * API name: {@code aliases} - */ - public final Map aliases() { - return this.aliases; - } - - /** - * Mapping for fields in the index. If specified, this mapping can include field - * names, field data types, and mapping parameters. - *

- * API name: {@code mappings} - */ - @Nullable - public final TypeMapping mappings() { - return this.mappings; - } - - /** - * Configuration options for the index. - *

- * API name: {@code settings} - */ - @Nullable - public final IndexSettings settings() { - return this.settings; - } - - /** - * API name: {@code lifecycle} - */ - @Nullable - public final DataStreamLifecycle lifecycle() { - return this.lifecycle; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.aliases)) { - generator.writeKey("aliases"); - generator.writeStartObject(); - for (Map.Entry item0 : this.aliases.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.mappings != null) { - generator.writeKey("mappings"); - this.mappings.serialize(generator, mapper); - - } - if (this.settings != null) { - generator.writeKey("settings"); - this.settings.serialize(generator, mapper); - - } - if (this.lifecycle != null) { - generator.writeKey("lifecycle"); - this.lifecycle.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexTemplateMapping}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Map aliases; - - @Nullable - private TypeMapping mappings; - - @Nullable - private IndexSettings settings; - - @Nullable - private DataStreamLifecycle lifecycle; - - /** - * Aliases to add. If the index template includes a data_stream - * object, these are data stream aliases. Otherwise, these are index aliases. - * Data stream aliases ignore the index_routing, - * routing, and search_routing options. - *

- * API name: {@code aliases} - *

- * Adds all entries of map to aliases. - */ - public final Builder aliases(Map map) { - this.aliases = _mapPutAll(this.aliases, map); - return this; - } - - /** - * Aliases to add. If the index template includes a data_stream - * object, these are data stream aliases. Otherwise, these are index aliases. - * Data stream aliases ignore the index_routing, - * routing, and search_routing options. - *

- * API name: {@code aliases} - *

- * Adds an entry to aliases. - */ - public final Builder aliases(String key, Alias value) { - this.aliases = _mapPut(this.aliases, key, value); - return this; - } - - /** - * Aliases to add. If the index template includes a data_stream - * object, these are data stream aliases. Otherwise, these are index aliases. - * Data stream aliases ignore the index_routing, - * routing, and search_routing options. - *

- * API name: {@code aliases} - *

- * Adds an entry to aliases using a builder lambda. - */ - public final Builder aliases(String key, Function> fn) { - return aliases(key, fn.apply(new Alias.Builder()).build()); - } - - /** - * Mapping for fields in the index. If specified, this mapping can include field - * names, field data types, and mapping parameters. - *

- * API name: {@code mappings} - */ - public final Builder mappings(@Nullable TypeMapping value) { - this.mappings = value; - return this; - } - - /** - * Mapping for fields in the index. If specified, this mapping can include field - * names, field data types, and mapping parameters. - *

- * API name: {@code mappings} - */ - public final Builder mappings(Function> fn) { - return this.mappings(fn.apply(new TypeMapping.Builder()).build()); - } - - /** - * Configuration options for the index. - *

- * API name: {@code settings} - */ - public final Builder settings(@Nullable IndexSettings value) { - this.settings = value; - return this; - } - - /** - * Configuration options for the index. - *

- * API name: {@code settings} - */ - public final Builder settings(Function> fn) { - return this.settings(fn.apply(new IndexSettings.Builder()).build()); - } - - /** - * API name: {@code lifecycle} - */ - public final Builder lifecycle(@Nullable DataStreamLifecycle value) { - this.lifecycle = value; - return this; - } - - /** - * API name: {@code lifecycle} - */ - public final Builder lifecycle(Function> fn) { - return this.lifecycle(fn.apply(new DataStreamLifecycle.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexTemplateMapping}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexTemplateMapping build() { - _checkSingleUse(); - - return new IndexTemplateMapping(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexTemplateMapping} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndexTemplateMapping::setupIndexTemplateMappingDeserializer); - - protected static void setupIndexTemplateMappingDeserializer(ObjectDeserializer op) { - - op.add(Builder::aliases, JsonpDeserializer.stringMapDeserializer(Alias._DESERIALIZER), "aliases"); - op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings"); - op.add(Builder::settings, IndexSettings._DESERIALIZER, "settings"); - op.add(Builder::lifecycle, DataStreamLifecycle._DESERIALIZER, "lifecycle"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/reload_search_analyzers/ReloadDetails.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/reload_search_analyzers/ReloadDetails.java deleted file mode 100644 index 982e693ae..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/reload_search_analyzers/ReloadDetails.java +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.reload_search_analyzers; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.reload_search_analyzers.ReloadDetails - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ReloadDetails implements JsonpSerializable { - private final String index; - - private final List reloadedAnalyzers; - - private final List reloadedNodeIds; - - // --------------------------------------------------------------------------------------------- - - private ReloadDetails(Builder builder) { - - this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); - this.reloadedAnalyzers = ApiTypeHelper.unmodifiableRequired(builder.reloadedAnalyzers, this, - "reloadedAnalyzers"); - this.reloadedNodeIds = ApiTypeHelper.unmodifiableRequired(builder.reloadedNodeIds, this, "reloadedNodeIds"); - - } - - public static ReloadDetails of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code index} - */ - public final String index() { - return this.index; - } - - /** - * Required - API name: {@code reloaded_analyzers} - */ - public final List reloadedAnalyzers() { - return this.reloadedAnalyzers; - } - - /** - * Required - API name: {@code reloaded_node_ids} - */ - public final List reloadedNodeIds() { - return this.reloadedNodeIds; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("index"); - generator.write(this.index); - - if (ApiTypeHelper.isDefined(this.reloadedAnalyzers)) { - generator.writeKey("reloaded_analyzers"); - generator.writeStartArray(); - for (String item0 : this.reloadedAnalyzers) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.reloadedNodeIds)) { - generator.writeKey("reloaded_node_ids"); - generator.writeStartArray(); - for (String item0 : this.reloadedNodeIds) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ReloadDetails}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String index; - - private List reloadedAnalyzers; - - private List reloadedNodeIds; - - /** - * Required - API name: {@code index} - */ - public final Builder index(String value) { - this.index = value; - return this; - } - - /** - * Required - API name: {@code reloaded_analyzers} - *

- * Adds all elements of list to reloadedAnalyzers. - */ - public final Builder reloadedAnalyzers(List list) { - this.reloadedAnalyzers = _listAddAll(this.reloadedAnalyzers, list); - return this; - } - - /** - * Required - API name: {@code reloaded_analyzers} - *

- * Adds one or more values to reloadedAnalyzers. - */ - public final Builder reloadedAnalyzers(String value, String... values) { - this.reloadedAnalyzers = _listAdd(this.reloadedAnalyzers, value, values); - return this; - } - - /** - * Required - API name: {@code reloaded_node_ids} - *

- * Adds all elements of list to reloadedNodeIds. - */ - public final Builder reloadedNodeIds(List list) { - this.reloadedNodeIds = _listAddAll(this.reloadedNodeIds, list); - return this; - } - - /** - * Required - API name: {@code reloaded_node_ids} - *

- * Adds one or more values to reloadedNodeIds. - */ - public final Builder reloadedNodeIds(String value, String... values) { - this.reloadedNodeIds = _listAdd(this.reloadedNodeIds, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ReloadDetails}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ReloadDetails build() { - _checkSingleUse(); - - return new ReloadDetails(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ReloadDetails} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ReloadDetails::setupReloadDetailsDeserializer); - - protected static void setupReloadDetailsDeserializer(ObjectDeserializer op) { - - op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); - op.add(Builder::reloadedAnalyzers, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "reloaded_analyzers"); - op.add(Builder::reloadedNodeIds, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "reloaded_node_ids"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/reload_search_analyzers/ReloadResult.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/reload_search_analyzers/ReloadResult.java deleted file mode 100644 index 387a9a0eb..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/reload_search_analyzers/ReloadResult.java +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.reload_search_analyzers; - -import co.elastic.clients.elasticsearch._types.ShardStatistics; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.reload_search_analyzers.ReloadResult - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ReloadResult implements JsonpSerializable { - private final List reloadDetails; - - private final ShardStatistics shards; - - // --------------------------------------------------------------------------------------------- - - private ReloadResult(Builder builder) { - - this.reloadDetails = ApiTypeHelper.unmodifiableRequired(builder.reloadDetails, this, "reloadDetails"); - this.shards = ApiTypeHelper.requireNonNull(builder.shards, this, "shards"); - - } - - public static ReloadResult of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code reload_details} - */ - public final List reloadDetails() { - return this.reloadDetails; - } - - /** - * Required - API name: {@code _shards} - */ - public final ShardStatistics shards() { - return this.shards; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.reloadDetails)) { - generator.writeKey("reload_details"); - generator.writeStartArray(); - for (ReloadDetails item0 : this.reloadDetails) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - generator.writeKey("_shards"); - this.shards.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ReloadResult}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private List reloadDetails; - - private ShardStatistics shards; - - /** - * Required - API name: {@code reload_details} - *

- * Adds all elements of list to reloadDetails. - */ - public final Builder reloadDetails(List list) { - this.reloadDetails = _listAddAll(this.reloadDetails, list); - return this; - } - - /** - * Required - API name: {@code reload_details} - *

- * Adds one or more values to reloadDetails. - */ - public final Builder reloadDetails(ReloadDetails value, ReloadDetails... values) { - this.reloadDetails = _listAdd(this.reloadDetails, value, values); - return this; - } - - /** - * Required - API name: {@code reload_details} - *

- * Adds a value to reloadDetails using a builder lambda. - */ - public final Builder reloadDetails(Function> fn) { - return reloadDetails(fn.apply(new ReloadDetails.Builder()).build()); - } - - /** - * Required - API name: {@code _shards} - */ - public final Builder shards(ShardStatistics value) { - this.shards = value; - return this; - } - - /** - * Required - API name: {@code _shards} - */ - public final Builder shards(Function> fn) { - return this.shards(fn.apply(new ShardStatistics.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ReloadResult}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ReloadResult build() { - _checkSingleUse(); - - return new ReloadResult(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ReloadResult} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ReloadResult::setupReloadResultDeserializer); - - protected static void setupReloadResultDeserializer(ObjectDeserializer op) { - - op.add(Builder::reloadDetails, JsonpDeserializer.arrayDeserializer(ReloadDetails._DESERIALIZER), - "reload_details"); - op.add(Builder::shards, ShardStatistics._DESERIALIZER, "_shards"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexAliasItem.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexAliasItem.java deleted file mode 100644 index fb78dbddd..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexAliasItem.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.resolve_index; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.resolve_index.ResolveIndexAliasItem - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ResolveIndexAliasItem implements JsonpSerializable { - private final String name; - - private final List indices; - - // --------------------------------------------------------------------------------------------- - - private ResolveIndexAliasItem(Builder builder) { - - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.indices = ApiTypeHelper.unmodifiableRequired(builder.indices, this, "indices"); - - } - - public static ResolveIndexAliasItem of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Required - API name: {@code indices} - */ - public final List indices() { - return this.indices; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("name"); - generator.write(this.name); - - if (ApiTypeHelper.isDefined(this.indices)) { - generator.writeKey("indices"); - generator.writeStartArray(); - for (String item0 : this.indices) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ResolveIndexAliasItem}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private String name; - - private List indices; - - /** - * Required - API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Required - API name: {@code indices} - *

- * Adds all elements of list to indices. - */ - public final Builder indices(List list) { - this.indices = _listAddAll(this.indices, list); - return this; - } - - /** - * Required - API name: {@code indices} - *

- * Adds one or more values to indices. - */ - public final Builder indices(String value, String... values) { - this.indices = _listAdd(this.indices, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ResolveIndexAliasItem}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ResolveIndexAliasItem build() { - _checkSingleUse(); - - return new ResolveIndexAliasItem(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ResolveIndexAliasItem} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ResolveIndexAliasItem::setupResolveIndexAliasItemDeserializer); - - protected static void setupResolveIndexAliasItemDeserializer(ObjectDeserializer op) { - - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - op.add(Builder::indices, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "indices"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexDataStreamsItem.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexDataStreamsItem.java deleted file mode 100644 index 0640f7330..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexDataStreamsItem.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.resolve_index; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.resolve_index.ResolveIndexDataStreamsItem - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ResolveIndexDataStreamsItem implements JsonpSerializable { - private final String name; - - private final String timestampField; - - private final List backingIndices; - - // --------------------------------------------------------------------------------------------- - - private ResolveIndexDataStreamsItem(Builder builder) { - - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.timestampField = ApiTypeHelper.requireNonNull(builder.timestampField, this, "timestampField"); - this.backingIndices = ApiTypeHelper.unmodifiableRequired(builder.backingIndices, this, "backingIndices"); - - } - - public static ResolveIndexDataStreamsItem of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Required - API name: {@code timestamp_field} - */ - public final String timestampField() { - return this.timestampField; - } - - /** - * Required - API name: {@code backing_indices} - */ - public final List backingIndices() { - return this.backingIndices; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("name"); - generator.write(this.name); - - generator.writeKey("timestamp_field"); - generator.write(this.timestampField); - - if (ApiTypeHelper.isDefined(this.backingIndices)) { - generator.writeKey("backing_indices"); - generator.writeStartArray(); - for (String item0 : this.backingIndices) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ResolveIndexDataStreamsItem}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private String name; - - private String timestampField; - - private List backingIndices; - - /** - * Required - API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Required - API name: {@code timestamp_field} - */ - public final Builder timestampField(String value) { - this.timestampField = value; - return this; - } - - /** - * Required - API name: {@code backing_indices} - *

- * Adds all elements of list to backingIndices. - */ - public final Builder backingIndices(List list) { - this.backingIndices = _listAddAll(this.backingIndices, list); - return this; - } - - /** - * Required - API name: {@code backing_indices} - *

- * Adds one or more values to backingIndices. - */ - public final Builder backingIndices(String value, String... values) { - this.backingIndices = _listAdd(this.backingIndices, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ResolveIndexDataStreamsItem}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ResolveIndexDataStreamsItem build() { - _checkSingleUse(); - - return new ResolveIndexDataStreamsItem(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ResolveIndexDataStreamsItem} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ResolveIndexDataStreamsItem::setupResolveIndexDataStreamsItemDeserializer); - - protected static void setupResolveIndexDataStreamsItemDeserializer( - ObjectDeserializer op) { - - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - op.add(Builder::timestampField, JsonpDeserializer.stringDeserializer(), "timestamp_field"); - op.add(Builder::backingIndices, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "backing_indices"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexItem.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexItem.java deleted file mode 100644 index ec702bb65..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexItem.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.resolve_index; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.resolve_index.ResolveIndexItem - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ResolveIndexItem implements JsonpSerializable { - private final String name; - - private final List aliases; - - private final List attributes; - - @Nullable - private final String dataStream; - - // --------------------------------------------------------------------------------------------- - - private ResolveIndexItem(Builder builder) { - - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); - this.attributes = ApiTypeHelper.unmodifiableRequired(builder.attributes, this, "attributes"); - this.dataStream = builder.dataStream; - - } - - public static ResolveIndexItem of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * API name: {@code aliases} - */ - public final List aliases() { - return this.aliases; - } - - /** - * Required - API name: {@code attributes} - */ - public final List attributes() { - return this.attributes; - } - - /** - * API name: {@code data_stream} - */ - @Nullable - public final String dataStream() { - return this.dataStream; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("name"); - generator.write(this.name); - - if (ApiTypeHelper.isDefined(this.aliases)) { - generator.writeKey("aliases"); - generator.writeStartArray(); - for (String item0 : this.aliases) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.attributes)) { - generator.writeKey("attributes"); - generator.writeStartArray(); - for (String item0 : this.attributes) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (this.dataStream != null) { - generator.writeKey("data_stream"); - generator.write(this.dataStream); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ResolveIndexItem}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String name; - - @Nullable - private List aliases; - - private List attributes; - - @Nullable - private String dataStream; - - /** - * Required - API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * API name: {@code aliases} - *

- * Adds all elements of list to aliases. - */ - public final Builder aliases(List list) { - this.aliases = _listAddAll(this.aliases, list); - return this; - } - - /** - * API name: {@code aliases} - *

- * Adds one or more values to aliases. - */ - public final Builder aliases(String value, String... values) { - this.aliases = _listAdd(this.aliases, value, values); - return this; - } - - /** - * Required - API name: {@code attributes} - *

- * Adds all elements of list to attributes. - */ - public final Builder attributes(List list) { - this.attributes = _listAddAll(this.attributes, list); - return this; - } - - /** - * Required - API name: {@code attributes} - *

- * Adds one or more values to attributes. - */ - public final Builder attributes(String value, String... values) { - this.attributes = _listAdd(this.attributes, value, values); - return this; - } - - /** - * API name: {@code data_stream} - */ - public final Builder dataStream(@Nullable String value) { - this.dataStream = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ResolveIndexItem}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ResolveIndexItem build() { - _checkSingleUse(); - - return new ResolveIndexItem(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ResolveIndexItem} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ResolveIndexItem::setupResolveIndexItemDeserializer); - - protected static void setupResolveIndexItemDeserializer(ObjectDeserializer op) { - - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - op.add(Builder::aliases, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "aliases"); - op.add(Builder::attributes, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "attributes"); - op.add(Builder::dataStream, JsonpDeserializer.stringDeserializer(), "data_stream"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/rollover/RolloverConditions.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/rollover/RolloverConditions.java deleted file mode 100644 index b50f0ef8d..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/rollover/RolloverConditions.java +++ /dev/null @@ -1,583 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.rollover; - -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.rollover.RolloverConditions - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class RolloverConditions implements JsonpSerializable { - @Nullable - private final Time minAge; - - @Nullable - private final Time maxAge; - - @Nullable - private final Long maxAgeMillis; - - @Nullable - private final Long minDocs; - - @Nullable - private final Long maxDocs; - - @Nullable - private final String maxSize; - - @Nullable - private final Long maxSizeBytes; - - @Nullable - private final String minSize; - - @Nullable - private final Long minSizeBytes; - - @Nullable - private final String maxPrimaryShardSize; - - @Nullable - private final Long maxPrimaryShardSizeBytes; - - @Nullable - private final String minPrimaryShardSize; - - @Nullable - private final Long minPrimaryShardSizeBytes; - - @Nullable - private final Long maxPrimaryShardDocs; - - @Nullable - private final Long minPrimaryShardDocs; - - // --------------------------------------------------------------------------------------------- - - private RolloverConditions(Builder builder) { - - this.minAge = builder.minAge; - this.maxAge = builder.maxAge; - this.maxAgeMillis = builder.maxAgeMillis; - this.minDocs = builder.minDocs; - this.maxDocs = builder.maxDocs; - this.maxSize = builder.maxSize; - this.maxSizeBytes = builder.maxSizeBytes; - this.minSize = builder.minSize; - this.minSizeBytes = builder.minSizeBytes; - this.maxPrimaryShardSize = builder.maxPrimaryShardSize; - this.maxPrimaryShardSizeBytes = builder.maxPrimaryShardSizeBytes; - this.minPrimaryShardSize = builder.minPrimaryShardSize; - this.minPrimaryShardSizeBytes = builder.minPrimaryShardSizeBytes; - this.maxPrimaryShardDocs = builder.maxPrimaryShardDocs; - this.minPrimaryShardDocs = builder.minPrimaryShardDocs; - - } - - public static RolloverConditions of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code min_age} - */ - @Nullable - public final Time minAge() { - return this.minAge; - } - - /** - * API name: {@code max_age} - */ - @Nullable - public final Time maxAge() { - return this.maxAge; - } - - /** - * API name: {@code max_age_millis} - */ - @Nullable - public final Long maxAgeMillis() { - return this.maxAgeMillis; - } - - /** - * API name: {@code min_docs} - */ - @Nullable - public final Long minDocs() { - return this.minDocs; - } - - /** - * API name: {@code max_docs} - */ - @Nullable - public final Long maxDocs() { - return this.maxDocs; - } - - /** - * API name: {@code max_size} - */ - @Nullable - public final String maxSize() { - return this.maxSize; - } - - /** - * API name: {@code max_size_bytes} - */ - @Nullable - public final Long maxSizeBytes() { - return this.maxSizeBytes; - } - - /** - * API name: {@code min_size} - */ - @Nullable - public final String minSize() { - return this.minSize; - } - - /** - * API name: {@code min_size_bytes} - */ - @Nullable - public final Long minSizeBytes() { - return this.minSizeBytes; - } - - /** - * API name: {@code max_primary_shard_size} - */ - @Nullable - public final String maxPrimaryShardSize() { - return this.maxPrimaryShardSize; - } - - /** - * API name: {@code max_primary_shard_size_bytes} - */ - @Nullable - public final Long maxPrimaryShardSizeBytes() { - return this.maxPrimaryShardSizeBytes; - } - - /** - * API name: {@code min_primary_shard_size} - */ - @Nullable - public final String minPrimaryShardSize() { - return this.minPrimaryShardSize; - } - - /** - * API name: {@code min_primary_shard_size_bytes} - */ - @Nullable - public final Long minPrimaryShardSizeBytes() { - return this.minPrimaryShardSizeBytes; - } - - /** - * API name: {@code max_primary_shard_docs} - */ - @Nullable - public final Long maxPrimaryShardDocs() { - return this.maxPrimaryShardDocs; - } - - /** - * API name: {@code min_primary_shard_docs} - */ - @Nullable - public final Long minPrimaryShardDocs() { - return this.minPrimaryShardDocs; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.minAge != null) { - generator.writeKey("min_age"); - this.minAge.serialize(generator, mapper); - - } - if (this.maxAge != null) { - generator.writeKey("max_age"); - this.maxAge.serialize(generator, mapper); - - } - if (this.maxAgeMillis != null) { - generator.writeKey("max_age_millis"); - generator.write(this.maxAgeMillis); - - } - if (this.minDocs != null) { - generator.writeKey("min_docs"); - generator.write(this.minDocs); - - } - if (this.maxDocs != null) { - generator.writeKey("max_docs"); - generator.write(this.maxDocs); - - } - if (this.maxSize != null) { - generator.writeKey("max_size"); - generator.write(this.maxSize); - - } - if (this.maxSizeBytes != null) { - generator.writeKey("max_size_bytes"); - generator.write(this.maxSizeBytes); - - } - if (this.minSize != null) { - generator.writeKey("min_size"); - generator.write(this.minSize); - - } - if (this.minSizeBytes != null) { - generator.writeKey("min_size_bytes"); - generator.write(this.minSizeBytes); - - } - if (this.maxPrimaryShardSize != null) { - generator.writeKey("max_primary_shard_size"); - generator.write(this.maxPrimaryShardSize); - - } - if (this.maxPrimaryShardSizeBytes != null) { - generator.writeKey("max_primary_shard_size_bytes"); - generator.write(this.maxPrimaryShardSizeBytes); - - } - if (this.minPrimaryShardSize != null) { - generator.writeKey("min_primary_shard_size"); - generator.write(this.minPrimaryShardSize); - - } - if (this.minPrimaryShardSizeBytes != null) { - generator.writeKey("min_primary_shard_size_bytes"); - generator.write(this.minPrimaryShardSizeBytes); - - } - if (this.maxPrimaryShardDocs != null) { - generator.writeKey("max_primary_shard_docs"); - generator.write(this.maxPrimaryShardDocs); - - } - if (this.minPrimaryShardDocs != null) { - generator.writeKey("min_primary_shard_docs"); - generator.write(this.minPrimaryShardDocs); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link RolloverConditions}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Time minAge; - - @Nullable - private Time maxAge; - - @Nullable - private Long maxAgeMillis; - - @Nullable - private Long minDocs; - - @Nullable - private Long maxDocs; - - @Nullable - private String maxSize; - - @Nullable - private Long maxSizeBytes; - - @Nullable - private String minSize; - - @Nullable - private Long minSizeBytes; - - @Nullable - private String maxPrimaryShardSize; - - @Nullable - private Long maxPrimaryShardSizeBytes; - - @Nullable - private String minPrimaryShardSize; - - @Nullable - private Long minPrimaryShardSizeBytes; - - @Nullable - private Long maxPrimaryShardDocs; - - @Nullable - private Long minPrimaryShardDocs; - - /** - * API name: {@code min_age} - */ - public final Builder minAge(@Nullable Time value) { - this.minAge = value; - return this; - } - - /** - * API name: {@code min_age} - */ - public final Builder minAge(Function> fn) { - return this.minAge(fn.apply(new Time.Builder()).build()); - } - - /** - * API name: {@code max_age} - */ - public final Builder maxAge(@Nullable Time value) { - this.maxAge = value; - return this; - } - - /** - * API name: {@code max_age} - */ - public final Builder maxAge(Function> fn) { - return this.maxAge(fn.apply(new Time.Builder()).build()); - } - - /** - * API name: {@code max_age_millis} - */ - public final Builder maxAgeMillis(@Nullable Long value) { - this.maxAgeMillis = value; - return this; - } - - /** - * API name: {@code min_docs} - */ - public final Builder minDocs(@Nullable Long value) { - this.minDocs = value; - return this; - } - - /** - * API name: {@code max_docs} - */ - public final Builder maxDocs(@Nullable Long value) { - this.maxDocs = value; - return this; - } - - /** - * API name: {@code max_size} - */ - public final Builder maxSize(@Nullable String value) { - this.maxSize = value; - return this; - } - - /** - * API name: {@code max_size_bytes} - */ - public final Builder maxSizeBytes(@Nullable Long value) { - this.maxSizeBytes = value; - return this; - } - - /** - * API name: {@code min_size} - */ - public final Builder minSize(@Nullable String value) { - this.minSize = value; - return this; - } - - /** - * API name: {@code min_size_bytes} - */ - public final Builder minSizeBytes(@Nullable Long value) { - this.minSizeBytes = value; - return this; - } - - /** - * API name: {@code max_primary_shard_size} - */ - public final Builder maxPrimaryShardSize(@Nullable String value) { - this.maxPrimaryShardSize = value; - return this; - } - - /** - * API name: {@code max_primary_shard_size_bytes} - */ - public final Builder maxPrimaryShardSizeBytes(@Nullable Long value) { - this.maxPrimaryShardSizeBytes = value; - return this; - } - - /** - * API name: {@code min_primary_shard_size} - */ - public final Builder minPrimaryShardSize(@Nullable String value) { - this.minPrimaryShardSize = value; - return this; - } - - /** - * API name: {@code min_primary_shard_size_bytes} - */ - public final Builder minPrimaryShardSizeBytes(@Nullable Long value) { - this.minPrimaryShardSizeBytes = value; - return this; - } - - /** - * API name: {@code max_primary_shard_docs} - */ - public final Builder maxPrimaryShardDocs(@Nullable Long value) { - this.maxPrimaryShardDocs = value; - return this; - } - - /** - * API name: {@code min_primary_shard_docs} - */ - public final Builder minPrimaryShardDocs(@Nullable Long value) { - this.minPrimaryShardDocs = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link RolloverConditions}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public RolloverConditions build() { - _checkSingleUse(); - - return new RolloverConditions(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link RolloverConditions} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, RolloverConditions::setupRolloverConditionsDeserializer); - - protected static void setupRolloverConditionsDeserializer(ObjectDeserializer op) { - - op.add(Builder::minAge, Time._DESERIALIZER, "min_age"); - op.add(Builder::maxAge, Time._DESERIALIZER, "max_age"); - op.add(Builder::maxAgeMillis, JsonpDeserializer.longDeserializer(), "max_age_millis"); - op.add(Builder::minDocs, JsonpDeserializer.longDeserializer(), "min_docs"); - op.add(Builder::maxDocs, JsonpDeserializer.longDeserializer(), "max_docs"); - op.add(Builder::maxSize, JsonpDeserializer.stringDeserializer(), "max_size"); - op.add(Builder::maxSizeBytes, JsonpDeserializer.longDeserializer(), "max_size_bytes"); - op.add(Builder::minSize, JsonpDeserializer.stringDeserializer(), "min_size"); - op.add(Builder::minSizeBytes, JsonpDeserializer.longDeserializer(), "min_size_bytes"); - op.add(Builder::maxPrimaryShardSize, JsonpDeserializer.stringDeserializer(), "max_primary_shard_size"); - op.add(Builder::maxPrimaryShardSizeBytes, JsonpDeserializer.longDeserializer(), "max_primary_shard_size_bytes"); - op.add(Builder::minPrimaryShardSize, JsonpDeserializer.stringDeserializer(), "min_primary_shard_size"); - op.add(Builder::minPrimaryShardSizeBytes, JsonpDeserializer.longDeserializer(), "min_primary_shard_size_bytes"); - op.add(Builder::maxPrimaryShardDocs, JsonpDeserializer.longDeserializer(), "max_primary_shard_docs"); - op.add(Builder::minPrimaryShardDocs, JsonpDeserializer.longDeserializer(), "min_primary_shard_docs"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/simulate_template/Overlapping.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/simulate_template/Overlapping.java deleted file mode 100644 index 1235ad9a4..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/simulate_template/Overlapping.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.simulate_template; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.simulate_template.Overlapping - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class Overlapping implements JsonpSerializable { - private final String name; - - private final List indexPatterns; - - // --------------------------------------------------------------------------------------------- - - private Overlapping(Builder builder) { - - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.indexPatterns = ApiTypeHelper.unmodifiableRequired(builder.indexPatterns, this, "indexPatterns"); - - } - - public static Overlapping of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Required - API name: {@code index_patterns} - */ - public final List indexPatterns() { - return this.indexPatterns; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("name"); - generator.write(this.name); - - if (ApiTypeHelper.isDefined(this.indexPatterns)) { - generator.writeKey("index_patterns"); - generator.writeStartArray(); - for (String item0 : this.indexPatterns) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link Overlapping}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String name; - - private List indexPatterns; - - /** - * Required - API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Required - API name: {@code index_patterns} - *

- * Adds all elements of list to indexPatterns. - */ - public final Builder indexPatterns(List list) { - this.indexPatterns = _listAddAll(this.indexPatterns, list); - return this; - } - - /** - * Required - API name: {@code index_patterns} - *

- * Adds one or more values to indexPatterns. - */ - public final Builder indexPatterns(String value, String... values) { - this.indexPatterns = _listAdd(this.indexPatterns, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link Overlapping}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public Overlapping build() { - _checkSingleUse(); - - return new Overlapping(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link Overlapping} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - Overlapping::setupOverlappingDeserializer); - - protected static void setupOverlappingDeserializer(ObjectDeserializer op) { - - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - op.add(Builder::indexPatterns, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "index_patterns"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/simulate_template/Template.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/simulate_template/Template.java deleted file mode 100644 index 516a1f06a..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/simulate_template/Template.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you 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. - */ - -package co.elastic.clients.elasticsearch.indices.simulate_template; - -import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; -import co.elastic.clients.elasticsearch.indices.Alias; -import co.elastic.clients.elasticsearch.indices.IndexSettings; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: indices.simulate_template.Template - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class Template implements JsonpSerializable { - private final Map aliases; - - private final TypeMapping mappings; - - private final IndexSettings settings; - - // --------------------------------------------------------------------------------------------- - - private Template(Builder builder) { - - this.aliases = ApiTypeHelper.unmodifiableRequired(builder.aliases, this, "aliases"); - this.mappings = ApiTypeHelper.requireNonNull(builder.mappings, this, "mappings"); - this.settings = ApiTypeHelper.requireNonNull(builder.settings, this, "settings"); - - } - - public static Template of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code aliases} - */ - public final Map aliases() { - return this.aliases; - } - - /** - * Required - API name: {@code mappings} - */ - public final TypeMapping mappings() { - return this.mappings; - } - - /** - * Required - API name: {@code settings} - */ - public final IndexSettings settings() { - return this.settings; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.aliases)) { - generator.writeKey("aliases"); - generator.writeStartObject(); - for (Map.Entry item0 : this.aliases.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - generator.writeKey("mappings"); - this.mappings.serialize(generator, mapper); - - generator.writeKey("settings"); - this.settings.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link Template}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder